How to Get Rid of Fruit Flies Naturally: 6 DIY Traps

Quick Reference: How to Get Rid of Fruit Flies

  • The pest: Drosophila melanogaster, the common fruit fly. Latin for “dew-loving.”
  • Life cycle: 8 to 10 days from egg to adult.
  • Eggs: Up to 50 at a pop, around 500 in a lifetime.
  • Best DIY trap: Apple cider vinegar plus 2 drops of dish soap in a small bowl.
  • Best deterrent: Refrigerate ripe fruit, take out trash daily, keep drains dry.
  • Worst season: Late summer through early fall, when warm kitchens speed up reproduction.
Tiny brown fruit flies hovering above ripe banana and peach in a wooden bowl on a sunlit kitchen counter, the most common scene when learning how to get rid of fruit flies.
A bowl of ripe summer fruit is the most common starting point for a fruit fly swarm.

Warmer weather brings unwanted guests to the kitchen, and the fruit fly tops the list. You set a bowl of peaches on the counter, turn your back for an afternoon, and a cloud of tiny brown flies is already circling the rim. This guide walks you through what they are, why they multiply so fast, how to keep them out of the house in the first place, and six homemade fruit fly traps that actually work.

What Are Fruit Flies?

Fruit flies are a household nuisance any time of year, but they peak in late summer and early fall. The common fruit fly, Drosophila melanogaster (Latin for “dew-loving”), is short-lived, fast-breeding, and grows from egg to adult in 8 to 10 days. Folks also call them “vinegar flies” because they chase anything fermented: rotting fruit, sugary spills, splashes of beer or wine, even a wet sponge in the sink.

They thrive in moist, damp places. Compost bins, garbage and recycling cans, garbage disposals, kitchen drains, and that nicely arranged fruit bowl on the counter all qualify, especially when fruit starts to ferment. If the swarm in your kitchen feels worse this summer, blame the temperature. Warmer rooms quicken the life cycle, and a quicker life cycle means more flies, sooner.

The University of California Statewide Integrated Pest Management Program lists fruit flies, drain flies, and fungus gnats together as the three small flies most often confused indoors, and the distinction matters because the treatments differ. See UC IPM’s Pest Notes on flies in the kitchen for the full identification key.

Health Risks

Fruit flies do not bite. They can, however, carry bacteria from one surface to another, which is enough reason to take a swarm seriously when it is parked on the food you plan to eat. They also reproduce on whatever they land on, so a single overlooked banana can turn into a colony in a week.

Most home infestations start at the grocery store. The flies, or their eggs, hitch a ride on fruit and walk into your kitchen in the shopping bag. Look produce over before you buy it, especially anywhere the skin is nicked, cracked, or already soft. Once inside, the flies are tiny enough to pass through ordinary window screens and the gaps around cabinet doors, and they will lay eggs anywhere rotten fruit or fermented liquid sits long enough to host them.

Identifying Fruit Flies vs. Drain Flies, Fungus Gnats, and Black Flies

If you see little black bugs swarming the kitchen, identify them before you treat them. Adult fruit flies are usually brownish with large red eyes and oval bodies, but they are only about an eighth of an inch long, so the easiest way to tell is to watch where they hang out.

  • Fruit flies hover around the fruit bowl, the wine glass, the compost bin, and the vinegar bottle.
  • Drain flies show up in the bathroom or kitchen sink and prefer drains and standing water.
  • Fungus gnats live around overwatered houseplants and weak, soggy potting soil.
  • Black flies are noticeably larger and usually bite outdoors near streams and shaded yards.

Related: 7 Ways To Repel Black Flies Naturally, and our broader guide to natural fly repellents for screens, porches, and patios.

How to Prevent a Fruit Fly Infestation

Once you know you have fruit flies, prevention comes down to cleaning. Track down what is drawing them, remove the source, and the swarm starves. Take away their food and their egg-laying sites, and the count drops fast.

Adult females can lay up to 50 eggs at a pop and around 500 in a life span. After hatching, the larvae feed on whatever they were laid on, that forgotten banana, the slick at the bottom of the recycling bin, for a few days before they mature. A fruit fly’s life cycle is short and the population grows quickly, so act the day you notice them rather than waiting out the weekend. Keep the kitchen free of standing food and as dry as possible, and the cycle breaks.

  • Be sure windows and doors are equipped with tight-fitting screens.
  • Take garbage out regularly. Daily during a peak.
  • Thoroughly clean and wipe down all surfaces, including under the toaster and behind the fruit bowl.
  • Do not leave dishes or food in the sink overnight.
  • Keep all drains and garbage disposals clean, dry, and clear of blockages.
  • Store fruits and vegetables in the fridge and use mesh covers for any produce that does not tolerate refrigeration.
  • Remove any moist objects, such as kitchen rags or sink rugs.
  • Quickly recycle or compost cardboard boxes that held produce where flies could be breeding.
  • Be sure your kitchen compost seals well and empty it frequently.
  • Empty all alcohol bottles and rinse well before recycling.
  • Scrub residue off bottoms of garbage and recycling bins.
  • Turn up the AC. Cooler rooms make for slower flies and slower reproduction.

How to Get Rid of Fruit Flies

After the food and egg-laying sources are gone, a homemade fruit fly trap will pull down the adult count. If a real infestation is already in motion, set two or three of the traps below at once. Pair them with the prevention checklist above and the swarm clears in a few days.

Fruit flies swarming sliced watermelon on a kitchen counter, the kind of fermenting fruit that draws Drosophila melanogaster indoors.
Farmers' Almanac Planting Calendar, the herbs and produce that draw or repel fruit flies indoors.

Plant at the Right Time, Every Time

Basil on the counter keeps fruit flies away. Use our Planting Calendar to know exactly when to start basil, mint, and other kitchen herbs in your zone.

Open the Planting Calendar

6 Best DIY Fruit Fly Trap Recipes

Each of these uses things already on the shelf. Pick the one that matches what you have, set it on the counter near where the flies are clustering, and check it the next morning.

  1. Paper cone in a jar. Form a cone-shaped funnel with an 8-by-10-inch piece of paper. Place the funnel into a jar with some apple cider vinegar at the bottom, or use chunks of fermenting fruit to lure them in. The flies enter the trap easily but cannot get out.
  2. Apple cider vinegar bottle trap. Pour about a quarter cup of apple cider vinegar into an empty bottle and cover with plastic wrap. Secure it with a rubber band and poke a small hole in the plastic wrap with a nail. Fruit flies will fly in but will not find their way out.
  3. Beer trap. Pour about a half-cup of beer (old or fresh) into a mason jar with a lid. Hammer a couple of small holes in the metal lid and secure it. Fruit flies dive in for the yeasty smell and drown. You can refresh and reuse this trap all summer.
  4. Wine bottle trap. Leave a little wine in the bottom of a bottle and set it on the counter. Fruit flies fly down the neck for the fermented liquid, but the narrow opening prevents them from finding their way back out.
  5. Fresh basil. Fruit flies do not like fresh basil. Keep a potted basil plant on the counter near the fruit bowl as a passive deterrent. It will not clear an active swarm, but it lowers the count once you have one set.
  6. Apple cider vinegar and dish soap trap. Fill a small bowl with apple cider vinegar and 2 drops of liquid dish soap. Mix well and leave on the counter, away from pets. The soap breaks the surface tension of the vinegar, so the flies sink instead of skating across the top. This is the most reliable of the six.
Homemade apple cider vinegar and dish soap fruit fly trap on a kitchen counter, the most reliable DIY method for how to get rid of fruit flies.
Wondering how to get rid of fruit flies? The simplest recipe is a small bowl of apple cider vinegar with two drops of dish soap.

When Fruit Flies Peak: US and Canada

Fruit flies follow heat and humidity, so the peak weeks shift with the region. The table below is a general guide for North America. Local conditions can move these windows by a week or two in either direction.

Region Peak fruit fly window What to watch for
US Northeast and Upper Midwest Late July through October Spike around late summer harvest, peach and tomato season
US Southeast and Gulf Coast Late May through November Long warm humid season, frequent drain-fly overlap
US Plains and Mountain West June through September Shorter window, sharp rise after produce-heavy weeks
US Pacific Coast June through October Slow build, mild kitchens keep adults active longer
Canada (most provinces) Mid-July through September Tight window, but warm indoor kitchens stretch it into fall

If your kitchen runs warm year-round, treat fruit flies as a year-round task and not a seasonal one. The University of Kentucky’s entomology department notes that indoor populations can persist all winter when food sources are available, which is why a few traps and the prevention checklist matter even in January. For broader pest-friendly garden planning, our companion planting guide covers herbs that deter common kitchen pests.

Kitchen Tradition: Vinegar, Basil, and a Bit of Honest Caveat

The vinegar trap is older than the Almanac. Cooks have used a saucer of cider vinegar to thin a swarm for as long as cider has been pressed, and the basil-on-the-counter trick shows up in nineteenth-century homemaking guides. The folklore holds up because the chemistry is real. Drosophila uses smell to find fermentation, and a small dish of vinegar mimics exactly what their antennae are tuned for. The honest caveat is that no DIY trap clears an infestation by itself. Pair the trap with a clean drain, a sealed compost bin, and a fridge full of ripe produce, and the count goes to near zero. Skip the cleaning step, and the same trap will refill day after day. For more vinegar-based home tricks, see our list of apple cider vinegar uses around the house.

When a Swarm Calls for a Pro

Most fruit fly problems clear in a week with cleaning plus a vinegar-and-soap trap. A few do not. Call a licensed pest professional if the swarm keeps returning after a thorough kitchen cleanout and a week of traps, if you find flies clustered around a drain that will not run clear, or if the source seems to be behind a wall or under a fridge you cannot move. Persistent indoor populations are often a drain or appliance issue rather than a produce issue, and a pro can pinpoint the breeding site faster than you can.

Get the Full 2026 Farmers’ Almanac

Long-range weather, the full Planting Calendar, Best Days, and natural household tips like this one. Plan your day, grow your life.

Join All-Access

2026 Farmers' Almanac subscription cover, full planting calendar and natural home tips.
Apple cider vinegar and dish soap DIY fruit fly trap in a clear glass bowl on a wooden counter, the most reliable homemade method for how to get rid of fruit flies.
Apple cider vinegar plus two drops of dish soap is the most reliable DIY fruit fly trap.

Fruit Fly FAQ

What is the fastest way to get rid of fruit flies?

Set out a small bowl of apple cider vinegar with 2 drops of dish soap, take out the trash, and rinse your kitchen drain. Most kitchens see the swarm drop by 80 percent within 24 hours when all three are done together.

Where are fruit flies coming from in my house?

Most often, the grocery store. Fruit flies and their eggs ride in on produce, especially fruit with nicks or soft spots. After that, the usual sources are the garbage disposal, kitchen drain, compost bin, recycling, and any ripe fruit left on the counter.

Do fruit flies bite or carry disease?

Fruit flies do not bite. They can carry bacteria from one surface to another, which is reason enough to clear a swarm rather than ignore it, but they are not a direct disease threat the way a mosquito or a tick is.

How long does it take to get rid of a fruit fly infestation?

Five to ten days, the length of the fruit fly’s life cycle, if you set traps and remove every food source on day one. Skipping the cleaning step stretches the timeline indefinitely, because new eggs keep hatching.

Does basil really keep fruit flies away?

A pot of fresh basil on the counter helps deter fruit flies, but it is a passive measure. It works best as part of a routine that includes a vinegar trap, a clean drain, and refrigerated fruit. Basil alone will not clear an active infestation.

Are fruit flies and gnats the same thing?

No. Fruit flies (about an eighth of an inch, brownish, red eyes) cluster around fruit and vinegar. Fungus gnats live in damp houseplant soil. Drain flies live in sink drains. If you set a vinegar trap and catch nothing, you are probably dealing with one of the other two, and the treatment is different.

Do I need to call a professional?

Usually no. If the swarm returns week after week despite traps and cleaning, or if you trace it to a sink drain or appliance you cannot reach, a licensed pest professional is worth the call. Persistent indoor populations almost always trace back to a breeding site that is not the fruit bowl.

Join the Discussion

Which fruit fly trap works best in your kitchen? Share your favorite recipe, your worst infestation story, or the household tip that finally cleared the swarm in the comments below.

Golden rooster weathervane logo for Farmers' Almanac with orange and gray text on a white background.

This article was published by the Staff at FarmersAlmanac.com. Any questions? Contact us at questions@farmersalmananac.com.

guest
42 Comments
Newest
Oldest Most Voted
Bright

I had recently moved my potted basil plant into our kitchen because my birds had been eating it to the ground. It was doing really well with the move and have more branches and leaves than ever. Then I started noticing our kitchen wasn’t getting as many flies as it normally does this time of year, we were actually getting them in places we normally have none, turns out it was my basil plant, I’ll have to plant more around the house lol they work great.

Wild Bird

I remember reading and seeing all about the Meditaraian Fruit flies back in the 1980s they the Glassy wing sharp shooter

Jaylo

I used a table salt gun and got some enjoyment at the same time, I call it my “saltrifle” and took about a week and they were horrible up until then and even bought 2 of those kits with the lil apple & vinegar, well smelled like it anyways but between the two I have not one and they are hard to get rid of once you’ve got them. Happy hunting!!

Don Snyder

A can of hair spray and a Bic lighter. Yep. Works for me.

Angel

???

joel pontbriand

a 12 guage will help to keep them away!!!!

AzWoodWarrior

I have a banana before I do carpentry. Always have. For some reason, they LOVE polyurethane. I can’t keep them off. When I had a few in my kitchen, a 6″xthe width of roll and put 1 short blast right in the center. Placed it on the window sill *next to an open window. It worked. No more flies. Or any flying insect for that matter.

*polyurethane is toxic. I only personally have used a very small amount next to an open window. It would be foolish to do this in an enclosed space. Ventilation is paramount.

Nay

Got a D in chem 🙂 but ripening ‘nanas give off ethylene oxide; does poly U have an alcohol component to it? Might explain their attraction…

Laura J.

Lemon grass is also good to keep mosquitoes away.Just plant them in a small container and shit it on you front porch or anywhere they are mosquitoes around.

Susan Higgins

Hi Laura, we recently did an article on the effectiveness of that. Take a look: https://www.farmersalmanac.com/mosquito-repelling-plants-35186

Maddie

Sounds painful

Daniel Bosquez

Dam ! Them darn mesquitoes shit on you on your front porch.first they eat you up now they shit right back on you ad if you shit yourself, Bastard’s lol

Mellie

??? I was cracking up at this comment

Mr. A

Sounds like someone can’t think of very many words.

Calvin Conner

Are we talking about Fruit Fly Mosquitoes?

Ronee

What about tiny tiny ants? I’ve tried just about everything, and they think ant traps are a joke.

Sandy

I use Windex. I think it is the ammonia that drops them almost instantly. If you can resist immediately cleaning up the carnage you will probably find it all gone by the next morning thanks to their fellow ants and they rarely return after just one or maybe two applications.

Heather

Cinnamon open the window and sprinkle between the screen and the sill. Close so window.

steven b alexander

Just to be sure, put about 50 pound sack of cinamon, sugar, boric acid, and diatomatious earth on the path then wait. when they come, smash them with a big hammer…..Guaranteed to work on any kind of pest including relatives.

Rod

Ronee, the best tried and tested method is to sprinkle a thin trail of mixture 1:1 powder sugar and boric acid.

Helen

If it is outside find their route and put salt about 2 inc wide . they will not come back Be careful and watch for new routes and re pit . It will not kill them but they will leave the area

Marie

Diatomaceous earth. Google it. I swear by it.

Susan Higgins

No need to google it, we have a story on it here!

Logicgrrl

My sister in law had a problem with ants coming into her kitchen off the deck. Mom told her to take chalk and draw a thick line in front of the door and the ants wouldn’t cross it. They didn’t! No more ants in the house and it was safe to use around the toddler she had.

Susan Higgins

Success! Good news.

Jayme

Catnip! Place a line of it as a boundary and they won’t cross it, and if you have a cat they will clean it up for you!

Desirea

Use chalk. they hate it & will NOT cross it. Just draw a thick line,(I’ve personally found white chalk to work best) about 1/2 inch wide & however long you need it to be, & they’ll stay out until the line starts to wear away over time. Then simply re-draw your chalk barrier!

osborne

diatomaceous earth works awesome on ants!

jane

dr. bonner’s peppermint soap & water spray. I did ant traps & diatomaceous earth and they stopped working.. but this works.

Beverly

This article did not address gnats. Here in Alabama gnats are horrible. Especially around our fountain. Any suggestions to get rid of them. Or how to survive outside without being eaten allowed

Susan Higgins

Hi Beverly, Wow, we just are learning about these biting gnats common in your neck of the woods. We’ve found a few chemical-free remedies for you: http://101cleaningsolutions.com/2017/05/17/how-to-get-rid-of-gnats-and-prevent-their-bites/

garden dave

Well maybe if the article was titled “DIY gnat traps” you would have a point…

steven b alexander

If you move to another state, they probably won’t be able to keep up with your car.

Kathy allen

Excellent ideas to get rid of those pesky fruit flies. Like them and sure to try them .

Plan Your Day. Grow Your Life.

Enter your email address to receive our free Newsletter!

Name*
What are you intrested in?*
Privacy*