Yes, tight lid is the best way, you might say, but that is not very easy/creative idea to do it. Have you got your best way to protect coffee from getting wet and damage?
Just store your coffee in an airtight container or plastic bag, along with a small pouch of silica gel on top of the contents.
Silica gel is non-toxic, non-flammable, non-reactive and stable with ordinary usage. It absorbs moisture from the surroundings effectively. It is commonly used to dry out empty water bottles and to remove moisture from shoes, which in return prevents the stench.
Due to supply problems importing, roasting, and blending forces me to order and buy a minimum amount of my favourite coffee at a time. It will last me more than a month.
I asked the supplier how best to store my investment.
The supplier suggested I keep/store the unground beans at room temperature in the original corrugated-plastic lined paper bags with a roll-down cuff and metal "closure" seal. Grind as much as you need and roll the cuff to keep air in the package to a minimum for the remainder. If you do refrigerate the beans, let them come to room temperature before grinding to enjoy the full flavour and bouquet from the brew.
I keep unopened bags of coffee in a small carton on the bottom shelf of a cupboard in the kitchen. I've been doing this for years.
I did notice that when I first get the batch of beans from the coffee roasters they're oily and very shiny. As time passes, the gloss slowly disappears and near the end of the batch the beans have a matte finish as the oil gets absorbed into the body of the bean.
Zipper closure plastic bags. Squeeze out the air when closing, and store them in an opaque canister or similar to keep light out. This will preserve coffee as well as any other method I've heard of.
Also, buy whole bean coffee and grind it when you're setting up the machine to brew -- whole bean keeps several times longer than ground coffee, and costs no more (you will need to buy a grinder, but they aren't expensive).
I use one of these to store my coffee. They are great. http://www.containerstore.com/s/kitchen/food-storage/canisters/click-clack-pantry-canisters/123d?productId=10033113