Fitting a water heater is mostly about the conditions around it. The tank is a box with two pipes, a flue and a power or gas connection; the decisions that make it work are sizing, venting, supply and the code items that go with a permit.
Sizing the unit to the demand
Volume in gallons is the number people compare, but the useful figure is recovery: how much hot water the unit can deliver in the first hour. A household with two bathrooms, a large tub and a busy morning needs more than a smaller household with the same tank size implies.
Running out of hot water with a correctly sized tank usually points at a failed element, a broken dip tube or a sediment layer, not at the size. Replacing a 50-gallon unit with a 75-gallon one to fix a symptom is an expensive way to avoid a diagnosis.
Venting and combustion air
Gas water heaters need a vent that drafts correctly, with the right material and clearance to combustibles. A new unit may call for a different vent category than the one in the wall, particularly when efficiency changes. Where several appliances share a flue, the interaction matters as much as the individual appliance.
Electric units avoid venting, which is one reason they appear in closets and basements where gas is impractical. The trade-off is recovery speed and the electrical capacity the building needs.
Gas supply and electrical capacity
A gas line that fed the old burner may be too small for a larger or tankless replacement. Gas sizing is about pressure and volume, so a unit that lights and runs on a line that is marginal will show it under load.
On the electrical side, an electric tankless unit can draw a load that the existing panel and service cannot carry. That is settled before purchase, not after the box is opened.
The permit, the straps and the inspection
California treats water heater installation as permit work. The permit is issued by the local building department and the inspection checks what a casual installation skips: seismic strapping, vent clearances, the relief valve discharge path and combustion air.
Section 507.2 of the California Plumbing Code requires the tank to be braced or strapped, with two straps on a tank up to 52 gallons and the lower strap at least four inches above the controls. Local handouts add detail on garage protection and platform anchoring. None of it is optional, and all of it applies to a replacement as much as to a first installation.
After the work
A new installation is not finished at the last connection. The unit needs filling, air purging, a leak check at every joint, a temperature setting, and a test of the relief valve. Where a permit applies, the inspection closes the loop.
The replacement page covers the like-for-like case; tankless covers the conversion, where gas and venting change most. Installation is offered across the covered places.