Water Heater Installation Code Requirements and Violations You Should Know

Paige Bennett
Written by Paige Bennett
Updated June 2, 2023
Woman at kitchen sink
Photo: Bnenin / Adobe Stock


  • Water heaters have stringent codes for safety.

  • Water heater code violations can void your warranty.

  • Many people have code violations for drainage pipe issues.

  • It’s critical to place gas and propane water heaters on a platform.

  • Licensed pros should handle water heater installation.

Get quotes from up to 3 pros!
Enter a zip below and get matched to top-rated pros near you.

Most homeowners don’t give much thought to everything their home's water heater does for their day-to-day comfort. But when your water heater has reached the end of its lifespan, the odds are that replacing it is pretty high on your to-do list. But water heater replacement isn’t something you can jump right into, as there are multiple codes that you and your local water heater installation pro must adhere to.

Let’s discuss water heater installation code requirements and common violations you can run into if you’re not careful.

Will I Violate Codes If I Install My Own Water Heater?

Even if you’re comfortable tackling home upgrades on your own, you shouldn’t DIY install a water heater. Here are a few things to keep in mind:

  • Plumbing codes: A water heater and its set-up must adhere to official water heater plumbing codes, so you’re not unintentionally committing a code violation. You’ll also need to make sure it’s set up to prevent the water heater from leaking.

  • Warranty: If you replaced your water heater yourself versus hiring a licensed plumber, not all manufacturers will cover your water heater if something happens to it.

  • Permits: Not all cities require you to have a permit to replace your water heater. However, it’s highly recommended that all homeowners get a water heater permit for this project. Also, some cities might require you to get secondary—plumbing or electrical—permits. To see what type of permits you’ll need, check your local building codes.

  • Supporting skills: A lot goes into replacing a water heater, like making sure all the wiring and plumbing is correct and there are no leaks or holes that gas or pressure can escape out of. Plus, depending on your new water heater, you might have to make an opening in your wall to stay within its dimensions.

Why You Should Be Up-to-Date With Water Heater Code Requirements

Plumber repairing a hot water heater
Photo: Minerva Studio / Adobe Stock

While you may be tempted to install a water heater yourself to save some money or you may forget to inspect the water heater to keep it up to code, risking code violations is not worth it. In addition to facing penalty fines, code violations can void your water heater warranty, which can be costly if something needs to be repaired or the water heater needs to be replaced. Not only that, but code violations can create life-threatening risks to your household.

12 water heaters code requirements illustrated, including a drain pan, sediment trap, and proper ventilation

Here are a few water heater installation code requirements to know so you can ensure your water heater is always up to code:

1. Drain Pan Is Installed

If your water heater is in a finished basement or anywhere where leaking can cause damage, you must install a drain pan underneath it. However, according to the International Code Council (ICC), if the drain pan wasn’t previously installed, there’s no need to add one when you’re replacing it. However, if your existing water heater had a drain pan, it’s a violation not to include it when replacing your unit.

2. Sediment Trap Is Installed

Another code violation is skipping out on a sediment trap. A sediment trap prevents any debris in the gas line from getting into the gas valve of your water heater and damaging it. The sediment trap should be installed downstream of the shutoff valve and as close to the inlet as practical. 

3. Not Installed in a Prohibited Location

Because gas and propane water heaters release carbon monoxide (CO) while in use, it’s a code violation to place them in a prohibited area of your home. Some of these prohibited areas include:

  • Bedrooms

  • Bathrooms

  • Toilet rooms

  • Storage closets

Other code regulations say water heaters have to sit on an external wall or, if that space is used for no other purpose, equipped with a solid weatherstripped door and an approved self-closing device. Combustion air should be taken directly from outdoors and comply with that code.  

Also, a water heater’s location needs to have at least 12 inches of clearance all around to make sure it’s getting sufficient airflow.

4. Earthquake Straps Are in Place

Suppose you live in an area that experiences earthquakes. In that case, it’s a code violation not to have earthquake straps on your water heater to resist horizontal force equal to one-third of the operating weight of your unit. This means that if an earthquake hits, your water heater needs to be strapped down so that the natural disaster doesn’t damage it and, as a result, your home.

5. Properly Vented

One of the most common water heater code violations is not giving your unit enough venting space. Your unit needs proper ventilation to minimize the risk of CO poisoning and back-drafting (exhaust gasses entering your home instead of going outdoors). 

There are various ways to vent your water heater, each with different requirements. If you need help figuring out which option works best for your unit, reach out to a water heater installation pro for guidance.

6. Expansion Tank Is Installed

Not every home requires an expansion tank. The code requires homeowners to install an expansion tank if their water heater is on a closed system. Closed systems mean that you have a backflow prevention device, such as a check valve, installed that prevents excess pressure from flowing back into the municipal water supply system or pressure regulating valve. If you do, expansion tanks help stop pressure fluctuations commonly caused by a closed system. 

A closed system set-up without an expansion tank can place unnecessary stress on your appliances and shorten their lifespan.

If you do need one, expansion tank installation costs about $90 to $350, or $220 on average.

7. Healthy Combustion Air Amount

Fuel-based water heaters require a healthy amount of combustion air to work. If there’s not enough, your water heater won’t work. To guarantee your water heater is getting enough combustion air to function, you’ll need to determine whether you’ll get it from indoors or outdoors. Combustion air requirements are calculated using the formula provided by the ICC. 

8. Correct T&P Relief Valve Placement

The temperature and pressure relief valve help keep the pressure inside your water heater in check so that it doesn’t rise to dangerous levels (i.e., over 210 degrees Fahrenheit or 150 PSI). It’s practically essential to the safety of you, your home, and your plumbing system.

The problem isn’t why it’s needed, but more so if it’s installed correctly. Incorrect installation can cause the T&P relief valve not to work correctly or at all, leaving your home vulnerable to exceedingly high water pressures and, worst-case scenario, a water heater explosion.

9. You Have a Pressure Regulator

Some homeowners might ignore high water pressure or think it’s normal, but it’s not. It’s a code violation if the water pressure in your home constantly exceeds 80 PSI and you don’t have a pressure regulator to help lower your water pressure to safer levels.

10. Dedicated Shutoff Valve

The water heater should have its own shutoff valve, so you can turn off water only to the water heater and not the entire house. This is useful for regular maintenance, like flushing the water heater, and for any repairs. Just make sure that the shutoff valve is not placed between the temperature and pressure relief valve (TPR or T&P valve) and the termination.

11. Discharge Pipe Is Connected to T&P Valve

The discharge pipe helps the T&P valve release hot water and directs that water to a safe location. The discharge pipe must be connected to the T&P valve with a pipe that isn’t smaller than the T&P valve. This pipe can release water either outside, into a drain in the floor, or into a catch pain. 

No matter where the water is released, the pipe should end at most 6 inches above the ground and at least two times the amount of the pipe’s diameter. Discharge pipes that release water outside must be visible from the home’s exterior.

Further, discharge pipes must:

  • Include an air gap.

  • Only serve one system.

  • Not be trapped or blocked.

  • Slope to promote flow by gravity.

  • Not cause structural damage.

  • Be made with materials approved for drinking water.

  • Not be threaded.

12. Gas Water Heaters Are Raised

Water heaters with ignition sources, like gas or propane, need to sit on a platform. The water heater itself will have to be at least 18 inches off of the floor. This code requirement is important in preventing fires or explosions. The water heater could release vapors, which sink toward the floor. A spark from the water heater could ignite the vapors, putting your family in serious danger.

Contacting a Pro for Water Heater Installation and Replacement

Building codes are in place to ensure that your home is structurally sound and safe for you and your family. And since a licensed pro is familiar with building codes, water heater replacement is a job that’s best left to them. For this project, expect to pay between $810 and $1,570.  

Bry'Ana Arvie contributed to this piece.

Need professional help with your project?
Get quotes from top-rated pros.