Skip to the page
Tank & Tankless

Home water heaters, compared spec by spec.

Index

Buying

Water Heater Installation and Code Basics

A code-compliant water heater installation covers the T&P relief valve and its discharge pipe, thermal expansion, a drain pan where leaks could cause damage, venting or wiring, strapping where required and, in most places, a permit.

Compiled by the Tank & Tankless desk · Revised

Drawing of a gas water heater standing in a drain pan, its relief valve piped down the side and across to an open end a few inches above the floor near a floor drain, outside the pan
Fig. 1 · Drawing
On this page
  1. What does a water heater installation include?
  2. What are the T&P valve and discharge pipe rules?
  3. When does a water heater need an expansion tank?
  4. When is a drain pan required?
  5. What does a gas water heater installation need?
  6. Do you need a permit for water heater installation?
  7. Frequently asked

At a glance

  • One maker's manual says the T&P discharge line "shall terminate a maximum of 6 inches above a floor" and must never be blocked or reduced (A. O. Smith).
  • In California, for example, San Diego's bulletin bars any shutoff valve in the T&P drain and bars ending it in a drain pan (City of San Diego RESD-5-1).
  • A closed system (one with a check valve or backflow preventer) needs a properly sized thermal expansion tank, per A. O. Smith's installation instructions and the same bulletin.
  • A. O. Smith's gas manual recommends a metal pan whose width exceeds the tank diameter by 2 inches or more, with its own drain line.
  • In the NFPA 54 table Rinnai reprints, 3/4-inch gas pipe delivers 199 CFH over a 30-foot run, falling to 104 CFH over 100 feet.
  • San Diego requires a plumbing permit for both new and replacement water heaters; permit rules are set locally.

What does a water heater installation include?

A water heater installation includes the water connections and shutoff, the T&P relief valve and its discharge pipe, protection against thermal expansion, a drain pan where needed, and the fuel side: venting and a gas line, or a properly sized electrical circuit. Depending on location it also includes seismic strapping, elevation in garages and a permit with an inspection. Gas, venting and 240 V wiring are hazards, so this is work for a licensed plumber, gas fitter or electrician, following the maker's installation manual.

Rules come from the plumbing, mechanical and fuel gas codes a state or city adopts, plus the maker's instructions, which inspectors also enforce. This page uses two maker manuals and a California city bulletin as examples; the local building department has the final word. For tankless-specific venting and gas line questions, see the tankless venting page; for heat pumps, the heat pump installation page.

  • 6 inMaximum height of the T&P discharge line end above the floor (one maker's manual)A. O. Smith
  • 2 inMinimum extra width of a drain pan beyond the heater's diameterA. O. Smith
  • 18 inGarage elevation for burners, elements and switches that can ignite vapors (San Diego)City of San Diego
  • 199 CFHNatural gas capacity of 3/4-in Schedule 40 pipe at 30 ft, 0.5 in w.c. dropRinnai manual (NFPA 54 table)
Video · How and Why to Maintain a Temperature-and-Pressure Valve | Ask This Old House — This Old House, on YouTube. Chosen because it shows this page's topic; what the channel says is its own view. The video plays only when you press play; until then only its thumbnail image loads from YouTube.

What are the T&P valve and discharge pipe rules?

The T&P (temperature and pressure) relief valve must have a full-size discharge pipe that runs to a safe, visible spot with nothing that could block it. A. O. Smith's electric manual says the line "shall terminate a maximum of 6 inches above a floor" and that "the discharge opening must not be blocked or reduced in size." PNNL's checklist uses the same 6-inch limit "or as prescribed by local code."

In California, for example, the San Diego bulletin spells out more detail. Every T&P valve needs a drain, with no shutoff valve in it. The drain may not be smaller than the valve outlet and must be galvanized steel, CPVC, hard-drawn copper or a listed relief valve drain tube. It runs outside with the end pointing down, between 6 inches and 2 feet above the ground, or to an approved receptor with at least a 1-inch air gap, and it may not end in the water heater's drain pan.

Never cap or plug a discharge pipe, and never remove or disable the valve. A dripping relief valve is a symptom to diagnose, not to stop; the leaking page covers the checks.

Tank installation checkpoints on a cross-section drawing: expansion tank on a closed system; T&P discharge pipe full size with no shutoff valve, ending no more than 6 inches above the floor (maker manual) outside the pan; straps in the upper 1/3 and lower 1/3 (California); lower strap 4 in or more above controls; drain pan 2 in or more wider than the heater; garage: burner or element 18 in or more above floor; permit rules are local. Source: maker manual; City of San Diego RESD-5-1.
Spec drawing · tap to enlarge
Drawing of a thermal expansion tank mounted on the cold supply line above a tank water heater, with a pressure gauge
Drawing

When does a water heater need an expansion tank?

A water heater needs an expansion tank when the home's plumbing is a closed system, meaning a check valve, backflow preventer or other normally closed device stops heated water from expanding back into the main. A. O. Smith's electric manual warns of early tank leaks from expansion in such systems and asks for an expansion tank sized for the job.

San Diego's bulletin says any such system must have an approved, listed and adequately sized expansion tank installed on the building side of the check valve. A. O. Smith adds that the tank must be sized to the water heater's capacity and pre-charged to match the home's incoming water pressure. That pre-charge is worth checking at installation and whenever the T&P valve starts to drip.

When is a drain pan required?

A drain pan is required wherever a leak could cause damage, such as an attic or a space above finished rooms. A. O. Smith's gas manual says "most codes require, and we recommend" a metal pan, drained to a suitable point, that is 2 inches or more wider than the heater's diameter. San Diego calls for an approved pan with at least a 3/4-inch drain to a readily visible location in attics and similar spots.

The pan drain and the T&P discharge are separate lines. San Diego states it is "not acceptable" to end the T&P drain in the pan, because a hot, high-pressure discharge needs its own route.

What does a gas water heater installation need?

A gas water heater installation needs the right vent, a gas line sized for the burner, enough combustion air and a location the code allows. Vent type follows the appliance: DOE's rulemaking notes that most atmospheric gas tanks use Type B metal vent, non-condensing tankless units Category III vent and condensing units Category IV. ENERGY STAR adds that condensing models vent through PVC and need a condensate drain. San Diego's bulletin says a shared Type B vent must be sized for the new heater plus every other gas appliance on it.

Gas line size depends on length, pressure drop and load, and is set by the National Fuel Gas Code (NFPA 54). The table in Rinnai's manual shows why a 3/4-inch line is not automatically enough for a 199,000 Btu/h tankless unit:

Natural gas capacity of 3/4-inch Schedule 40 pipe, 0.5 in w.c. pressure drop (source: Rinnai SENSEI RX manual, reprinting NFPA 54)
Pipe lengthCapacity (cubic feet per hour)Approx. Btu/h (derived, about 1,037 Btu per cubic foot)
30 ft199≈206,000
60 ft137≈142,000
100 ft104≈108,000

Rinnai also requires inlet pressure to stay at or above 5.0 inches w.c. for natural gas and 8.0 for propane with every gas appliance firing. Location rules matter too: San Diego bars gas-fired heaters from bathrooms, clothes closets and bedrooms unless they are direct-vent, and in a garage any pilot, burner, element or switch able to ignite vapors must be raised 18 inches or more. Electric and heat pump tanks need their own circuit; per ENERGY STAR, the usual 240 V hybrid unit runs on a 30-amp breaker with 10-gauge wire, the same as a standard electric tank. The gas tank page compares vent styles.

In California, for example, every water heater must also be strapped against earthquakes. San Diego's bulletin places one strap within the top third and one within the bottom third of the tank, keeping the lower one 4 inches or more clear of the controls.

Do you need a permit for water heater installation?

Usually yes. San Diego's bulletin states that "a plumbing permit is required for the installation of a water heater," whether original or replacement, and that installations must comply with the California Plumbing Code. Many other cities and counties have similar rules, but requirements, fees and inspections are set locally.

A permit brings an inspection that checks the items on this page: discharge piping, venting, gas connections, strapping and clearances. Ask the installer whether the price includes the permit, and keep the final inspection record with the manual. If the old installation lacks an expansion tank, pan or proper discharge pipe, expect the inspector to look at those items on the replacement. The sizing page covers choosing the unit before the install is planned.

Sources and scope

Sources: A. O. Smith's residential gas and electric installation manuals, Rinnai's SENSEI RX installation manual and its NFPA 54 gas pipe table, the City of San Diego technical bulletin RESD-5-1 (May 2025), PNNL's heat pump water heater checklist, ENERGY STAR's installation guidance and DOE's 2024 rulemaking (all checked October 2026). The model code books (IPC, UPC, IRC) could not be opened for this page, so no code section numbers are quoted; California examples are labeled as such. Left out: contractor pricing, do-it-yourself gas or wiring steps, and brand comparisons.

Frequently asked

Can a homeowner install a water heater without a permit?

In many places, no: San Diego, for example, requires a plumbing permit even for a like-for-like replacement. Check with the local building department before work starts.

Why does a water heater have to be 18 inches off a garage floor?

The rule keeps parts that can ignite vapors off the floor of a space where fuel and solvents are stored. San Diego's bulletin sets the 18-inch minimum for pilots, burners, elements and switches; other jurisdictions and the maker's manual may add conditions.

Can the T&P discharge pipe run uphill?

Codes and manuals call for an unobstructed discharge to a safe point, and San Diego requires the outdoor end to point downward. Local code and the maker's manual set any routing limits, so ask the installer or inspector.

Does a tankless water heater need an expansion tank?

Tankless units store little water, but local rules on closed systems still apply to the home's plumbing. The installer should follow the maker's manual and local code.

Is PVC allowed for a T&P discharge line?

San Diego lists galvanized steel, CPVC, hard-drawn copper or a listed relief valve drain tube. Ordinary PVC is not on that list.

Does an electric water heater need a dedicated circuit?

Standard 240 V electric and heat pump tanks are wired on their own circuit, typically 30 amps with 10-gauge wire per ENERGY STAR. Some 120 V heat pump models plug into a dedicated or shared outlet, depending on the model.

Who checks that the gas line is big enough?

A licensed gas fitter or plumber sizes the line from the appliance input, pipe length and pressure using NFPA 54 tables, and the inspector checks it under the permit.

Related reading