Roasted coffee beans constitute a natural package for the volatile, delicate oils that supply coffee’s aroma and flavor. Storing coffee in whole-bean form and grinding it immediately before brewing is a first and essential step to experiencing it at its peak.
The ideal coffee routine for the urban home would be as follows: Buy the coffee as whole beans. Put the beans in an airtight container in a cool, dark place, and take out only as much as you want to grind and brew immediately. Airtight means airtight: no recycled coffee cans or cottage cheese cartons with plastic lids. Rather, a solid glass jar with a rubber gasket inside the cap that gives a good seal.
Putting beans in the refrigerator is downright foolish, even if you use an airtight container. Moisture is the enemy of roasted coffee. The flavor "oils" in roasted coffee are not oils, but very delicate, volatile water-soluble substances that moisture immediately dilutes and odors taint. Recall that refrigerators tend to be both moist and full of odors.
Freezing, however, is an excellent way to preserve whole-bean coffee if you do not intend to drink it within a week. Seal the beans in a freezer bag, put the bag in a part of the freezer that does not lose temperature every time you open the door, and remove only as many beans as you intend to consume in a day, returning the rest to the freezer. Thaw the liberated beans before grinding and brewing.