The absolute best way is to source the raw beans and roast them yourself for each cup as required ! Great concept but not feasible or practical (would take a while to prepare each cup…).
Your next best and practical option is to buy your beans from a roaster who sources quality raw beans and then roasts them to order. If possible, purchase whole beans in medium sized bags and grind them freshly for each cup.
The size of the bag is important, as buying too big a bag that then sits there for a prolonged period of time undoes some of the benefit of the fresh roast. As a rule of thumb, 1 shot of espresso is 8 grams of coffee, so if you’re having 2 coffees per day, that’s 16 x 30 = 480 grams of beans (not including any wastage) per month. That means a 500g bag would last just under a month. Coffee is generally best enjoyed up to 2 months from roasting (but best is within 1 month in our humble opinion!).
How should you store the beans?
Make sure the coffee is delivered in an opaque bag that is resealable and contains a degassing valve. Coffee beans can emit gasses for up to 3 weeks from roasting, so it’s important the bag has this valve to allow these gases to escape. Resealable bags also allow you to control the amount of air that the beans are exposed to after each use, thereby reducing oxidation (the biggest contributor to making coffee stale is contact with oxygen, much like a rusting effect). Alternatively, you can store your beans in a good sealable tin which also has a degassing valve. Both of these methods assume you will grind the beans as required for each cup.
What if you can’t grind your own beans?
Ask your roaster to grind the beans to suit the brewing method you will use. Just be aware that ground coffee will not last as long as whole beans. This is because more air touches more of the ground coffee given the smaller surface area versus whole beans, thereby increasing the effect of the oxidation process.
More storage tips
Also be aware of where you store the coffee itself. Amazingly, coffee is hygrocopic (which is a fancy way of saying coffee absorbs moisture, flavours and aromas from the air/items around it). This feature means the flavour of the coffee you brew can be impacted by what’s near, so don’t keep your coffee in a full pantry or the fridge (too many food items impacting flavour AND risk of condensation issues). It's best to simply keep the coffee in the resealable and degassing bag/tin at room temperature, away from other foodstuffs, out of direct sunlight, and on the counter near your coffee machine.
Summary
How to keep coffee fresh:
- Buy whole beans and grind them fresh for each cup
- Store the beans in a resealable bag or tin with a degassing valve
- Store the coffee in a cool, dark place away from other food items
But the most important thing is to enjoy it while it's fresh!