How to get gnats out of a terrarium

I have a 30 gallon tall bioactive enclosure housing a pair of crested geckos. There are gnats everywhere inside, it got to the point where even in a day there were 5-10 gnats just stuck in the food dish. I just started colonies of isopods and when they start producing I can put a large number of them in the terrarium at once and hope they eat all of the eggs, is there anything I can do before then as it will most likely take my colonies months until they start mass producing. I’ve read things online about corn cob growing bacteria, sundews and other bug eating plants, and a sugar/soap mix. I’m wondering if any of these would be safe for crested geckos and a live pothos plant that I have in there. The cresties usually explore and spend a little time each night on the ground checking out every corner of their enclosure. The best thing I can think of is making a dish of the sugar/soap mix and putting an outside screen on it so the cresties wouldn’t be able to get into it but the small gnats would.

Unless you have a hundred sundews, they are not going to make an impact on you gnat/fly problem.

Let your media dry down a bit (pothos can handle it) and make sure you are removing any uneaten food quickly. And once the isopods and springtails establish you should see a decline in them


Are they gnats or fruit flies. For the latter, I’d get a little ramekin filled w white vinegar and just a drop of dish soap. Put it outside the cage. They’ll find it!

1 Like

They’re fungus gnats, I’ll try setting a mixture for gnats outside the cage.
I’ll also try letting the media dry out and stop misting the actual substrate, if the pothos plant starts getting dehydrated I’ll water it from the bottom since I’ve read that fungus gnats don’t lay eggs very deep.
Thank you both for the ideas, I’ll update later this week how it’s working.

1 Like

Well the gnats themselves are there because like Travis said it’s the moisture in the tank and they lay eggs in it. There are predatory mites you can buy on amazon that eat the larvae and eggs of alot of different pest so you could try to give that a go as well.

1 Like

I might try that if this doesn’t work, until then I decided to try an experiment.

4 cups with 3 5/32” holes in the lids. The cage door is barely open and taped so nothing other than the gnats can escape. All of the cups have vinegar and dish soap. 1 cup has apple cider vinegar, 1 cup has apple cider vinegar and sugar, 1 cup has white vinegar, and 1 cup has white vinegar and sugar. They are evenly placed on either side of the cracked door. I’ll update to show which one catches more gnats.


Yes their most likely fungus gnats. Unless it’s the issue of leftover food sitting in the terrarium too long, they probably hitch a ride in with the any plant soil. It’s a good idea to take any plants that you plan on putting in terrariums and rinse the roots with warm water, you can even go as far as doing a 10-15% bleach water dip to help kill any other hitch hikers and rinse again, then repot in the substrate that’s going in to the bio active terrarium. I also will quarantine my plants in a sterlite tub with a gasketed lid for a couple weeks to be sure I don’t have other hitch hikers after the repotting to be sure I don’t introduce them to a bio active set up, if you have multiple set ups they may spread to the others. Almost all store bought (HomeDepot, Lowes, local garden center) plants will have fungus gnats nesting in the substrate.


It seems that letting the medium dry out killed most if not all of the gnats. So the traps didn’t catch any of them, part of it might have been my unwillingness to put them in the cage because of the springtails, isopods and the live plant. Either way my conclusion is that letting the medium dry out is the best way to fix a gnat population.