Even the best coffee can taste average or even bad if it isn't stored properly and consumed later on. Coffee beans sitting around tend to lose their flavour, similar to a fruit that goes bad.
They need extra care to ensure that when brewed, they make rich, flavourful coffee. If you don’t store your coffee, it will stay fresh for up to 3 days. If roasted, it will last about 3-4 weeks.
However, to ensure that it retains its flavour completely, it is best to use a canister. Choose a canister that releases carbon dioxide and traps oxygen out of the container. This is because oxygen contains moisture which eventually gives that soggy flavour to your coffee.
Moreover, buy a canister that is not transparent so that it does not absorb sunlight. Place it in a cool, dry place where it is least susceptible to moisture and other environmental factors.