How to Install a Water Heater
How to install a water heater, in short: drain and disconnect the old unit, set the new tank in place, hook up the water lines, connect the gas or power, run the relief valve discharge somewhere safe, and fill the tank to the top before the heat goes on. Swapping an electric tank for the same kind is fair game for a handy homeowner. Gas work, venting, and any change of fuel or size are usually a licensed plumber's territory, and most places want a permit no matter who does it.
DIY or pro? A quick check - Electric tank, same size, same place: a reasonable DIY job if you're handy, can get a permit and have someone to help lift. - Swapping a gas tank: DIY only where your town allows homeowners to do gas work. Touching the gas line or the vent turns it into a plumber's job. - New gas piping, new venting or a new spot: hire a licensed plumber. - Tankless, or switching from a tank to tankless: plan on a pro. It has its own gas sizing, venting and shutoffs. - Your town gives permits only to licensed plumbers: then you don't have a choice. - Your skills and tools: if you've never soldered copper, made up a gas joint or tested a circuit, the money you save drops quickly.
Is this a DIY job for you?
Think hard about three things first.
One is the permit. HomeGuide prices a water heater permit at $50 to $200, and the manuals say to follow state and local codes and get the work inspected. Ask your local building department. Some of them let only licensed plumbers take out a permit for gas work.
Another is the time and the weight. Swapping a tank takes a pro 2 to 6 hours. For your first one, set aside the whole day and expect one more run to the store.
The last is the warranty. Some makers only honor coverage when a qualified installer does the work. A.O. Smith's tankless manual says the warranty is void if not. Read the terms on yours before you buy.
If you'd rather hire it out, the guides for each type explain what a proper job looks like: installing a gas water heater, installing an electric water heater, installing a heat pump water heater and installing a tankless water heater.
Pro installation prices
For comparing DIY with hiring a pro, these are Fixr's 2026 ranges for the installed price:
| Type of job | Installed price |
|---|---|
| Gas tank | $700 to $2,700 |
| Electric tank | $500 to $3,500 |
| Tankless | $1,000 to $4,000 |
| 50-gallon electric tank | $700 to $1,900 |
| 50-gallon gas or propane tank | $900 to $2,500 |
Add-ons that often appear on the estimate:
- Permit and inspection: anywhere from $25 to $1,500, by town.
- Hauling off the old tank: typically $50 to $150.
- Expansion tank: about $150 to $400 more on average.
- Power venting: $300 to $1,000, with the electrical hookup included.
- A new location rather than a straight swap: $400 to $1,800 to run the utilities.
- Bringing an old install up to code: this can tack on several hundred dollars.
The labor by itself costs $300 to $1,500, with plumbers billing $45 to $200 per hour. The detailed numbers are in what it costs to replace a water heater, what tankless installation costs and installation prices at Home Depot vs Lowe's.
Tools and parts
- A garden hose to drain with, plus a bucket and some towels
- Pipe wrenches, an adjustable wrench and a tubing cutter
- Flexible water connectors, or copper pipe and fittings with dielectric unions on copper lines
- A new T&P relief valve if the heater doesn't come with one, and copper or CPVC pipe for the discharge
- A metal or plastic drain pan that fits the new tank
- A thermal expansion tank, if your system calls for one
- For gas: pipe dope or yellow gas tape, a sediment trap, a union, and soapy water to check for leaks
- For electric: a non-contact voltage tester and a multimeter
- An appliance dolly and a helper
Step by step: tank water heater
Cut off the fuel. On gas, turn the valve at the heater to off; on electric, switch off the breaker and prove the circuit is dead with a tester.
Close the cold supply to the heater, then open a hot tap on an upper floor so air can get in.
Empty the old tank through its drain valve into a floor drain or out the door. Those valves are plastic on most tanks and crack if you force them, so turn yours slowly. The guide on how to drain a water heater helps if it drains slowly or clogs.
Disconnect the water lines first, then the gas line or the wiring, and on a gas unit the vent connector.
Take the old tank out and stand the new one in a pan on level ground, leaving the service access open. For its gas tanks, A.O. Smith calls for no less than 24 inches of clearance in front.
Run cold to the inlet and hot to the outlet. Leave the factory heat traps in, and never solder pipe that's connected to the heater.
Fit the T&P relief valve and run its discharge line. A.O. Smith's manual calls for pipe of at least 3/4-inch inside diameter, sloped so it drains, ending six inches or less above a floor drain or outdoors, with no valve, cap or reducer along the way.
Put in an expansion tank if your system needs one. Per A.O. Smith, codes in nearly every home call for a thermal expansion tank that is pressurized and sized correctly.
Hook up the gas or the power. A gas unit needs a manual shutoff and a sediment trap, plus a soapy-water leak test. An electric unit needs wiring that matches its data plate.
Fill the tank. With the cold supply and a hot tap open, let water run at full flow for three full minutes before lighting the burner or switching on the breaker.
Light the pilot or turn the power back on, set the thermostat, and go over each joint for leaks. A.O. Smith sets its heaters at the factory to about 120°F to lower the risk of scalding.
Mistakes people make
- Switching on the power with the tank partly empty. A.O. Smith says that burns out the upper element.
- Capping the relief discharge or ending it in the drain pan. The manual forbids both.
- Leaving out the expansion tank. When a check valve or pressure-reducing valve closes off the system, heated water needs room to expand.
- Putting back an old vent connector that fits poorly or has a level stretch. A.O. Smith calls for horizontal vent runs to rise at least 1/4 inch per foot.
- Not checking the house water pressure. A.O. Smith recommends 50 to 60 psi and notes that most codes limit incoming pressure to 80 psi.
The code, briefly
The manuals send you to local codes first, and to the national codes where no local one exists: NFPA 54 for gas, and the NEC plus the International Plumbing Code for electric models. So the real answer to "what's the hot water tank installation code" is whatever your town has adopted, along with the maker's instructions. The building department will tell you which edition is in force and whether you need a seismic strap, a drain pan or a raised stand.
Tankless, recirculation pumps and condensate
Putting in a tankless heater is its own kind of job. It needs separate gas sizing, venting, water shutoffs and service valves, and A.O. Smith's manual calls for a full-port manual gas shutoff and a cold-water shutoff right at the unit. A condensing unit also makes condensate that must be piped to a drain, and plenty of installers add a neutralizer cartridge. Go by the manual and your local code there.
Recirculation pumps from makers like Grundfos, Watts and Taco go either at the heater or under the sink farthest away, depending on the kit. Fitting one is usually easier than installing the heater. The page on hot water recirculation pumps helps you pick the type for your home.
When a licensed plumber should do it
Your state or town sets the plumbing and gas rules, and the manuals put those local codes first. A job that passes inspection in one town can fail in the next, so phone the building department before buying.
- Permit and inspection. Lots of towns require a permit even for a like-for-like swap, and some give gas permits only to licensed plumbers. The manuals assume an inspector will look at the work.
- Gas piping and connections. Running new gas pipe, adding a shutoff valve and fitting the sediment trap the manual asks for all count as gas work. A leak there means fire risk, not a wet floor.
- Venting. A gas tank has to vent with a good draft and have enough combustion air in the space. When a vent spills, it can send carbon monoxide into your home.
- Relief valve discharge. There are rules for the line's size, its material and where it ends, and an inspector will look.
- Expansion tank. Since codes call for a correctly sized expansion tank in nearly all homes, an inspector may want one even on a plain swap.
Get a licensed plumber if you're switching fuel, adding gas pipe, relocating the heater, changing the vent, or going big enough to need a new circuit. HomeGuide prices labor on a standard tank at $200 to $1,000, and a standard tank fully installed at $600 to $3,100. Fixr gives $300 to $1,500 for the installation labor by itself. The whole cost picture is in water heater installation cost.
FAQ
Do you need a plumber to install a water heater?
Often, though not every time. Lots of places allow homeowners to do the work under a permit, and some insist on a licensed plumber for gas lines. A.O. Smith recommends a qualified installer, and certain warranties hinge on that.
How long does it take to install a water heater?
According to HomeGuide, a pro needs 2 to 6 hours for a tank, and as many as 10 hours for a new tankless install. Your first DIY swap will run longer.
How much does it cost to have a water heater installed?
HomeGuide's 2026 figures are $600 to $3,100 installed for a standard tank, and $1,400 to $5,600 installed for tankless. Permits, venting, gas line work and haul-away all shift the total.
What wiring code is required for an electric water heater?
The NEC applies, along with your local electrical code. Read the voltage and wattage off the heater's data plate and size the circuit to suit. A licensed electrician should check the breaker and the wire size.
How do I install an expansion tank on a water heater?
Mount it on the cold supply pipe close to the heater. Before it goes in, set its air pre-charge to match your incoming water pressure, as the A.O. Smith manual directs. The page on water heater expansion tanks covers 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)
- Fixr50-Gallon Water Heater Installation Cost in 2026 (opens in a new tab)