Storing the beans in a cool and dry place and away from sunlight is recommended in order to get the best results when brewing your coffee every time and the beans can keep for up to three weeks after roasting. After roasting the best way to store the beans would be in an airtight container that has a one way valve on it that let´s the CO2 that builds up in the coffee bean when roasting out of the airtight container and at the same time keeps the oxygen out.
If you would happen to find a very good deal on coffee beans in bulk quantities and store them for later use, a freezer will come in handy to store all those beans. There are however two rules that you must follow in order to make this possible and keep the beans fresh in the freezer.
1. Because the coffee bean is porous it will absorb flavors and smells present in the freezer which will compromise the both the flavors and aromas of the coffee beans.
2. Store the beans in the freezer in an airtight container or zipper pouches coffee bags, preferably with a degassing valve, that way they can keep for up to six months. It is vital to let the container and beans to warm up to room temperature before opening it. This will avoid messing with the humidity of the beans to much. Never re-freeze the beans after they have thawed.