How to Install a Water Heater
To install a water heater, you drain and disconnect the old one, set the new tank, connect the water lines, hook up gas or power, pipe the relief valve to a safe spot, and fill the tank completely before you turn on the heat. A like-for-like electric swap is a reasonable DIY job for someone handy, but gas work, venting and anything that changes fuel or size usually belongs to a licensed plumber, and most areas want a permit either way.
Should you do it yourself?
Be honest about three things before you start.
First, the permit. HomeGuide puts a water heater permit at $50 to $200, and the manuals tell you to follow local and state codes and have an inspector check the work. Check with your local building department. Some only let licensed plumbers pull the permit for gas work.
Second, the weight and the time. A full tank swap takes a pro 2 to 6 hours. Budget a full day for your first one, plus a trip back to the store.
Third, the warranty. Some manufacturers tie warranty coverage to a qualified installer. A.O. Smith's tankless manual says the warranty is void otherwise. Read yours before you buy.
If you'd rather hand it off, the type-specific guides show what a proper install includes: gas water heater installation, electric water heater installation, heat pump water heater installation and tankless water heater installation.
Tools and parts
- Garden hose for draining, bucket and towels
- Pipe wrenches, adjustable wrench, tubing cutter
- Flexible water connectors or copper and fittings, plus dielectric unions on copper
- A new T&P relief valve if your heater doesn't ship with one, and copper or CPVC discharge pipe
- A metal or plastic drain pan sized for the new tank
- A thermal expansion tank if your system needs one
- Gas: pipe dope or yellow gas tape, a sediment trap, a union and soapy water for leak checks
- Electric: a non-contact voltage tester and a multimeter
- An appliance dolly and a second person
Step by step: tank water heater
Shut off the fuel. Turn the gas valve off at the heater, or switch off the breaker for an electric unit and confirm it's dead with a tester.
Shut off the cold water supply to the heater and open a hot tap upstairs to break the vacuum.
Drain the old tank through the drain valve into a floor drain or outside. The drain valve on most tanks is plastic and hates being cranked, so open it gently. Our how to drain a water heater guide covers a slow or clogged drain.
Disconnect the water lines, then the gas line or wiring, and on gas units the vent connector.
Move the old tank out and set the new one in a pan on a level spot, with the service access clear. A.O. Smith calls for at least 24 inches of front clearance on its gas tanks.
Connect cold to the inlet and hot to the outlet. Don't remove the factory heat traps, and don't solder pipe while it's attached to the heater.
Install the T&P relief valve and run the discharge pipe. A.O. Smith specifies at least 3/4-inch inside diameter pipe, sloped to drain, ending no more than six inches above a floor drain or outside, with no valve, cap or reducer anywhere in it.
Add an expansion tank if needed. A.O. Smith says codes require a properly pressurized, properly sized thermal expansion tank in almost all homes.
Connect gas or power. Gas needs a manual shutoff, a sediment trap and a leak check with soapy water. Electric needs the wiring matched to the data plate.
Fill the tank. Open the cold supply and a hot tap, and let water run full stream for three full minutes before you light the burner or turn on the breaker.
Light the pilot or restore power, set the thermostat and check every joint for leaks. A.O. Smith ships its heaters set to about 120°F to reduce scalding risk.
Mistakes to avoid
- Turning the power on before the tank is full. A.O. Smith says this burns out the upper element.
- Running the relief discharge into the drain pan, or capping it. Both are prohibited in the manual.
- Skipping the expansion tank. A closed system with a check valve or pressure-reducing valve needs somewhere for heated water to expand.
- Reusing an old vent connector that doesn't fit right, or one with a flat section. A.O. Smith specifies at least 1/4 inch per foot of upward slope on horizontal vent runs.
- Ignoring house water pressure. A.O. Smith recommends 50 to 60 psi and notes most codes cap incoming pressure at 80 psi.
Code basics
The manuals point to local codes first, then the national codes where there aren't any: NFPA 54 for gas, and the NEC and the International Plumbing Code for electric units. That's the honest answer to "what's the hot water tank installation code": it's whatever your town adopted, plus the manufacturer's instructions. Your building department can tell you which edition applies and whether you need a seismic strap, a pan or a raised stand.
Tankless, recirculation pumps and condensate
Tankless installs are a different job. The heater needs its own gas sizing, venting, water shutoffs and service valves, and A.O. Smith's manual specifies a full-port manual gas shutoff and a cold-water shutoff at the unit. Condensing units also produce condensate that has to be piped to a drain, and many installers add a neutralizer cartridge. Follow the manual and local code on that.
Recirculation pumps from Grundfos, Watts, Taco and others mount either at the heater or under the farthest sink, depending on the kit. They're usually a simpler job than the heater itself. See hot water recirculation pumps for which type fits your house.
When it's a pro job
Call a licensed plumber when you're changing fuel, adding gas pipe, moving the heater, changing venting, or upsizing enough to need a new circuit. HomeGuide puts standard tank labor at $200 to $1,000, and a whole installed standard tank at $600 to $3,100. Fixr's range for installation labor alone is $300 to $1,500. For full price breakdowns, see water heater installation cost.
FAQ
Do you need a plumber to install a water heater?
Not always, but often. Many areas let homeowners do their own work with a permit, while some require a licensed plumber for gas lines. A.O. Smith recommends a qualified installer, and some warranties depend on it.
How long does it take to install a water heater?
HomeGuide puts a tank install at 2 to 6 hours for a pro, and up to 10 hours for a new tankless installation. A first-time DIY swap takes longer.
How much does it cost to have a water heater installed?
HomeGuide's 2026 range is $600 to $3,100 for a standard tank and $1,400 to $5,600 for tankless, installed. Permits, venting, gas line work and haul-away move the price.
What wiring code is required for an electric water heater?
The NEC and your local electrical code apply. The heater's data plate tells you the voltage and wattage, and the circuit has to be sized to match. Have a licensed electrician confirm the breaker and wire size.
How do I install an expansion tank on a water heater?
It goes on the cold supply line near the heater. Pre-charge it with air to match your incoming water pressure before you install it, as A.O. Smith's manual specifies. See water heater expansion tanks for sizing.
Sources
- A. O. SmithProLine Standard Atmospheric Vent Gas Water Heater Manual (100263112) (opens in a new tab)
- A. O. SmithProLine Electric Water Heater Manual (100309797) (opens in a new tab)
- HomeGuideHow Much Does Water Heater Installation Cost? (2026) (opens in a new tab)
- A. O. SmithAdapt+ Premium Condensing Tankless Water Heater Manual (2000628591) (opens in a new tab)
- FixrWater Heater Installation Cost (opens in a new tab)