In most regions, government legislation requires that you obtain a permit before installing or replacing an existing gas heater unit. Call your local city or county building department prior to purchasing a unit so that you're aware of the rules and regulations. Additionally, inquire about any mandatory inspections because these are typically required once a new unit is installed or replaced.
Location is an important factor that you have to consider when installing or replacing a gas heater unit. There are explicit guidelines that you must follow regarding your unit's location. For example, outdoor combustion air chambers are necessary for units that are installed indoors. Others sit in enclosed outdoor areas and there are regulations that specifically pertain to those confined spaces.
Small, closet-like areas normally house water heaters and there are certain requirements that pertain to confined spaces. Proper vents and connectors are compulsory.
In regions where earthquakes are common, legislation typically requires that you install earthquake straps around your water heater. You'll have to place the straps at approved points and an inspector will likely examine the straps to ensure they are properly placed around the unit at the time of an inspection.
In many regions, pipe insulation is required to keep the channels from freezing in the winter. A cold-water shut off valve is also mandatory as is a pressure and temperature relief valve. Most installed units will already have these in place and function according to the manufacturer's specifications.