What actually kills coffee
Four things: oxygen, light, heat, and moisture. Oxygen is the big one — it oxidizes the oils that carry flavor, which is why beans go dull and cardboardy within weeks of opening. Light and heat speed that up dramatically, which is why that cute jar on your sunny counter is a flavor crime scene. Moisture is the slow killer that invites staleness and, eventually, mold. Your job is to fight all four.
The right container
Airtight, opaque, and room temperature. A good canister with a one-way valve — like the bags roasters actually use — is ideal. The valve lets beans release CO2 without letting oxygen in, which is why those bags have the little round thing on them. If you are using a glass jar, keep it in a cupboard. If you are using a ceramic canister, make sure the lid actually seals; the cute ones often do not. And please retire the paper bag with the twist tie. It is not a storage solution; it is a suggestion.
What about the fridge? The freezer?
The fridge is a trap. Every time you open it, humidity rushes in, and beans act like little sponges for whatever smells live in there. Your coffee will start tasting like last week lasagna. Freezing is more complicated: it works fine for long-term storage if the beans are sealed airtight and you take out only what you need — never thaw and refreeze the same bag, because condensation ruins beans fast. But here is the thing: most people do not need long-term storage. If you are drinking coffee, you are using beans fast enough that the freezer is theater. Buy smaller bags, use them up, repeat.
Grind only what you need
Whole beans stay fresh dramatically longer than ground coffee, because grinding multiplies the surface area that oxygen can attack. A burr grinder and a habit of grinding right before brewing will do more for your cup than any storage container ever will. If you must buy pre-ground, buy it in small bags and use it fast.
How long is it actually good?
Whole beans are at their best within two to four weeks of the roast date, and fine for a few weeks after that if stored well. You will taste the decline before you can measure it — the cup gets flatter, the aroma gets fainter. Trust your nose. And a final note: beans degas for a few days after roasting, so very fresh beans need to rest before brewing. But that is a brewing problem, not a storage one.
Store them sealed, dark, and cool, grind fresh, and buy what you will actually drink. Your morning cup will notice.