Fungus Gnats in a Terrarium: Why the Usual Fix Fails

If small dark flies escape every time you lift the lid, you have fungus gnats, and the standard cure does not exist inside a sealed terrarium. Every extension service gives the same primary control, which is to let the top of the growing medium dry between waterings. A closed jar has no evaporation route, so that lever is not available to you. What is available is starving the larvae of decaying material, cutting the free water in the build, trapping the adults, containing the population behind the lid, and refusing to let the next infestation in on a new plant. There is no spray recipe on this page, and one section below explains why.

First, make sure it is a pest and not your crew

Springtails and isopods are supposed to be in there. Fungus gnats are not, and the two get confused constantly because both are small, both live in the substrate, and both increase when there is more decaying matter to eat.

The distinction that matters is flight. Adult fungus gnats fly, and they head for you and for the light when the lid comes off. University of Minnesota Extension states that springtails do not have wings and cannot fly, and that they jump using a forked structure tucked under the abdomen (read 2026-08-24). So if the things escaping the jar are airborne and making for a window, they are not your cleanup crew.

For size, University of Wisconsin-Madison Division of Extension describes adult fungus gnats as delicate dark brown or black flies about 1/8 inch long, with larvae that resemble pale worms with a black head and reach about 1/4 inch when mature (read 2026-08-24). The larvae are the part that matters, and they sit in the top layer of substrate rather than deep in the build.

Why a sealed jar is close to ideal habitat

Wisconsin Extension states that fungus gnat larvae typically feed on decaying organic matter and fungi in the soil, and that where populations are high they may damage roots, though that damage is rare in home settings (read 2026-08-24). UC Integrated Pest Management lists the larval diet as organic mulch, leaf mold, grass clippings, compost, root hairs and fungi (read 2026-08-24).

Now read your own build back. A terrarium substrate is deliberately organic, deliberately damp, held at stable warmth and stocked with bark, coir, moss and leaf litter. The terrarium substrate guide covers which of those components are the richest food.

The population also turns over fast, which is why a few flies become a cloud. UC IPM puts a generation, female to female, at about 17 days depending on temperature (read 2026-08-24). Wisconsin Extension gives egg to adult as three to four weeks and notes that improved cultural practices typically take three to four weeks to show results (read 2026-08-24).

The advice you will find everywhere, and why it does not transfer

UC IPM is explicit that physical and cultural management, primarily reducing excess moisture and organic debris, is key to reducing fungus gnat problems, and recommends allowing the surface of container soil to dry between waterings (read 2026-08-24). Colorado State University Extension puts it the same way: because the larvae feed primarily on decaying plant material, changing soil moisture is the most important step, and watering should be limited so the soil surface can dry between waterings (read 2026-08-24).

Both are right, and neither describes anything you can do. In a sealed container, water leaving the substrate condenses on the glass and runs back down. You do not have waterings to space out. You have one body of water that circulates.

Two other standard tactics also fail here. Bottom watering has no meaning in a jar with no drainage holes. And the coarse sand or fine gravel topping Wisconsin Extension lists as a barrier is workable in principle but awkward to place through a narrow neck without burying the moss and low-growing plants you built the thing for.

What is actually available inside the glass

Cut the food supply. This is the closest thing to a drying-out lever a terrarium has. Take out fallen leaves, dead fronds, spent moss and collapsed plant material promptly rather than at the next monthly check. Less decaying matter is less larval food.

Reduce free water. If the glass is streaming rather than lightly fogged, or water stands above the drainage layer, every stage of the gnat life cycle benefits. Venting is slow and partial and it is still your only moisture lever, so read the fog properly first with the mold and condensation guide rather than venting on a guess.

Trap the adults. Yellow sticky cards catch adult fungus gnats and reduce the number of females laying eggs, and both Wisconsin Extension and UC IPM list them as a monitoring and reduction tool (read 2026-08-24). They do not touch the larvae, so use them to measure whether you are winning.

Use the lid as containment. This is the one advantage a terrarium has over an open pot: an intact seal keeps adults inside, so the infestation does not spread to the rest of your plants while you work.

Keeping the next one out, and knowing when to rebuild

Fungus gnats arrive in growing media and on nursery plants far more often than they fly in through a window. Sterilizing substrate and hardscape before assembly reduces what you introduce, and the sterilizing guide is clear about what that does and does not achieve. Colorado State Extension recommends that new plants be placed in quarantine in a separate area of the household for at least three weeks (read 2026-08-24), which is worth more before a plant goes into a container you cannot easily open again.

The other honest option is starting over. If the build is young, the plants are inexpensive and the substrate is already heavily colonized, a teardown with clean material can cost less time than a month of partial measures. The build guide covers doing it with a cleanup crew in place from day one.

My Experience With Fungus Gnats

As you can see, in my build, the first thing that caught my attention was the adult gnat sitting on the glass, but the more useful clue was the condition of the substrate underneath. It was damp, full of organic material, and had enough sheltered surface area for the larvae to keep developing.

That matches what I found when I looked into other keepers’ experiences: fungus gnats can continue appearing in a closed terrarium even when springtails are already present, because the larvae are living in the moist upper substrate where they feed on fungi and decaying material.

Fungus Gnat On My Terrarium Build

What changed my approach was realizing that catching the adults was only dealing with what I could see. Fungus gnats spend most of their life below the surface, and under warm conditions a new generation can develop in only a few weeks. I now pay much closer attention to excess moisture, dead leaves, algae and decomposing material in the planting layer instead of treating every gnat on the glass as a separate problem.

I also stopped assuming that adding more cleanup-crew insects would automatically solve it. Springtails are useful in the terrarium, but they are not a guaranteed fungus-gnat treatment. My focus is keeping the build balanced, removing unnecessary decaying material, controlling excess moisture without drying the terrarium out completely, and using adult traps mainly to see whether the population is actually declining.

Why there is no spray recipe on this page

This is the section that gets terrarium content into trouble, so I will be direct. I am not going to publish a dilution, a concentration, a mixing instruction or an application rate for anything, and I would be wary of any terrarium page that does.

The first reason is legal and it is not a technicality. Colorado State Extension states it plainly: “Always read and follow instructions on the label! It is always the pesticide applicator’s responsibility, by law, to read and follow all current label directions” (read 2026-08-24). The label is specific to the product in your hand and to your country, and a number written in a blog post has no standing against it.

The second is the enclosure. A sealed glass container is not an application environment any label was written for. There is no ventilation, no runoff and no dilution over time, so whatever goes in stays in, at the strength it arrived, against plants, moss and a cleanup crew you deliberately introduced.

The third is the household. A terrarium usually sits on a shelf in a living room, not in a greenhouse, so a product’s storage and ventilation instructions apply to a room your family and pets are in.

UC IPM’s own position is that insecticides are rarely warranted to control these flies in and around homes (read 2026-08-24). If you decide to use something anyway, your local extension service is the right authority for what is registered where you live, and the product label is the only instruction that counts. That is where this page stops.

Mites and aphids, which are a different problem in here

Neither is a substrate pest, so almost nothing above applies to them.

Spider mites are the interesting case, because their preferred conditions are the opposite of a terrarium’s. Colorado State Extension lists washing and increasing humidity around the plant among the most effective controls (read 2026-08-24), and a sealed terrarium holds humidity high by design. A mite population arriving on a new plant is therefore less likely to establish inside sealed glass than on the same plant in open air.

Aphids arrive the same way, on the plant, and Colorado State Extension notes they develop as pests on several types of houseplants (read 2026-08-24). Inside a jar the practical response is physical: take the affected plant out and deal with it outside the container, or remove the affected growth, rather than treating a whole sealed ecosystem to reach one plant. Both cases point back to the three-week quarantine, because once a plant is wedged into a planted terrarium every option is worse than the one you had at the nursery.

If your problem is a pest running through a collection of open houseplants rather than something inside sealed glass, that is a different subject with different answers, and your regional university extension service publishes the reliable version of it.

FAQ

Will springtails get rid of fungus gnats in a closed terrarium?
University of Minnesota Extension lists springtails as feeding on decaying plant material, fungi, molds and algae (read 2026-08-24), which is the same food fungus gnat larvae need, so a dense population is genuine competition. Whether that is enough to clear an established infestation inside sealed glass is a separate question, and I have not found a university source measuring it. Treat a healthy crew as one pressure among several, not as the whole plan.

Do fungus gnats actually harm terrarium plants, or are they just annoying?
Mostly the latter. University of Wisconsin-Madison Extension notes larvae may damage roots where populations are high, but that this damage is rare in home settings, and UC IPM does list root hairs among what larvae feed on. The realistic case for acting is that a cloud of flies escaping the lid is unpleasant and the population will not self-limit while food and moisture hold.

How long will it take to clear them?
Longer than you want. Wisconsin Extension notes improved cultural practices generally take three to four weeks to show results, and UC IPM puts a full generation at roughly 17 days depending on temperature. Since the strongest standard control is unavailable in sealed glass, expect the slower end and use sticky cards to tell whether adult numbers are actually falling.

Can I just leave the lid off until they go away?
That trades one problem for two. It releases the adults into the room and onto your other plants, and it changes the humidity the terrarium’s plants are adapted to, which is a real cost for moisture-dependent species like fittonia and many mosses. Deliberate, temporary venting to reduce excess water is reasonable. Leaving a build open indefinitely is a different decision.

They appeared right after I added a new plant. Coincidence?
Almost certainly not. Fungus gnats arrive in growing media and on nursery stock far more often than they fly in. Colorado State Extension recommends quarantining new plants in a separate area of the household for at least three weeks, and that advice is worth more for a terrarium than an open pot, because getting a plant back out of a planted jar is the hard part.