Coffee grounds should be stored in an airtight container. If you would like to keep them next to your Keurig machine, try putting them in a Tupperware or Ziploc bag! Make sure that the bag is sealed tightly so that ants cannot get inside. You can also store your coffee grounds near products with fragrances like peppermint oil, as this will discourage ants from entering your home (source 2).