Ants may prove to be a pesky problem around garden plants or as you spend time pondering life from the patio. Although coffee grounds do not kill ants, they do repel many ant species. If you feel ants are a major threat to pets, plants and people, hot coffee dumped directly on the anthill will kill some ants that come into contact with the hot liquid.
Keeping Ants Away from Plants
If you've noticed a plethora of the pests scurrying around particular plants in your garden, sprinkle used coffee grounds in a circle around individual plants or a grouping of plants. Ants rely on scent trails to determine where they're going; the chunky coffee grounds block the path and potentially the ants' scent trail as well. This method will not work if the anthill or ants are within the ring of coffee grounds. This same method can be used to block ant trails leading outdoors toward your home. Create a high line of grounds that crosses the usual ant path, replacing the grounds daily or as needed.
Eliminating Anthills without Killing Ants
Create a ring of used coffee grounds around the perimeter of an active anthill, sprinkling grounds atop the hill as well, burying it as much as possible. Ants do not like crossing over or through coffee grounds, so they may abandon the anthill or build another entrance. After a day or two, they may team up and move the grounds out of the way, so you'll have to apply a fresh batch of coffee grounds. Eventually the ants may abandon the hill entirely.
Killing Ants with Coffee
Coffee grounds themselves will not kill ants -- nor will cold or lukewarm coffee. If you feel the need to permanently get rid of an ant colony, pour boiling hot coffee or water directly into ant holes or anthills. The hot liquid kills any ant it contacts, although it may take repeated applications to decimate the entire colony. Do not pour hot coffee or hot water atop any plants or the lawn because the liquid may kill them as well.