The fastest way to get rid of flies in your apartment is to identify what type you’re dealing with, eliminate their breeding source, and trap the remaining adults. Most small indoor flies fall into one of three categories: fruit flies, drain flies, or fungus gnats. Each breeds in a different spot, so a solution that works for one won’t necessarily touch the others. The good news is that all three can be handled without an exterminator in most cases.
Identify Which Fly You Have
Small apartment flies are generally less than 1/8 inch long, which makes them easy to confuse with each other. But where you see them tells you a lot. Fruit flies hover around kitchen counters, trash cans, and fruit bowls. They have a stout body and distinctly reddish eyes (though a dark-eyed variety exists that prefers bathrooms and drains). Drain flies are fuzzy, moth-like, and slow. You’ll spot them resting on walls near sinks and showers. Fungus gnats look like tiny mosquitoes and congregate around your houseplants, especially when you water them.
There’s also the phorid fly, sometimes called the “scuttle fly” because it runs across surfaces in quick bursts before taking off. Phorid flies breed in decaying organic matter, including inside drains, under appliances, or in garbage disposals. If you see small flies that seem to run more than they fly, that’s likely what you have.
Getting Rid of Fruit Flies
Fruit flies reproduce at a staggering rate. A single female can lay up to 2,000 eggs on any moist, rotting surface. Those eggs hatch into larvae that mature into adults within a couple of days, and two days after that, the new adults are already mating. This means a small problem becomes a big one in under two weeks if you don’t cut off the source.
Start by throwing out any overripe or damaged fruit. Check potatoes, onions, and any produce stored outside the fridge. Empty your kitchen trash, clean the bin itself, and wipe down countertops where juice or residue might have pooled. Rinse recycling containers, especially beer bottles and wine bottles. Fruit flies don’t need much to breed on.
Once the breeding source is gone, trap the remaining adults with a simple DIY setup: fill a small jar with about 1/4 cup of apple cider vinegar and add a few drops of liquid dish soap. The vinegar smells sweet enough to attract the flies, and the soap breaks the surface tension of the liquid so they sink instead of landing on top and flying away. Place a couple of these near your kitchen sink and fruit bowl. You can also cover the jar with plastic wrap and poke small holes in it to funnel flies in, though the soap method works fine without it.
Expect to see results within a few days, but keep the traps out for at least two weeks. Your second generation of fruit flies takes roughly 10 days to mature, so patience matters. An adult fruit fly can live as long as 30 days depending on conditions, which is why the problem can feel like it drags on even after you’ve cleaned everything.
Getting Rid of Drain Flies
Drain flies breed inside the slimy organic buildup that coats the inside of sink pipes, shower drains, and garbage disposals. Killing the adults does very little if the sludge layer remains, because the larvae live in that film and will keep hatching. The goal is to physically remove or break down the gunk inside your pipes.
The simplest first step is boiling water. Pour a full pot of boiling water down the affected drain a few times a day for about a week. The heat kills adults, larvae, and eggs on contact and loosens some of the immediate organic buildup. This alone can solve a mild infestation.
For a more thorough approach, try baking soda and vinegar. Clear any standing water from the drain, pour about half a cup of baking soda directly in, then follow with a cup of white vinegar. You’ll hear fizzing. Plug the drain to contain the reaction and prevent adult flies from escaping, and let the mixture sit for at least an hour, ideally overnight. Flush with hot water the next morning. Repeat daily for several days.
If you can get your hands on a long, flexible drain brush from a hardware store, use it to physically scrape the inside of the pipe. You’re not clearing a clog. You’re scrubbing off the slimy film where drain flies live and lay eggs. This manual cleaning is one of the most effective steps you can take.
Enzymatic drain cleaners are another strong option. These products contain beneficial bacteria that slowly digest hair, soap scum, and grease, breaking down the organic layer that drain flies depend on. They’re gentler on pipes than chemical drain cleaners and more effective at addressing the root problem. Use them as directed over the course of a week or two.
Getting Rid of Fungus Gnats
If the flies are hovering around your houseplants, they’re almost certainly fungus gnats. The adults are mostly just annoying, but their larvae feed on organic matter in the soil, and they tend to concentrate in the top two inches. Warm, consistently moist soil with rich organic content is exactly what they want.
Your first move is to let the soil dry out between waterings. Fungus gnats can’t reproduce as easily in dry conditions, and the larvae need moisture to survive near the surface. This alone slows an infestation significantly. If you tend to water on a schedule rather than checking whether the soil actually needs it, switch to checking with your finger first.
For a more targeted approach, use a product containing BTI (a naturally occurring soil bacterium that kills gnat larvae but is harmless to plants, pets, and people). It’s sold under brand names like Mosquito Bits or Mosquito Dunks at most garden centers. Soak about 4 tablespoons of the granules in a gallon of warm (not boiling) water for at least 30 minutes. Strain out the granules, then use the treated water every time you water your plants. Top watering works best since the larvae live near the surface, but if you bottom water, make sure the top layer of soil gets thoroughly saturated too.
Use this treated water at least every two weeks, ideally every watering session, until the gnats are gone. You’ll also want to place yellow sticky traps near your plants to catch adults and monitor whether the population is declining. These traps won’t solve the problem on their own, but they reduce the number of adults laying new eggs while the BTI does its work in the soil.
Preventing Flies From Coming Back
Most apartment fly problems come down to moisture and organic matter being left somewhere too long. A few habits make reinfestation much less likely:
- Take out kitchen trash daily during warm months, and use a bin with a lid year-round.
- Store ripe fruit in the fridge rather than on the counter, especially bananas, peaches, and tomatoes.
- Run your garbage disposal regularly and flush it with hot water afterward. Food residue left sitting in the disposal is a prime breeding ground.
- Clean drains monthly with boiling water or an enzymatic cleaner, even when you don’t have a problem.
- Avoid overwatering houseplants and consider adding a layer of sand or fine gravel on top of the soil, which dries out quickly and discourages gnats from laying eggs.
- Rinse bottles and cans before putting them in recycling bins, and empty the recycling often.
When It’s Your Landlord’s Problem
If flies are coming from building-wide plumbing issues, shared garbage areas, or structural problems like broken drain traps, pest control falls on your landlord. In many states, landlords are required to maintain habitable conditions, which includes addressing pest infestations tied to building maintenance. In New York, for example, landlords can only treat a tenant’s unit if they’re a certified commercial pesticide applicator, and tenants can treat their own space with general-use products but cannot apply anything in hallways or common areas.
If you’ve cleaned thoroughly, eliminated all obvious breeding sources in your unit, and the flies keep coming, document the problem with photos and notify your landlord in writing. Persistent drain fly or phorid fly infestations that don’t respond to cleaning often point to deeper plumbing issues, such as broken pipes or sewer line problems, that require professional attention like hydro-jetting to scour the inside of the pipes with high-pressure water.