Dealing with Fruit Flies and Fungus Gnats in the Worm Bin


Flies are one of the most common pests encountered early in the worm farming journey.  They can be especially annoying buzzing around and getting in our faces while we maintain a bin.

One of the first steps is to identify which type of fly you are encountering, two of the most common are fruit flies and fungus gnats.  Many people confuse these two flying creatures. They look similar and can both be a challenge, however, they have different lifecycles and food preferences, so understanding them better will help you manage them.

Fruit Flies

Fruit Fly | Photo: Martin Cooper, Creative Commons,

Fruit flies are a common pest in homes, restaurants, and other places where food is served - you’ve likely encountered them before.  They are drawn to the sweet, sugary foods you may feed your worms such as rotting and fermenting fruits.  They lay their eggs in ripe or rotting fruit and have no interest in the bedding.

Color: Striped abdomens, red or black eyes
Size: 1/8 in long, black eyed fruit flies can be 3/16 in long
Appearance: Similar look to a house fly… but much smaller
Where can they come from: From the grocery store or from produce brought in from the garden.

Fungus Gnat

Fungus Gnat | Photo: Katja Schulz, Creative Commons,

Moist soil provides an amenable habitat for fungus gnat larvae and pupae.  In a worm bin, they feed on fungi growing on compost/bedding. You may have encountered these little guys before near houseplants - they love to crawl around in the soil. They lay their eggs in moist soil and are not attracted to fruits. They actually have anti-freeze proteins that can help them survive cold temperatures.

Fungus gnats can easily inflict harm to seedlings - so you’ll definitely want to control them if you use the same space for growing plants.  Adults can lay up to 10 eggs at a time and they hatch in about 5 days so you can definitely see how populations can explode if not brought under control.

Color: Brown/black with light color legs
Size: Less than ⅛ in long
Appearance: A mosquito-esque appearance
Where can they come from: From soil or bedding that comes in from outside or another environment - they can even fly through screens from the outside.

What Steps can We Take?

So… how can we get rid of fruit flies and fungus gnats and keep them from reappearing?  It’s best to understand them individually and treat them separately to be most effective.

Fruit Fly Eradication

Trap them to prevent them from laying eggs and completing another lifecycle. I’ve mentioned how I put food scraps in a few open bags and then capture to control them.  You could also create a homemade trap.

Fruit Fly Prevention

Remove their food source (and the place they lay eggs).  You can bury your worm food under the surface, or blend it so that the worms consume if faster and it does not stay on the surface long enough to draw flies.  You can also freeze scraps to kill any eggs present.

Fungus Gnat Eradication

Glue traps at soil level can be effective (check price) for fungus gnats - fruit fly traps that rely on sugars will not attract fungus gnats.

Fungus Gnat Prevention

Fungus gnats thrive in moist soil… which is also what the worms need, so the typical preventative of allowing the top layer of soil to dry or putting rocks on top of the soil does not work.

Mosquito Dunks (check price) or BTI (bacillus thuringiensis israelensis) is a bacteria that kills mosquito larvae. It is also effective on fungus gnat larvae, but harmless to the worms.  Break dunks into pieces and soak in water overnight and then water your bin. Use when watering for several weeks to ensure that all gnat larvae is eradicated.

Fungus Gnat and Fruit Fly Prevention

Diatomaceous Earth

Diatomaceous Earth “DE” (check price) is a non-toxic, sedimentary rock which formed from the fossils of algae. Normally ground to a fine powder, it has microscopic shards of silica which cuts flies and larvae and causes them to dehydrate and die. Sprinkling DE on the top of your wom bin can help prevent/eradicate both fruit flies and fungus gnats.

  • Use Food grade DE
  • Use a mask, don’t breathe the dust in
  • Treat periodically on top of your worm bin (It can lose effectiveness when wet)
*Special Thanks to “Worms for Life” on YouTube for graciously sharing their expertise on DE and BTI

May you find worm success!