Few things in nature are as magical as a backyard coruscating with the glow of fireflies. But sadly — most likely due to habitat destruction, pesticide use and light pollution — firefly populations are dwindling. With that in mind, making a firefly-friendly garden can serve two purposes: it can help the fireflies, and it can fill your summer dusk with the beguiling beauty of bioluminescence! Here’s how to get fireflies to flock to your neck of the woods.

Skip the chemicals

Most chemicals used outdoors to kill or deter certain bugs aren’t that selective; they will likely kill or deter fireflies as well. And since larvae are born underground, lawn chemicals in the soil will be detrimental as well.

Don’t disrupt the slimy things

As magical as fireflies may be, the larvae have a less-than-enchanting secret; they’re wee carnivores that feast on worms, grubs, slugs and snails. (And they do so by immobilizing their prey with toxic enzymes before sucking out the liquefied body contents. Sweet!) To keep the zombie bug babies happy so that they can grow up to become pretty fireflies, leave their slimy victims alone.

Provide good cover

During the day, nocturnal adult fireflies hide in the grass and low-profile plants. A nice variety of shrubs, high grass and low-growing plants will provide shelter.

Give them what they like

Fireflies like moist areas, especially wet meadows, forest edges, farm fields, and wild bog, marsh, stream and lake edges.

Plant flowers

With 2,000 species of fireflies — and many of them having different diets — it may be hard to pinpoint what your local variety likes to eat. Many adult fireflies eat very little, but regardless, many eat a variety of pollen and nectar, so having a lot of flowers around should prove enticing. (And that approach is good for other pollinators, too!)

Dim the lights

Since fireflies are so reliant on their “fire,” confusing them with artificial light can cause many problems. Street lamps, garden lights and porch lights can all make fireflies a little shy.

Resist the urge to put them in a jar

Yes, it may be one of the joys of childhood, but collecting fireflies in a container can lead to accidental death — not to mention bug trauma. Instead, enjoy them as they flit about freely.

Related stories on MNN: