Coffee grounds may be used inside by placing tiny quantities of them in locations where ants are active, such as on counters, shelves in the pantry, or in close proximity to access sites.
For the best possible results with an ant repellent:
Reapply the coffee grounds on a regular basis, particularly after it has rained or there has been a lot of moisture, in order to maintain their efficacy.