How to Beat Fungus Gnats: A Complete Guide for Indoor Gardeners
Those tiny flies around your plants are fungus gnats. Here is how to identify, eliminate, and prevent them from destroying your indoor garden. Battle-tested methods from a survivor.

The Day They Took Over
I remember the exact moment I knew I had a problem. I was eating breakfast, and I looked up at my window garden to see what I can only describe as a cloud of tiny flies hovering around my basil plants.
Within a week, they were everywhere. Every plant. Every pot. The bathroom. The kitchen. Tiny flies landing on my laptop screen, my coffee, my food.
This is my story of defeating fungus gnats - and how you can avoid the six-month nightmare I went through.
What Are Fungus Gnats?
Fungus gnats are small flies (about 1/8 inch) that look like tiny mosquitoes. They are attracted to moist soil and organic matter. While the adults are mostly annoying, the larvae live in soil and eat plant roots.
How to Identify Them
Adult gnats:
- Tiny, dark flies
- Long legs, Y-shaped wing veins
- Attracted to light (you will see them on windows)
- Weak fliers (they kind of hover and drift)
Larvae:
- Small white worms with black heads
- Live in top 1-2 inches of soil
- Eat roots and organic matter
- The actual damage-causers
Why You Have Them
The most common sources:
- Contaminated potting soil (eggs already in the bag)
- Overwatering (moist soil is their breeding ground)
- New plants (hitchhikers from the nursery)
- Organic matter (decomposing material in soil)
The Battle Plan: 4 Stages
Beating fungus gnats requires attacking both adults and larvae simultaneously. One without the other is useless - you will just keep cycling.
Stage 1: Stop the Bleeding
Immediately:
- Let all soil dry out completely (yes, even if plants look thirsty)
- Remove any dead leaves or organic debris from soil surface
- Check if any plants are too far gone (sacrifice the few to save the many)
Why drying works:
Larvae cannot survive in dry soil. Eggs cannot hatch. Adults have nowhere to lay new eggs. Every day of dry soil breaks their reproduction cycle.
Stage 2: Kill the Adults
Adults live 7-10 days and each female can lay 200+ eggs. You need to catch them before they reproduce.
Yellow Sticky Traps
The most effective adult control. Gnats are attracted to yellow and get stuck.
- Place traps near affected plants, especially near windows
- Horizontal traps near soil catch more than vertical traps
- Replace when covered (usually every 3-7 days during infestation)
Cost: $5-10 for 20+ traps
Apple Cider Vinegar Traps
DIY option that works surprisingly well.
- Small container with apple cider vinegar
- Drop of dish soap (breaks surface tension)
- Cover with plastic wrap, poke small holes
- Gnats go in, cannot get out
Replace every few days. Effective but catches fewer than sticky traps.
Stage 3: Kill the Larvae
This is where you actually solve the problem.
Hydrogen Peroxide Soil Drench
Mix 1 part 3% hydrogen peroxide with 4 parts water. Water your plants with this solution.
- Kills larvae on contact
- Safe for plant roots
- Also adds oxygen to soil
- Repeat every watering for 2-3 weeks
How it works: The hydrogen peroxide fizzes on contact with organic matter and kills larvae through oxidation. It breaks down into water and oxygen, leaving no residue.
BTI (Bacillus thuringiensis israelensis)
This is a bacteria that kills fungus gnat larvae specifically. Sold as "Mosquito Bits" or "Gnatrol."
- Sprinkle on soil surface or make a tea
- Larvae eat it and die within 24 hours
- Completely safe for plants, pets, humans
- Most effective long-term solution
How to use BTI:
- Add bits to water and let sit 30 minutes
- Use this water for normal watering
- Sprinkle dry bits on soil surface as well
- Continue for 3-4 weeks
Stage 4: Prevention
Once you have control, prevent reinfestation.
Top-Dress With Sand or Pebbles
A 1/2 inch layer of sand or decorative pebbles on top of soil:
- Prevents adults from laying eggs in soil
- Dries out faster than organic matter
- Looks better than bare soil anyway
Bottom Watering
Instead of watering from above:
- Place pots in tray of water
- Let soil wick up water from bottom
- Remove after 30 minutes
- Top layer stays dry (hostile to gnats)
Use Sterile, Fast-Draining Soil
Cheap potting soil often contains gnat eggs. Invest in:
- Sterile seed-starting mix for vulnerable seedlings
- Perlite-heavy mixes for all plants
- Or make your own sterile mix (covered in Sky-High Mix recipe)
The Nuclear Option: Soil Replacement
Sometimes the infestation is too severe. If you have been fighting for months with no improvement:
- Unpot all plants
- Wash all roots thoroughly, removing all old soil
- Dispose of old soil (outside, sealed bag)
- Sterilize pots (bleach solution, rinse well)
- Repot in completely new, sterile soil
- Top-dress with sand immediately
Drastic, but it works when nothing else does.
My Recovery Timeline
Here is how long it took me to get control:
Week 1:
- Noticed problem
- Let everything dry out
- Deployed sticky traps
Week 2:
- Started hydrogen peroxide drenches
- Ordered BTI
- Seeing fewer adults on traps
Week 3-4:
- BTI treatment ongoing
- Added sand top-dressing
- Adult population dropping
Week 5-6:
- Minimal adults
- No visible larvae
- Continued BTI as prevention
Week 8:
- Declared victory
- Switched to bottom watering
- Maintained sand barriers
Products That Actually Work
After trying everything, here is what I actually recommend:
Yellow Sticky Traps: Any brand works. Get the ones you can cut to size.
BTI Products: Mosquito Bits (granular) or Gnatrol (liquid concentrate). Available at garden centers or online.
Hydrogen Peroxide: Standard 3% from the pharmacy. Nothing special needed.
Sand: Play sand or horticultural sand. Make sure it is clean and dry.
Products That Do Not Work
Cinnamon: Often recommended online. Might mildly deter adults. Does not kill larvae.
Neem Oil: Good for some pests, but fungus gnat larvae in soil are not affected.
Dish Soap Sprays: Kills adults on contact, but you cannot spray enough of them to matter.
Coffee Grounds: Actually makes things worse (organic matter = gnat food).
When to Get Professional Help
If you are in a multi-unit building, gnats might be coming from a neighbor. If you have tried everything for 8+ weeks with no improvement:
- Check with building management
- Consider that the source is external
- Professional pest control may be needed for building-wide issues
The Lesson
Fungus gnats taught me that prevention is everything. Now:
- All new plants get quarantined and inspected
- All soil is sterile or heat-treated before use
- All pots have sand top-dressing
- Bottom watering is default
- Sticky traps stay deployed even when pest-free
The six-month infestation was miserable. The knowledge I gained from it was worth it. Your apartment garden can be pest-free - but you have to be proactive.
For complete pest prevention systems and the Sky-High Mix recipe that eliminates soil-borne pests, see the Troubleshooting chapter in Sky-High Harvest.