After roasting, coffee beans retain their freshness when kept properly for one to two months. It is often kept in bags, jars, or plastic storage containers.
The finest ziplock bags for storage are those with a degassing valve. They are opaque, sealed off from air and moisture, and include a valve that lets you drain the carbon dioxide that newly roasted grains emit.
Glass and ceramic jars with airtight lids come in a close second. Their benefit is that, like bags, they shield the coffee from moisture and unwelcome smells. There will always be air within, which has the drawback of allowing oxidative processes to continue and causing the coffee to lose its freshness.