In Holmes, New York, Ken and Kathy Follett were hauling water to a garden site that wasn’t close to a water source. It occurred to them there was an easier — and more ecological — way to do that. They installed a 55-gallon rain barrel to collect water off the galvanized roof of a nearby barn and funneled the water into a drip irrigation system.

The result? A garden that waters itself. “It certainly saves a lot of time and effort for us, and it’s good for the environment as well,” Ken Follett says.

Rain barrels — barrels that catch and store rainwater from roofs — have been a green, inexpensive solution to help water yards and gardens for decades. They may also help prevent flooding of storm drains and sewers.

Easy to construct and use, a rain barrel is usually made from a 55 gallon drum, a vinyl house, PVC couplings, a screen grate to keep debris out and other odds and ends from the hardware store. They’re increasingly popular now, especially in drought-stricken western states.

Related: 10 Surprising Ways to Help the Planet

Proof of their appeal: In 2013, when the Environmental Protection Agency (EPA) began a rain barrel study in Cincinnati, Ohio, to see whether the barrels might improve water quality by preventing runoff to sewers, the community response was overwhelming. As project hydrologist Bill Shuster, PhD, told the EPA News, “People were literally chasing down the landscaper trucks saying, ‘Where can I get one of these? My neighbor has one…I want one of those!’”

But like many green solutions, rain barrels are not problem free. Used the wrong way or neglected, they can pose a hazard to your health, your family’s safety, your pets and even your garden. And they may not be legal in your area.

Here are some things to consider before you install a rain barrel.

The water isn’t safe to drink. In fact, it’s been linked with disease outbreaks, according to the Centers for Disease Control and Prevention (CDC). Remember, it comes off a roof, so it may contain bits of asphalt roofing, chemicals, dirt, insects and even animal and bird droppings. It can incubate bacteria, viruses and parasites and attract insects.

The CDC advises people not to use it to water plants you plan to eat, but according to the University of Rhode Island’s food safety education program, watering your garden with it can be OK if you use drip irrigation and you thoroughly wash the edible produce in tap water before eating. URI researchers do warn gardeners not to use rain barrel water for irrigation just before a harvest and to never wash the fruits or vegetables in rain barrel water before eating them.

Related: How To Compost Without Attracting Pests

Untended, the barrel can be a drowning and disease hazard. An untended rain barrel may attract small children or thirsty pets who could tumble in and drown. Never let kids climb on a rain barrel, open it or even play nearby. And don’t install a rain barrel near a deck, porch, stairs or furniture that allows a small child or pet to climb up and fall in.

Keep the rain barrel covered at all times. Drain it right away if the top is cracked or doesn’t close. An open barrel means animals and birds could fall in and contaminate the water. It also allows mosquitos, which can carry the West Nile virus, to settle and breed. A cover can prevent these problems. Check regularly to be sure it’s securely fastened (not cracked or damaged) and that it can’t easily be pushed aside.

It can tip over. A rain barrel full of 60 gallons weighs about 500 pounds, and that can cause property damage and injure or even kill someone if the barrel falls over. Install the barrel on a solid, level surface (and strap it to the building for extra stability).

It may damage your home if installed wrong. Incorrectly installing a rain barrel may cause water damage to your home’s siding or foundation over time. Always use a plywood barrier between the barrel and the house to help prevent water damage. Diverting overflow away from the foundation (and your neighbors’ foundations) can prevent damage and basement flooding.

Also, be careful during the installation: If by chance the downspout contains heating cables, there is the potential for electrocution or a fire during the installation.

It may not be legal. Many states, including Texas, are offering incentives, such as tax deductions, for installing rain harvesting systems. But in other states, such as Colorado, it is illegal to collect and store rainwater.Check with your state's water resource agency. You may be eligible for a rebate — or a citation. The American Rainwater Catchment Systems Association has a link to regulations and codes by state.

It may not solve all your water needs. When it’s raining enough to keep the barrel full, you won’t have much need for the water. When it’s not raining, the barrel is soon emptied: In western states and other areas with long, dry summers, water collected in the rainy season is gone before the thirsty garden needs it most. Installing multiple barrels will collect more water, of course.

Caveats aside…

For some people, going much larger is the answer. On Guemes Island in Washington State, there is little groundwater supply, said Sandra Lane. She and her husband installed two 2,500-gallon tanks to collect rainwater on their one-acre plot almost a decade ago. As drought-like conditions increased in recent years, they count on the rainwater tanks to get their orchard and garden through the dry summer months. "They are very, very important to us,” said Lane. “We don’t worry as much now.”

With these caveats in mind, a rain barrel may help you (and your water bill) through times of drought while helping prevent storm drain flooding during heavy rains.

Related: Tips for Greener House Cleaning

Judith Horstman (judithhorstman.com) is an award-winning journalist specializing in health and science. She has been a Washington correspondent, university professor and Fulbright scholar. She has also written for many publications, including Time Inc.,and is the author of seven books, including four Scientific American books about the brain.