How to Make a Gnat Trap and When to Use a Fly Trap
Fill a jar with vinegar and a few drops of dish soap for fruit flies; use sticky cards and drier soil for fungus gnats. Here are the recipes, placement and when to switch.
The Cobalt Hollow Team
November 25, 2026 · 6 min read

How to make a gnat trap comes down to one jar, a sweet and sour liquid, and a drop of dish soap. Pour apple cider vinegar or another fermented bait into a jar, add soap so insects sink instead of landing, and set it near where you see them. This works for fruit flies; fungus gnats need a different approach, covered below.
Both pests get called gnats, so the first step is to identify which one you have. The bait, the placement and the point where a light trap makes sense all depend on that.
Fruit flies or fungus gnats: identify the pest first
The two are not the same insect. Fruit flies are tan or brown, hover around ripe produce, drains and trash cans, and are drawn to fermenting smells. Fungus gnats are slim, dark and weak fliers, and you find them around houseplants and damp potting soil.
Watch where they gather for a day. Insects circling the fruit bowl or sink are fruit flies. Insects walking on soil or rising when you water a pot are fungus gnats.
| Sign | Fruit fly | Fungus gnat |
|---|---|---|
| Where you see them | Fruit bowl, sink, trash, recycling | Houseplants, seedling trays, windowsills |
| What attracts them | Ripe fruit, fermenting liquid, spills | Damp soil, decaying plant matter |
| Bait trap | Fits: vinegar or wine baits | Poor fit; use sticky cards and dry soil |
| Main fix | Remove the food source, then trap | Let the soil surface dry, then trap |

How to make a gnat trap at home
This is the standard jar trap for fruit flies. It needs no special parts.
What you need
- A small jar or glass
- Apple cider vinegar (see swaps below)
- Dish soap
- Plastic wrap and a rubber band, or a paper cone
- A toothpick
Steps
- Pour about an inch of apple cider vinegar into the jar.
- Add a few drops of dish soap and stir gently so it does not foam.
- Cover the opening with plastic wrap and secure it with the rubber band.
- Poke several small holes in the wrap with the toothpick. Insects enter but have a hard time finding the way out.
- Set the jar next to the fruit bowl or sink and leave it out overnight, then check it.
The soap breaks the surface tension of the liquid. Without it, a fly can stand on the vinegar and drink. With it, the insect sinks, which is the sink and drown principle behind most homemade gnat killer recipes.
Replace the liquid every few days, or sooner if it looks cloudy or the jar is full.
Field note
Use a paper cone instead of plastic wrap: roll paper into a funnel, trim the tip so the opening is small, and set it point-down in the jar. Tape the seam closed.
Bait swaps when you have no apple cider vinegar
You can make a gnat trap without apple cider vinegar. The goal is a fermenting or sweet smell, so several pantry items work.
| Bait | How to set it up |
|---|---|
| White vinegar | Add a spoonful of sugar for a sweet note, then the soap |
| Red wine | A splash in a glass, then a few drops of soap |
| Overripe banana or other fruit | Place a piece in a jar, cover with wrap and poke holes |
| Fruit juice | Mix in a little vinegar, then add the soap |
Keep the soap step in every version that uses liquid. For a fruit-only jar, the wrap with small holes does the holding work.
The same recipes cover how to make a gnat trap indoors. Place a few small jars in the rooms where you see insects rather than one large jar in a single spot.
Where to place gnat traps
Placement matters as much as the recipe. Put traps close to the source, because the insects are drawn to the bait when they find its smell.
- Beside the fruit bowl, compost caddy or trash can
- Near the sink drain and under the sink
- On a counter away from open windows, where air does not scatter the scent
- On a windowsill or shelf near houseplants, with sticky cards for fungus gnats
Remove the attractant as you set traps. Wash produce, take out trash, rinse recycling and wipe spills. A trap catches adults, but fresh food keeps new ones arriving.
Outside
Outdoors, a jar by the patio table can catch a few flies, but open air gives insects plenty of other places to go. Cover food and drinks, empty standing water from saucers and buckets, and keep trash lids closed. Our guide to what a bug zapper is, how it works and where it fails explains one outdoor option and its limits.

How to trap fungus gnats
A vinegar jar draws few fungus gnats, because they come from the soil rather than from fermenting food. The larvae live in damp potting mix, so the fix has two parts: trap the adults and change the watering.
- Press yellow sticky cards into the soil of affected pots, upright on a stake, so the adults land on them.
- Let the top layer of soil dry out between waterings. Check the pot with your finger before you water.
- Empty any water left in the saucer.
- Water from the bottom when you can, so the surface stays dry.
- Replace the cards when they are covered with insects.
A thin layer of coarse sand on top of the soil gives gnats a dry surface. If a pot stays infested, repot it with fresh dry mix and check for soggy roots.
Common mistakes with homemade traps
- Skipping the dish soap, so insects land and fly off again
- Leaving the jar uncovered, which lets in dust and lets insects escape
- Letting the bait sit for weeks until it is dry or moldy
- Setting one trap far from the source
- Using a vinegar trap for fungus gnats and expecting it to solve a soil problem
- Overwatering houseplants while trapping
If you are choosing between recipes, the jar with apple cider vinegar and soap is a good fit for fruit flies, and white vinegar with sugar is a reasonable swap. A homemade trap is one tool, and removing the source still comes first.
When to switch to an indoor fly trap
Homemade traps are fine for a small problem. Consider an indoor trap that uses light and a sticky board when:
- Insects keep returning after you remove food and dry the soil
- You have many plants and sticky cards are hard to place
- You do not want an open jar of liquid where children or pets can reach it
- The insects gather in a spot with an outlet, such as a kitchen or sunroom
Light traps pull in insects that fly toward the glow and hold them on a sticky surface. Follow the manual for placement and unplug before changing the board. You can also browse our Pest Control collection for other traps and tools. Keep fresh food covered and soil dry, because a light trap catches adults and leaves the source in place.
If the pest turns out to be a mouse or rat
Tiny flying insects are one problem, but droppings, gnawing or scratching in the walls point to a rodent. A jar of vinegar does nothing there. VoltRid is a plug-in electric rodent trap for mice and rats: you bait the plates, connect the AC adapter and set the unit where rodents travel. An LED indicator shows the trap status, and the unit opens for emptying and rinsing the plates. It includes an automatic shutoff that engages when the trap is opened.
Our guide to what to do next with a mouse in a trap, including disposal and resetting covers the cleanup steps.
In this guideVoltRid$119.99View


