Yes a gas water heater can be installed in a closet as long as the closet is not used for storage.
Tankless water heater closet size.
What size tankless water heater depends on your gpm at peak hot water demand.
Having a water heater that is too small will result in it not being able to produce enough hot water for your household demand.
As an example i will show you what came out for me.
Traditional water heaters can take up to 16 square feet of valuable floor space.
Determine the mounting space tankless water heaters are much smaller than units with a storage tank allowing them to be wall mounted.
And your temperature rise which is determined by your incoming water temperature subtracted from your hot water setting.
Therefore to size a demand water heater you need to determine the flow rate and the temperature rise you ll need for its application whole house or a remote application such as just a bathroom in your home.
The international residential code irc specifically bans a storage closet as a location for a gas water heater.
In fact it is the most important part of choosing a new unit for your home.
Electric units have measurements in the 10 inch high to 7 inch.
I live in boston so my groundwater temperature is around 47 f.
Tankless water heaters are rated by the maximum temperature rise possible at a given flow rate.