I get this question a lot, however I never seem to have a sure answer. That is because there are some variables.
The short answer is: in an airtight container.
My high tech coffee storage system
The next question is usually " should I freeze it?" and here is where I hesitate. First, I think that ideally you should only buy enough coffee that you can consume within a few weeks while it is still fresh. However, if you are paying the cost of shipping and trying to keep your habit economical; this isn't always practical. In that case, yes, let's consider freezing.
I sat in on a very interesting lecture by a researcher from MIT while I was up in Seattle at Coffee Expo. Among many other things, like how minerals in water effect coffee extraction and solubility, he discussed how freezing effects coffee (roasted or green). Freezing will slow the staling process of coffee, much like freezing bread. The important thing to remember is that moisture is the enemy. Every time you take the bag of coffee out of the freezer, pour some into your grinder, seal the bag back up and put it back in the freezer, you have introduced more moisture. So what Mr. MIT recommended was that you freeze coffee in small amounts of what you would use immediately.
So if you want to freeze, maybe you pour beans into several smaller sandwich size ziploc bags. Put those into a larger gallon ziploc or plastic container and remove them as needed. (You could easily stuff the empty bags back into the gallon sized one and use them again later)
If you happen to have a bought a few pounds of the Panama Cup of Excellence and want to pull it out for special occasions, you'd better wrap it like Wagyu beef (almost costs s much).
For most people however, just a good airtight jar will be adequate. The bags that J. Thaddeus Coffee is shipped in, as of today, are adequate for the short term. An airtight container will buy you a little more time. Let me know what works for you. I haven't experimented with freezing yet. I drink my favorites too quickly. And my freezer is full of ice cream.