7 plants that repel fruit flies and keep them out of your home

A fruit fly sitting on a plant stem
(Image credit: Shutterstock)

One of the most annoying pests to frequent our homes is fruit flies. These minute insects flock to ripe fruits and vegetables as well as stagnant drains. And it seems that, no matter how neat and tidy you are, they can still find their way into your kitchen. One fruit fly can quickly turn into an infestation, so you'll want to act quickly should you spot this pest.

Learning how to get rid of fruit flies can deal with this problem, but there are measures you can take to deter them from your home in the first place. One such method involves growing the right plants. Certain plants will help keep these pesky insects at bay and stop them from becoming a nuisance. If you’re keen to take advantage, here are 7 plants that repel fruit flies and keep them out of your home. 

Are spiders becoming a pest as well? Check out 9 plants that repel spiders and keep them out of your home.

1. Peppermint 


(Image credit: Shutterstock)

Nothing is quite so refreshing as the smell of peppermint. We use it everyday in the form of toothpaste, breath mints, soaps and even teas. Needless to say, it’s a scent most will find pleasing — with the exception of fruit flies. 

The fresh, sharp and distinctive aroma of mint will overwhelm fruit flies, making them turn tail and run. And with peppermint offering one of the strongest scents from the mint family, it will have the most impact. Add to that, peppermint will keep rodents at bay too, so it’s a useful plant to have at home. 

Mint is very easy to grow — both indoors and outside. It prefers sunny conditions, with moist, well-draining soil. However, keep in mind that mint grows quickly and can become invasive. So you may prefer to keep it in containers and trim it back with the best pruning shears

Mint is toxic to both cats and dogs, so avoid this plant if you have pets running around. 

2. Eucalyptus 

A eucalyptus tree

(Image credit: Shutterstock)

The oil produced by eucalyptus leaves is often used for medicinal purposes. Regularly found in cough syrups and lozenges, it’s a well-known treatment for a sore throat and can relieve cold and flu symptoms accordingly. On top of this, it can help reduce symptoms of pain and prompt relaxation, so it’s a useful oil to say the least. While we humans can see no end of benefits to this plant, it’s not a favorite for fruit flies. 

The scent of eucalyptus oil is abhorrent to fruit flies. Its minty and woody essence has a similar effect as peppermint. So, should you choose to grow eucalyptus in your home, the oil contained within will work its magic soon enough. 

Eucalyptus trees can be grown outside, or raised indoors as houseplants. Although, you may be better off growing a smaller variety in the case of the latter. A sunny spot with warm temperatures (65-75°F) and high humidity are best for this plant. 

Bear in mind it’s toxic for cats and dogs though, so keep pets away. 

3. Lavender

Three pots of lavender on a windowsill

(Image credit: Shutterstock)

Lavender features one of the most distinctive scents out there. It’s found anywhere and everywhere around the home, from bathroom soaps, to laundry detergents, to sweet cake recipes. We can't get enough of this light and refreshingly floral scent. Fruit flies would disagree though — such a scent does not appeal to this insect. In fact, they will steer clear at every opportunity, as will spiders, rodents and even deer. 

Lavender is more often grown outdoors rather than inside, but these plants can be brought in over the winter. As a hardy plant, lavender prefers full sun and well-draining soil. If you’re growing it outside and want to take advantage of its fruit-fly repelling qualities, you can hang cuttings indoors. Alternatively the oil can be purchased separately, and combined with water to spritz around the home. An example of this would be Majestic Pure Lavender Essential Oil ($16.95, Amazon). 

It’s another toxic plant for both cats and dogs though, so avoid it if you have furry family members.  

4. Basil 

Someone picking leaves from a basil plant

(Image credit: Shutterstock)

We often use basil leaves to garnish and flavor everyday dishes in the kitchen, such as pizza and pasta. But, it's useful in more than one way because its sweet, herbaceous aroma repels fruit flies too. Not only that, ants and mosquitoes will stay away — pests, such as these, dislike the intense aroma. 

Basil admittedly isn’t the easiest thing to grow, but it’s not impossible. It can be grown in containers indoors or outside with the right conditions. Partial shade with a consistent warm temperature and well-drained soil is best. A windowsill may work for placement, but make sure it’s not over-exposed to the sun, which will burn the leaves. 

This plant is non-toxic to both cats and dogs, so it’s a great option if you’ve got pets.

5. Venus Fly Trap 

A Venus Fly Trap plant on a windowsill

(Image credit: Shutterstock)

The Venus Fly Trap technically isn’t repelling fruit flies — in fact, it’s actually trying to attract them by mimicking the sweet smell of fresh flowers. Should an unsuspecting fruit fly land in the ‘mouth’ of this plant and trigger the trap by stepping on one of the hairs, it will snap shut to catch the fly, and make a meal of the situation.  

Such a method likely won’t help much if there’s an abundance of fruit flies in your home, but it can help catch out the odd one. These carnivorous plants are relatively easy to care for, but they will require a taller container because the root system can grow deep and intricate. A sunny spot will be needed for best growth, with acidic well-draining soil.

While this plant may be bad news for flies, it’s non-toxic to cats and dogs so is safe to grow around your pets.    

6. Rosemary

Rosemary in a pot next to a windowsill

(Image credit: Shutterstock)

Rosemary can make for a delicious addition to your meals. The sprigs are dried and broken down to create a complimentary spice, which leaves a distinctive herbal flavor behind. But, should you want to repel fruit flies, you don’t have to go that far. The scent of the live plant alone will help keep these pests at bay. Spiders, ants and other flies will actively stay away as well.  

Rosemary is easy to grow, both indoors and outside, requiring full sun and regular water in well-draining soil. If kept in a container, bear in mind you will need to repot it roughly once a year. On that note, here are 9 mistakes you make when repotting a plant.   

This plant is non-toxic to cats and dogs, which makes it all the better.  

7. Clove Tree 

A flowering Clove Tree

(Image credit: Shutterstock)

One thing fruit flies can’t stand is cloves. These small stick-like spices contain a pungent and yet pleasant smell which is often used in cooking. They’re ground up to add flavor to marinades and meat rubs as well as curries. These spices are actually the dried flower buds from clove trees, picked before they’ve had a chance to bloom.

If you want a steady supply of fruit fly-repellent cloves, you can grow your own clove tree outdoors, or even bring it inside as a houseplant. It grows best in full sun, although partial shade is also possible, in humid temperatures above 50°F. You will need to harvest and dry out the cloves yourself while the flower buds are pink, but unopened. Once you have your cloves, poke 10 or so into a sliced lemon or lime and leave on display to repel any fruit flies that near. An apple can work here as well.

If this sounds like too much effort, you can also buy whole cloves readily online, such as the Spice Train Handpicked Cloves ($14.99, Amazon). Cloves are toxic to cats and dogs though, so skip this plant if you've got pets.     

More from Tom's Guide

Katie Mortram
Homes Editor

Katie looks after everything homes-related, from kitchen appliances to gardening tools. She also covers smart home products too, so is the best point of contact for any household advice! She has tested and reviewed appliances for over 6 years, so she knows what to look for when finding the best. Her favorite thing to test has to be air purifiers, as the information provided and the difference between performances is extensive.