The most important first step towards enjoying fresh coffee is to buy recently roasted whole bean coffee. No storage of ground coffee can equal the job a coffee bean's shell does in keeping flavor, freshness, and aroma locked in. Secondly, try to buy the amount of coffee you will consume in two weeks. At our home, that amount of coffee is about three and a half pounds of beans.
The best way to store coffee beans is in an air-tight container kept in a dark and cool place. A good investment is crockery, stainless steel, or a glass container that has a tight seal.
The goal should be to keep the roasted coffee safe from moisture, air, light, and heat. Storing your coffee away from these elements will keep it fresh longer and assure excellent taste.
I have occasionally observed and heard of people storing coffee in their freezer. This environment accommodates the cool and dark needs for coffee beans but fails on the most critical issue of avoiding moisture. In addition to picking up moisture, coffee can absorb the flavor of neighbors in the freezer like shrimp and pizza. Also, the process of roasting coffee beans causes a release of oils producing a coffee's distinctive flavor. Freezing these oils can, in effect, eliminate the flavor of the coffee beans.
Never refrigerate coffee beans. Many of the same detrimental issues found in freezing will exist with refrigeration- except worse. Refrigerate your milk, your peaches, maybe your white wine- but never your coffee beans
Buy whole beans that are fresh and recently roasted.
Store your coffee beans in an air-tight container in a dark, cool place.
Grind beans just before brewing.