Ideally coffee should be stored in an airtight, opaque container in a cool, dark place. The worst enemies of coffee, both ground and whole bean are air, water, heat and light.
For more information see here:
We store out coffee in both a wine bottle with a wine stopper like this:
or in vacuum sealed plastic bags