If you buy fresh coffee (fewer than seven days from roast date) from a reputable roaster that is packaged in something other than a sealed can, store the beans in a cool, dry place in an airtight container and brew within ten days from roast date for best flavor. If the coffee is a dark roast, ten days may be too long to capture the best flavors. If the coffee is properly sealed in a can at the roasting facility, the beans will maintain integrity for several months if not disturbed or exposed to heat. Once you open a can of coffee, you must use it as soon as possible (preferably within seven days).
Although many claim the freezer to be bad for beans, it is an effective solution for long term storage if coffee is sealed in an air-tight container and does not fluctuate in temperature at any point in its stored life. Pull out the amount you will be brewing at the time and promptly return remainder to freezer. You can use piece of plastic wrap over the top of the can prior to securing the lid to help freezer coffee last longer. Coffee will not last nearly as long in a refrigerator and should be avoided.