Tiny Black Flies in My Vivarium – How to Get Rid of Fungus Gnats Safely
By The Frogfather
You’ve spent months establishing a planted bioactive vivarium. The plants are growing, the springtails are thriving, and everything seems to be working as it should.
Then one evening you notice a tiny black fly walking across the glass.
A few days later, there are several more. Some are hovering around the plants, others are sitting on the substrate, and a handful seem determined to escape every time you open the doors.
What are they, where have they come from, and should you be worried about your frogs?
In many cases, these tiny black flies are fungus gnats, small flying insects whose larvae develop in moist organic material.
They’re a familiar nuisance to houseplant growers, but controlling them inside a bioactive vivarium requires a different approach. After all, the damp substrate, decomposing leaves and microorganisms that attract fungus gnats are also important parts of the environment we’re deliberately creating.
At Frogfather HQ, my priority is always to preserve the established ecosystem rather than destroy it to solve a relatively minor pest problem.
In this guide, I’ll explain how to recognise fungus gnats, why they appear, whether they are dangerous to dart frogs, and how to manage them without unnecessarily harming the plants, springtails, isopods or other inhabitants.
Quick Answer: How Do You Get Rid of Fungus Gnats in a Vivarium?
The safest starting point is to reduce opportunities for fungus gnats to breed and prevent new adults from entering, rather than applying insecticides to an occupied enclosure.
My recommended approach is to:
- Confirm that the insects are probably fungus gnats rather than another type of small fly.
- Inspect the substrate, drainage and decaying organic material.
- Remove concentrated pockets of rotting food or severely decomposing material where appropriate.
- Check whether misting, drainage or ventilation needs adjusting.
- Use insect screens and good plant quarantine practices to reduce introductions.
- Trap adults outside the enclosure, away from frogs and other animals.
- Monitor the population over several weeks while maintaining suitable conditions for the vivarium’s inhabitants.
Don’t dry out a tropical vivarium, remove all its leaf litter or spray it with household insecticide simply to eliminate a few flies.
What Are Fungus Gnats?
Fungus gnats are small, delicate flies. Many of the species encountered around houseplants and terrariums belong to the family Sciaridae.
Adults are generally dark-coloured, with slender bodies, relatively long legs and narrow wings.
They are often seen walking across the substrate or making short, weak flights around damp planting areas.
Although the adults attract most of our attention, the larvae are the important stage when considering where an infestation is developing.
Fungus gnat larvae typically live in moist organic substrates, feeding on fungi, decomposing material and, in some circumstances, living plant tissue.
They are often pale or translucent, with a darker head capsule.
The University of California’s Integrated Pest Management programme provides useful background on fungus gnat biology and management:
How to Identify Fungus Gnats in Your Vivarium
Before attempting to control an insect, it’s worth establishing what you’re dealing with.
Not every tiny black fly is a fungus gnat.
Signs That Suggest Fungus Gnats
- Small, dark, mosquito-like flies.
- Adults walking across damp substrate or plant pots.
- Weak, short flights around plants and the enclosure glass.
- Increased numbers around persistently moist organic material.
- Occasional pale larvae with dark heads visible in the substrate.
Identification can be difficult without magnification, particularly when dealing with very small insects.
Could They Be Fruit Flies Instead?
Possibly.
Fruit flies are particularly relevant to dart frog keepers because we deliberately introduce them as food.
Even flightless feeder fruit flies can escape culture containers or vivariums, and some strains retain limited flight or gliding ability.
Typical Drosophila fruit flies tend to have a more compact body shape than fungus gnats.
If you’ve recently fed your frogs, check whether the insects are escaped feeder flies before assuming there’s a fungus gnat infestation.
What About Drain Flies or Phorid Flies?
Other small flies can also occur around damp environments.
Drain flies often have broad, hairy wings, while phorid flies can have a distinctive hump-backed appearance and may run rapidly across surfaces.
Finding the likely breeding source is often as useful as looking at the adult insects.
Why Do Fungus Gnats Appear in Bioactive Vivariums?
The answer is fairly straightforward: a healthy tropical bioactive vivarium can provide many of the conditions fungus gnats need to reproduce.
We deliberately create environments containing:
- Moist substrate.
- Decaying leaves.
- Fungal growth.
- Organic nutrients.
- Living plants and root systems.
- Stable, relatively warm conditions.
Those conditions support beneficial decomposers and microorganisms, but they can also support fungus gnat larvae.
This doesn’t automatically mean the vivarium is dirty or poorly maintained.
It means that a suitable breeding environment is available if adult fungus gnats find their way inside.
1. Fungus Gnats May Arrive With New Plants
One common route of introduction is through newly purchased plants.
Potting compost can contain fungus gnat eggs or larvae that are difficult to see during a quick inspection.
Once the plant is introduced into a warm, moist vivarium, those insects may continue developing.
Why I Recommend Plant Quarantine
Quarantining plants gives you an opportunity to identify pests before introducing them to an established enclosure.
Inspect the foliage, roots and growing medium, and watch for emerging insects.
Where appropriate for the plant, removing the original nursery compost can also reduce the risk of transferring unwanted organisms.
However, avoid using chemical pest treatments on plants that are about to enter an amphibian enclosure unless their safety for that specific use has been established.
Amphibians can be particularly vulnerable to chemical exposure, so a treatment marketed as safe for houseplants should not automatically be considered safe for frogs.
2. Excessively Wet Substrate Can Encourage Fungus Gnats
Moisture is an important part of fungus gnat development.
In ordinary houseplant care, allowing the upper compost to dry between watering sessions is a commonly recommended management technique.
However, that advice cannot simply be copied into a tropical dart frog vivarium.
Many dart frogs and tropical plants require consistently suitable moisture conditions, and drying an entire enclosure could compromise animal welfare.
What I Would Check Instead
Look for areas where water is accumulating unnecessarily.
- Is the drainage layer functioning?
- Is the substrate permanently saturated?
- Is water pooling around plant roots?
- Has the misting schedule recently increased?
- Are there isolated areas with excessive moisture and little airflow?
The objective is to correct inappropriate waterlogging, not to make the vivarium dry.
At Frogfather HQ, I prefer to evaluate moisture across the whole enclosure rather than rely entirely on one humidity reading.
3. Decaying Organic Material Provides Food for Larvae
Fungus gnat larvae often feed on fungi and decomposing organic matter.
This is why they can become established in substrates containing old plant material.
But there is an important distinction between normal decomposition and a localised problem.
Leaf litter gradually breaking down is an expected part of a bioactive system.
A large accumulation of rotting food, saturated plant debris or heavily deteriorating material in one location may deserve attention.
Should You Remove All the Leaf Litter?
No.
Leaf litter provides shelter for frogs, supports microfauna and contributes to the substrate ecosystem.
Removing it all may create more problems than the fungus gnats themselves.
Instead, remove any clearly unsuitable accumulations and allow normal decomposition to continue.
4. Poor Drainage May Be Contributing to the Problem
Drainage is one of the foundations of a well-designed tropical vivarium.
When water cannot move away from the substrate, persistently saturated conditions may develop.
This can affect plant roots, microbial activity and the overall condition of the enclosure.
Fungus gnats may take advantage of some of these conditions.
What to Look For
- Water sitting unusually high in the drainage layer.
- Substrate becoming muddy or compacted.
- Standing water around the bases of plants.
- Persistent unpleasant odours.
- Large amounts of deteriorating organic matter.
If your vivarium has a drainage outlet, check that it is functioning correctly.
If the enclosure has no drainage system, take particular care when adjusting misting and watering.
Never assume that more water automatically means better conditions for tropical amphibians.
5. Fungus Gnats Can Enter Through Ventilation Openings
Not every fungus gnat infestation starts with a contaminated plant.
Adult insects may enter from the surrounding room, particularly if there are houseplants or other moist growing media nearby.
Ventilation openings can provide access when the mesh is sufficiently coarse.
Check for gaps around:
- Ventilation panels.
- Cable openings.
- Misting pipe entries.
- Sliding doors.
- Removable lids.
Fine insect mesh may help reduce access, provided it does not restrict the ventilation required by the enclosure.
The aim is to prevent unnecessary insect entry without creating stagnant conditions.
Are Fungus Gnats Dangerous to Dart Frogs?
In most ordinary situations, adult fungus gnats are more of a nuisance than a direct threat to healthy dart frogs.
They are not generally known for biting frogs or feeding on amphibian skin.
However, this doesn’t mean every infestation should be ignored.
A substantial population may indicate excessive moisture, accumulated organic material or an introduction route that also allows other pests into the enclosure.
Some fungus gnat larvae can damage susceptible plant roots, particularly under favourable conditions.
And an unusually heavy infestation may warrant investigation even when the frogs appear unaffected.
My approach: Assess the insects, the condition of the enclosure and the welfare of the animals separately. Don’t assume the presence of fungus gnats automatically means the frogs are in danger.
Will Dart Frogs Eat Fungus Gnats?
Dart frogs may opportunistically consume small insects that move within their enclosure, including some adult fungus gnats.
However, this should not be treated as a reliable control method.
The number of adults consumed may be insufficient to interrupt reproduction in the substrate.
Fungus gnats also shouldn’t be relied upon as a planned nutritional food source.
Continue providing an appropriate, varied feeding programme using suitable cultured feeder insects and supplements.
Can Springtails Help Control Fungus Gnats?
Springtails are beneficial organisms in many bioactive vivariums.
They feed on fungi, decomposing organic material and associated microorganisms, helping support the breakdown of waste.
Because springtails and fungus gnat larvae may use some of the same resources, a well-established springtail population can contribute to a balanced substrate ecosystem.
However, springtails are not a proven standalone treatment for fungus gnat infestations.
They do not reliably eliminate fungus gnat eggs, larvae or adults.
I would maintain springtails because of their wider role in the vivarium, not introduce them with the expectation that they’ll eradicate every pest.
For readers interested in culturing and collecting springtails, see our 3D-Printed Springtail Collection Riser.
What About Tropical White Isopods?
Tropical white isopods are another useful component of many established bioactive systems.
They contribute to the breakdown of organic material and help process decomposing matter.
As with springtails, they are not a targeted fungus gnat treatment.
A healthy clean-up crew supports the overall system, but it doesn’t guarantee that fungus gnats will disappear.
Can You Use Yellow Sticky Traps in a Dart Frog Vivarium?
Yellow sticky traps are widely used to monitor and capture adult fungus gnats around houseplants.
However, I would not place exposed adhesive traps inside an occupied frog vivarium.
Frogs, feeder insects and other animals could come into contact with the adhesive, creating an avoidable welfare risk.
A Safer Alternative
Place suitable traps outside the enclosure, where frogs and other animals cannot reach them.
They may help you monitor adult fungus gnat activity in the surrounding room.
Remember that catching adults does not necessarily eliminate larvae already developing in the substrate.
Sticky traps are therefore best regarded as a monitoring or supplementary control method rather than a complete solution.
Can You Use Mosquito Bits or BTI in a Vivarium?
You may encounter recommendations for products containing Bacillus thuringiensis israelensis, commonly abbreviated to BTI.
BTI is a biological insecticide used against the larvae of certain flies, including fungus gnats in some horticultural settings.
However, a product being described as biological or natural does not automatically establish that it is safe for direct use in an occupied amphibian enclosure.
Different formulations can contain additional ingredients, and their approved uses vary.
Unless a particular product has appropriate supporting safety information and is authorised for the intended use, I would not recommend adding it to a dart frog vivarium.
The same caution applies to products containing beneficial nematodes. Although certain nematodes are used commercially against fungus gnats in horticulture, that does not automatically demonstrate suitability for use around amphibians and their feeder organisms.
Why I Avoid Household Insecticides in Bioactive Vivariums
This is one area where I would be particularly cautious.
Products designed to kill insects can also affect organisms we deliberately maintain in bioactive enclosures.
These include springtails, isopods and other invertebrates.
Amphibians also have sensitive skin and may be exposed to substances through contact with treated surfaces or contaminated water.
For those reasons, I would avoid using:
- Household fly sprays.
- General-purpose insecticides.
- Insecticidal foggers.
- Essential oil sprays.
- Unverified homemade pesticide mixtures.
- Houseplant treatments without evidence of suitability for the intended amphibian enclosure.
Products described as organic, plant-based or natural are not automatically harmless to frogs.
When dealing with a minor fungus gnat problem, environmental management is generally the more proportionate starting point.
How to Reduce Fungus Gnats Without Destroying Your Bioactive Setup
If I discovered an increasing fungus gnat population in one of my vivariums, I would work through the following process.
Step 1: Confirm the Likely Identification
Observe the adults and inspect likely breeding areas.
Check that they are not escaped fruit flies or another type of small insect.
Step 2: Look for a Recent Introduction
Have you recently added plants, moss, substrate or leaf litter?
Consider whether the insects appeared shortly afterwards.
Step 3: Inspect Drainage and Moisture
Check for waterlogging and unusually wet areas.
Make only adjustments that remain appropriate for the frogs and plants.
Step 4: Remove Problematic Organic Material
Take out any concentrated accumulations of rotting food or severely deteriorating material that do not need to remain.
Preserve normal leaf litter and the established substrate wherever possible.
Step 5: Check Ventilation and Access Points
Inspect mesh, doors and pipe openings.
Correct gaps without compromising necessary airflow.
Step 6: Monitor Adults Outside the Vivarium
Use traps only where they are inaccessible to frogs and other animals.
Also inspect nearby houseplants, which may be acting as a continuing source.
Step 7: Allow Time for the Population to Decline
Adult fungus gnats may continue emerging from larvae and pupae already present in the substrate.
Consequently, improvement may take several weeks rather than a few days.
Continue monitoring instead of repeatedly making major changes to the enclosure.
Fungus Gnat Control Methods: What’s Suitable for a Bioactive Vivarium?
| Method | My recommendation | Important consideration |
|---|---|---|
| Check drainage | Recommended | Correct waterlogging without drying the enclosure excessively |
| Remove rotting food | Recommended | Avoid unnecessarily removing normal leaf litter |
| Quarantine new plants | Recommended | Inspect growing media for larvae and emerging adults |
| Fine insect mesh | Useful where appropriate | Maintain adequate ventilation |
| Sticky traps outside enclosure | Useful for monitoring | Keep adhesive inaccessible to animals |
| Add springtails | Useful for ecosystem maintenance | Not a guaranteed fungus gnat treatment |
| Dry out entire enclosure | Not recommended | May harm frogs, plants and microfauna |
| Household insecticide spray | Avoid | Potential risks to amphibians and beneficial invertebrates |
| BTI or biological pest treatments | Do not assume suitability | Product-specific safety and intended use must be established |
How Long Does It Take to Get Rid of Fungus Gnats?
That depends on the species, temperature, moisture conditions and the number of insects already present.
Under favourable conditions, fungus gnats can complete their development in a matter of weeks.
This means that removing the original source of an infestation does not necessarily stop adults emerging immediately.
You may continue seeing flies while the remaining immature stages complete development.
A gradual reduction over several weeks is more realistic than expecting every insect to disappear overnight.
If numbers continue increasing, reassess the likely breeding sources, including nearby houseplants and other moist containers.
When Should You Consider Rebuilding a Vivarium?
In my view, finding fungus gnats is rarely a good reason to dismantle an otherwise healthy, established bioactive vivarium.
A mature substrate contains an established community of microorganisms and invertebrates.
Removing everything means losing much of that biological development.
I would consider substantial intervention only where there is a wider problem, such as persistent waterlogging, serious substrate deterioration, contamination or an enclosure that cannot maintain suitable conditions for its inhabitants.
Even then, I would investigate the cause before deciding whether a complete rebuild is necessary.
How to Prevent Fungus Gnats Returning
Prevention is usually easier than trying to eliminate a well-established population.
My preferred approach is straightforward:
- Inspect and quarantine new plants.
- Use appropriately sourced substrate and leaf litter.
- Maintain functioning drainage.
- Avoid unnecessary accumulations of rotting food.
- Keep ventilation openings appropriately screened.
- Monitor nearby houseplants for fungus gnats.
- Maintain a healthy bioactive clean-up crew.
- Observe the enclosure regularly without disturbing its inhabitants unnecessarily.
None of these measures guarantees that you’ll never see another fungus gnat.
But together they reduce the likelihood of a persistent infestation while preserving the environment your frogs need.
My Approach at Frogfather HQ
One of the things I try to explain when discussing bioactive vivariums is that they are living ecosystems.
They contain organisms we deliberately introduce, organisms that arrive naturally, and occasionally organisms we’d rather not have.
Not every unexpected insect represents an emergency.
If I see a small number of fungus gnats, my first instinct isn’t to sterilise the enclosure.
It’s to understand why they’re there and whether their presence indicates a genuine problem.
Is the substrate too wet? Has a new plant introduced them? Is there an accumulation of decaying material? Or are a few adults simply finding their way into an otherwise healthy enclosure?
Those are very different situations, and they deserve different responses.
For me, the goal is always to maintain an environment that works for the frogs first, the plants and beneficial microfauna second, and the keeper’s convenience after that.
Final Thoughts: Don’t Destroy a Healthy Vivarium to Eliminate a Few Flies
Tiny black flies in a vivarium can certainly be irritating, particularly when they appear every time you open the enclosure.
But if they are fungus gnats, there is usually no reason to panic.
Identify the insects, investigate the conditions supporting them and make measured adjustments.
Preserve the leaf litter, plants, springtails and other organisms that make the bioactive system function.
And above all, avoid introducing unverified pesticides or treatments into an occupied amphibian enclosure.
A successful bioactive vivarium isn’t one that contains no unexpected life. It’s one that maintains a suitable, balanced environment for the animals living in it.
That’s the principle I follow at Frogfather HQ.
The Frogfather
Frequently Asked Questions About Fungus Gnats in Vivariums
What are the tiny black flies in my vivarium?
Tiny black flies in a vivarium are often fungus gnats, particularly if they are hovering around plants or walking across moist substrate. However, escaped fruit flies, phorid flies and other small insects can look similar. Check their appearance and where they are gathering before deciding on a treatment.
Are fungus gnats harmful to dart frogs?
Adult fungus gnats are generally more of a nuisance than a direct threat to healthy dart frogs. However, large populations can indicate excessively wet substrate or accumulated organic material. Investigate the underlying conditions rather than assuming the insects themselves are dangerous.
How do I get rid of fungus gnats in a bioactive vivarium?
Start by checking drainage, removing unnecessary accumulations of rotting material and inspecting plants for possible introductions. Maintain suitable moisture and ventilation for the frogs. Adult traps can be used outside the enclosure, but avoid exposed adhesives or unverified pesticides inside an occupied vivarium.
Will springtails get rid of fungus gnats?
Springtails help process fungi and decomposing organic matter, contributing to a healthy bioactive substrate. However, they do not reliably eliminate fungus gnat eggs, larvae or adults. Maintain springtails for their wider clean-up role rather than relying on them as a targeted fungus gnat treatment.
Can dart frogs eat fungus gnats?
Dart frogs may opportunistically eat small adult fungus gnats, but this is not a reliable method of controlling an infestation. Fungus gnats should not replace a suitable feeding programme using appropriately cultured feeder insects and supplements.
Where do fungus gnats come from in a vivarium?
Fungus gnats may arrive with new plants, growing media, substrate or other organic materials. Adult insects can also enter through ventilation openings or from nearby houseplants. Quarantining plants and checking enclosure openings can help reduce new introductions.
Can I use yellow sticky traps inside my dart frog vivarium?
Exposed sticky traps should not be placed inside an occupied dart frog vivarium because frogs and other animals could become trapped or contact the adhesive. If using traps, position them outside the enclosure where animals cannot reach them.
Is BTI safe for dart frog vivariums?
BTI, or Bacillus thuringiensis israelensis, is used against certain fly larvae in horticulture. However, this does not automatically establish that a particular BTI product is suitable for an occupied amphibian enclosure. Product formulations and approved uses vary, so avoid applying it without appropriate product-specific safety evidence.
Should I dry out my vivarium to kill fungus gnats?
No. Deliberately drying out an entire tropical dart frog vivarium can harm frogs, plants and beneficial microfauna. Instead, correct unnecessary waterlogging while maintaining the moisture conditions required by the species you keep.
How long does it take to eliminate fungus gnats from a vivarium?
Improvement may take several weeks because larvae and pupae already present in the substrate can continue developing into adults. The timing depends on temperature, moisture and the species involved. If numbers continue increasing, check for additional breeding sources inside and outside the enclosure.