There’s a time and place for everything. For coffee, the time is now and the place is NOT in the fridge.
Before roasting, raw (green) coffee can be stored in sacks, bags, barrels… it hardly matters. Unroasted coffee will keep for months in your house. In fact, why not fill your basement with raw coffee and swim through it?
After roasting, however, care must be taken to ensure that the beans don’t lose their flavor or oils. Store your beans in an airtight container twelve hours after roasting — any sooner and the container may explode due to carbon dioxide release from the beans. (This is why freshly roasted vacuum-sealed coffee has to include one-way valve in the packaging.)
If you’re going to use all your beans within a couple days, the airtight thing isn’t as important.
It’s also vital to keep coffee at room temperature and out of direct sunlight. If coffee gets too hot it will lose its aroma. On the other hand, don’t put your coffee in the freezer or it’ll collect condensation and you’ll be left with soggy beans. Eww!
According to The Joy of Cooking, there is another reason that coffee beans shouldn’t be refrigerated or frozen; coffee absorbs smells. Before baking soda was used to absorb the stench of rotting leftovers, people used coffee. My, isn’t coffee versatile? So if you have ever kept your coffee in the fridge for a week and now your espresso comes out smelling like garlic and pizza sauce, you’ll know why. And more importantly, you’ll know not to do that again.