How to Get Rid of Fungus Gnats in Hydroponics: The Complete Guide
Fungus gnats are small, dark, mosquito-like flies that infest hydroponic systems due to the presence of moisture, algae, and decaying organic matter. You can eliminate them by breaking their reproductive cycle using yellow sticky traps to catch flying adults and applying BTI (Bacillus thuringiensis israelensis) to your nutrient solution to kill the larvae eating your plant roots.
TL;DR Summary: Fungus gnats are a common hydroponic pest that thrives in wet, humid environments. While adults are annoying, the larvae cause the real damage by eating root hairs. To fix this, place yellow sticky cards near the base of your plants and treat your water reservoir or growing medium with Mosquito Bits (BTI) or hydrogen peroxide immediately.
What attracts fungus gnats to hydroponic systems?
Fungus gnats are drawn to three main things: high humidity, decaying organic matter, and algae. Unlike soil gardening, where overwatering is the primary trigger, hydroponics provides a constant water source, which makes your system a potential paradise for these pests if not managed correctly.
The adult gnats are looking for a place to lay eggs. They prefer moist surfaces rich in fungi and organic debris. In a hydroponic setup, this usually means the top layer of your growing medium (like coco coir, rockwool, or clay pebbles) or areas where algae has formed due to light leaks. If you have any decaying roots caused by early-stage root rot, gnats will swarm that area to feed and breed.
How do I identify a fungus gnat infestation?
Identifying these pests early prevents significant root damage. You will usually see the adults first. They are tiny black flies, about 1/8 inch long, that look like fruit flies but have a more erratic flight pattern. You will typically see them walking on your growing medium or flying near the base of the plant stem rather than hovering around the fruit.
To find the larvae, inspect your growing medium or root zone. Larvae have clear or white bodies with distinct shiny black heads. In deep water culture (DWC) or Kratky systems, you might see them wriggling in the water if the infestation is severe. If your plants look wilted, have yellowing leaves, or show stunted growth despite proper nutrient levels, you likely have larvae chewing on the root system.
What is the life cycle of a fungus gnat?

Understanding the life cycle is critical because most treatments only kill the pest at one specific stage. The entire cycle takes about 3 to 4 weeks depending on the temperature.
- Egg: The adult female lays up to 200 eggs in moist crevices of your growing medium. These hatch in 3 to 6 days.
- Larva: This is the dangerous stage. For roughly two weeks, the larvae feed on fungi, algae, and your plant’s root hairs.
- Pupa: The larvae enter a pupal stage in the medium, emerging as adults 3 to 4 days later.
- Adult: The adult fly lives for about a week. It does not eat your plants, but it spreads fungal spores and lays the next generation of eggs.
Because of this cycle, you must keep treating the system for at least 28 days to ensure you catch every new batch of larvae hatching from eggs.
How to prevent fungus gnats in hydroponics?
Prevention is far easier than elimination. By making your environment inhospitable to them, you can avoid using biological or chemical treatments later.
Control algae growth
Algae is a primary food source for gnat larvae. Ensure your reservoir is light-proof. Cover clay pebbles or rockwool cubes with light-blocking covers or Panda Film. If light cannot hit the water or wet medium, algae cannot grow, and gnats will have less food.
Hydroponic maintenance → DIY Maintenance Guide
Manage humidity and airflow
Gnats are weak fliers. Strong air circulation makes it difficult for them to land and lay eggs. Position oscillating fans to blow air across the top of your canopy and directly across the surface of your growing medium. This also helps keep the top layer of the medium dry, which discourages egg-laying.
Creating physical barriers
If you use media like coco coir or soil, add a layer of Gnat Nix, coarse sand, or perlite to the top inch of the container. This dry, rough layer shreds the bodies of the soft larvae and prevents adults from reaching the moist medium underneath to lay eggs.
How to get rid of fungus gnats?
If you already have an infestation, you need a multi-pronged attack. You must kill the adults to stop reproduction and kill the larvae to stop root damage.
Using yellow sticky traps
This is the first line of defense. Place yellow sticky cards horizontally across the top of your net cups or pots. Adults are attracted to the yellow color. When they land, they get stuck and die before they can lay more eggs. This also helps you monitor the severity of the infestation; if the card is black with flies in two days, you have a heavy infestation.
Utilizing BTI (Bacillus thuringiensis israelensis)
BTI is the most effective biological control for hydroponics. It is a bacteria that is toxic only to mosquito and gnat larvae but safe for humans, pets, and plants.
- Products: Mosquito Bits or Gnatrol WDG.
- Application: For solid media, sprinkle bits on top and water them in. For reservoirs, steep the bits in warm water to create a “tea” and add that liquid to your tank.
- Timing: Apply every 5 to 7 days for at least 4 weeks.
Applying beneficial nematodes
Beneficial nematodes (specifically Steinernema feltiae) are microscopic worms that hunt gnat larvae. You mix them into water and drench your growing medium. They enter the gnat larvae and release bacteria that kill the pest from the inside. This is highly effective in coco coir or peat-based hydroponics but can be trickier to manage in recirculating deep water systems.
Growing media → Best growing media for hydroponic beginners
Using Hydrogen Peroxide (H2O2)
For a quick kill, you can use 3% food-grade hydrogen peroxide. Mix one part peroxide with four parts water and flush your growing medium. On contact, the peroxide fizzes and kills larvae instantly.
Warning: Hydrogen peroxide kills all bacteria, good and bad. If you use beneficial bacteria supplements like Hydroguard, peroxide will sterilize your system and destroy those expensive inoculants. Use this method only as a “nuclear option” for severe infestations before re-introducing beneficials.
How to treat specific hydroponic systems?
Different systems require slightly different approaches to gnat control.
Deep Water Culture (DWC)
In DWC, gnats usually infest the hydroton (clay pebbles) in the net cup.
- Allow the water level to drop slightly so the clay pebbles aren’t constantly soaking wet at the surface.
- Cover the net cup with a neoprene collar or foil to block access.
- Add BTI “tea” directly to the reservoir water.
DWC Hydroponics → What is DWC hydroponics?
Ebb and Flow (Flood and Drain)
These systems are prone to gnats because the medium stays moist.
- Adjust your flood cycle to allow the medium to dry out more thoroughly between floods.
- Place sticky traps directly on the flood tray.
- Use a sand barrier on top of your pots if possible.
Ebb & Flow → Complete Guide to Ebb & Flow
Kratky Method
Since Kratky water is stagnant, it can become a breeding ground if the top seal isn’t tight.
- Ensure your net cup fits tight against the lid with no gaps.
- Wrap tape around the gap where the plant stem meets the medium.
- Use BTI in the jar or bucket immediately upon seeing a gnat.
Do fungus gnats cause root rot?
Yes, fungus gnats are a direct vector for root rot. The larvae physically damage the root system by chewing on root hairs, creating open wounds. These wounds are entry points for pathogens like Pythium (the fungus that causes root rot).
Furthermore, adult gnats can carry fungal spores on their legs. If they land on an infected plant and then fly to a healthy one, they spread the disease. Eliminating gnats is often a necessary step in curing root rot.
Root rot → How to identify and fix root rot in hydroponics
How to Treat a Hydroponic Gnat Infestation with BTI
This process uses BTI (Bacillus thuringiensis israelensis) to eliminate larvae while using traps for adults. This is safe for edible crops.
Materials Needed:
- Yellow sticky traps
- Mosquito Bits (containing BTI) or Gnatrol
- Mesh bag or cheesecloth (for reservoirs)
- A clean bucket
- Warm water (chlorine-free)
Steps:
- Isolate the plants
Move infested plants away from any healthy seedlings or clones to prevent the adults from spreading. - Install sticky traps
Place yellow sticky traps horizontally at the base of the plant, covering as much of the growing medium surface as possible without touching the stem. - Prepare the BTI concentration
If using Mosquito Bits in a reservoir system, place 4 tablespoons of bits into a mesh bag. Soak this bag in a separate gallon of warm water for 30 minutes to extract the bacteria. - Apply to the reservoir
Pour the BTI-infused water into your main hydroponic reservoir. The bacteria will circulate and kill larvae in the root zone. Leave the bits out of the main tank to prevent pump clogging. - Top dress media (Optional)
If using coco coir or peat, sprinkle dry Mosquito Bits directly on the top of the medium and water them in slightly. - Dry out the top layer
Direct a small fan toward the top of the grow media to dry the surface quickly. This stops new eggs from surviving. - Repeat weekly
Repeat this treatment every 5 to 7 days for 4 consecutive weeks. This ensures you catch larvae that hatch from eggs laid later.
FAQ: Fungus Gnats in Hydroponics
Are fungus gnats harmful to humans or pets?
No, fungus gnats do not bite humans or pets and do not carry human diseases. They are strictly a nuisance pest to people, though they can be annoying when they fly around your face or food.
Can I use vinegar to kill fungus gnats?
Vinegar traps (apple cider vinegar and soap) work well for fruit flies but are generally ineffective for fungus gnats. Fungus gnats are attracted to rotting organic matter and fungi, not the sweet scent of vinegar. Yellow sticky cards are much more effective.
Will bleach kill fungus gnats in my reservoir?
Bleach will kill larvae, but it is toxic to plant roots in high concentrations and difficult to dose correctly. It acts similarly to hydrogen peroxide but with higher risk. It is safer to use BTI or food-grade hydrogen peroxide which breaks down into oxygen and water.
How long does it take to get rid of fungus gnats completely?
It typically takes 21 to 28 days to completely eradicate a population. This is because you must wait for all the eggs currently in the media to hatch into larvae so the treatment can kill them. One treatment is rarely enough.
Can I just let my plant dry out to kill them?
In soil, yes, but in hydroponics, drying out the roots completely will kill your plants. However, letting the very top layer of your growing medium (like the top inch of clay pebbles or coco) dry out is a great strategy to stop egg-laying.
What is the difference between fruit flies and fungus gnats?
Fruit flies have red eyes and rounded bodies, and they hover around fruit or kitchen waste. Fungus gnats have black bodies, long legs, look like tiny mosquitoes, and hang around soil, drains, or hydroponic root zones.
Do predatory mites work for gnats?
Yes, Hypoaspis miles (now called Stratiolaelaps scimitus) are predatory mites that live in the soil/media and eat gnat larvae. They are excellent for prevention or light infestations but may not be fast enough to stop a massive swarm on their own.
About the Author
I am a hydroponics enthusiast and cybersecurity engineer based in Phoenix, Arizona. Living in the desert, I have spent years perfecting indoor growing techniques that combat our extreme outdoor heat and unique indoor climate challenges. My goal is to help home growers build resilient, high-tech, and automated food systems right in their own house.
Discover more from Soil Free Harvest
Subscribe to get the latest posts sent to your email.

