Coffee has four enemies: air, light, moisture and heat.
Keep it in an opaque airtight canister, in a dark and cool place, but not in the fridge: there it picks up moisture and smells.
Buy whole beans and enough for 2-4 weeks. Grind only what you will drink.
Our bags have a one-way valve: it lets carbon dioxide out and keeps air from coming in.