Keeping bugs out of an apartment comes down to three things: sealing the gaps they use to get in, removing what attracts them, and controlling moisture. Apartments pose unique challenges because pests can travel between units through shared walls, ceilings, and plumbing. But even in older buildings, a systematic approach can dramatically cut down on unwanted visitors.
Seal Every Gap, Starting With Doors
Most insects enter through gaps you barely notice. A crack just 1/16 of an inch wide is enough for ants, spiders, and cockroaches to slip through. A gap the width of a pencil (about 1/4 inch) lets mice in. The University of Kentucky’s entomology department recommends a simple test: lie on the floor and look for light filtering under your doors. If you see any, that’s an entry point.
Install door sweeps on every exterior door and pay special attention to the bottom corners, which are the most common entry spots for both insects and rodents. Run a bead of caulk along the bottom outside edge and sides of your door threshold to block ants and other small crawlers. For sliding glass doors, line the bottom track with 1/2 to 3/4 inch foam weatherstripping.
Beyond doors, caulk cracks around windows, baseboards, and fascia boards. Acrylic latex caulk is the easiest to work with because it cleans up with water and can be painted over. Clear-drying caulk is more forgiving than pigmented versions if you’re not experienced. For larger openings around pipes and wires under your kitchen and bathroom sinks, stuff them with steel wool or copper mesh first, then seal over with caulk or expandable foam. This is especially important in apartments, where cockroaches and other pests migrate between units through these pipe gaps.
Check window and door screens for tears or gaps and repair them. Even a small rip defeats the purpose of having a screen at all.
Cut Off Food and Water Sources
Bugs don’t stay where there’s nothing to eat or drink. Cockroaches, ants, and pantry pests all thrive on the same things: crumbs, grease, standing water, and accessible food.
Clean up spills and food waste immediately. Don’t leave unwashed dishes, utensils, or pet food sitting out overnight. Store loose food, including bulk goods and pet food, in containers with tight-fitting lids. Plastic bags are not adequate, according to UC’s Integrated Pest Management program, because pantry pests can chew through them. Glass, metal, or thick plastic containers with screw-top or snap-on lids are what you want. Keep your pantry dry, since moisture encourages pest development while dryness discourages it.
Take out garbage regularly rather than letting it accumulate. Stacks of paper bags, cardboard boxes, and newspapers also attract pests and give them hiding spots. Recycle or discard them, or store them in sealed plastic bags if you need to keep them.
Manage Moisture and Drains
Many pests, including silverfish, cockroaches, and drain flies, are drawn to damp environments. Silverfish prefer temperatures between 71°F and 90°F with humidity above 75%. Keeping your apartment well-ventilated and using a dehumidifier in naturally damp areas like bathrooms and laundry rooms makes your space less hospitable to these pests.
Drain flies are a particularly common apartment nuisance. They breed in the slimy biofilm that coats the inside of drains, feeding on grease, soap scum, hair, and food residue. Kitchen sinks, bathroom drains, and shower drains are the most common breeding sites. Guest bathroom drains that rarely get used are another hot spot, because the water in the P-trap (the curved section of pipe underneath) can dry out, leaving an open path from the sewer into your apartment.
To prevent drain flies, run water through every drain in your apartment at least once a week, even ones you don’t regularly use. For active problems, pull the strainer or stopper and scrub as far down as you can reach with a stiff bottle brush, then flush with hot water. Biological drain cleaners containing bacterial surfactants can dissolve biofilm without corroding pipes. Used weekly for the first month and monthly afterward, they typically clear an infestation within two to three weeks.
Prevent Cockroach Migration Between Units
In apartments, cockroaches travel between units through shared walls, ceilings, and plumbing chases. You can have a spotless apartment and still get cockroaches from a neighboring unit. Sealing every opening where pipes or wires pass through walls and floors with caulk, foam, or copper mesh is one of the most effective things you can do. Focus on the areas under kitchen and bathroom sinks, around radiator pipes, and near electrical outlets on shared walls.
Beyond sealing, sanitation is your strongest defense. Cockroaches need food, water, and shelter. Eliminating even one of those makes your unit far less attractive than a neighboring one that offers all three. If you do spot cockroaches, gel baits placed in cracks and crevices near where you’ve seen activity are the most effective consumer-level treatment. They work better than sprays because cockroaches carry the bait back to their hiding spots, spreading it to others.
Protect Against Bed Bugs
Bed bugs deserve special attention in apartments because they spread between units by crawling through cracks in walls, along ceilings, and through electrical outlets. Prevention looks different from other pests because bed bugs aren’t attracted to food or filth. They’re attracted to you, specifically your body heat and the carbon dioxide you exhale while sleeping.
Keep your bed away from walls. Tuck in sheets and blankets so they don’t contact the floor or walls, which eliminates bridge paths. Caulk and seal as many cracks and crevices near your bed as possible, including gaps along baseboards and around electrical outlet covers on shared walls. Encasing your mattress and box spring in bed bug-proof covers traps any bugs already inside and makes it easier to spot new ones.
When bringing secondhand furniture into your apartment, inspect it thoroughly before it crosses your threshold. The same goes for luggage after traveling.
Using Diatomaceous Earth and Other Low-Toxicity Options
Food-grade diatomaceous earth is popular as a natural pest control, but there are important caveats. While the FDA considers it safe when added to food at concentrations up to 2%, pest control involves spreading much higher concentrations around your home. Breathing in the dust is the primary concern. The National Pesticide Information Center notes that food-grade products sold outside of pest control have not been tested for pest control-related risks or safety in those applications.
If you use diatomaceous earth, choose a product that carries an EPA-registered pesticide label, which will include specific safety instructions. Wear a dust mask during application. Keep pets and children away from treated areas, and avoid applying it near fans, air vents, swinging doors, or high-traffic zones where it will become airborne. Apply it as a thin layer in cracks and crevices rather than in visible piles.
What Your Landlord Is Responsible For
In most states, landlords are legally required to maintain apartments in habitable condition, which includes addressing pest infestations. This obligation falls under the implied warranty of habitability, a legal doctrine holding that rental units must meet basic health and safety standards and comply with local housing codes. If your landlord fails to address a pest problem, you may have the right to withhold rent, arrange repairs yourself and deduct the cost, or pursue remedies through court, depending on your state’s laws.
Landlords are also prohibited from retaliating against tenants who report housing code violations, including pest complaints. Document everything: take photos, save written communications, and note dates when you reported issues. If your building has a recurring pest problem that your landlord isn’t addressing, contact your local housing authority or code enforcement office to file a complaint.
A Practical Prevention Checklist
- Doors and windows: Install door sweeps, caulk frames, repair screens, and add weatherstripping to sliding doors.
- Pipes and wires: Seal every gap under sinks, around radiators, and where utilities enter your walls with caulk, steel wool, or copper mesh.
- Shared walls: Caulk along baseboards and around electrical outlets, especially on walls shared with other units.
- Food storage: Use rigid containers with tight lids. No open bags, no overnight dishes, no accumulating trash.
- Moisture control: Fix leaks promptly, ventilate bathrooms, run water through unused drains weekly, and scrub drain buildup monthly.
- Clutter: Eliminate cardboard, paper bags, and newspaper stacks that provide hiding and breeding spots.
The common thread across every pest type is that prevention works better than reaction. Sealing entry points takes an afternoon. Maintaining clean, dry conditions is a daily habit. Together, they make your apartment a place bugs pass through rather than move into.