The location of a water heater is always a concern.
Can i put my water heater outside.
Avoid installing it in locations that may subject it to freezing.
Not sure about electrical but i doubt it would be wise to put outside.
Alternatively you can also keep your hot water heater in a shed as long as it s properly ventilated and meets the minimum clearance requirements for distance to combustible material.
This is to protect it from splashed water rain insects direct sunlight and debris.
A tankless water heater is for indoor installation only.
A modest amount of insulation is a plus.
Check with a professional for installation if you re not comfortable.
Many are installed inside a living space and tucked away in a closet.
The lowes home depot even sell metal water heater sheds they are three sided to be placed against the house.
My first house has them outside and they work fine.
You will want to place your water heater next to an outer wall to make room for the flue.
Flexible hoses connecting the rest of the plumbing should resolve any movement concerns.
If you re venting straight up make sure to keep out the rain objects animals etc.
For me i put gas water heaters outside and electric water heaters inside.
Most regulations are fairly simply and require that water heaters be placed against an external wall of the house.
This is why most hot water heaters are in garages or basements.
Often a water heater in a pan or not is out of mind until someone notices water in the hallway damp drywall or a buckling floor outside the water heater closet.
You can also wrap your hot water heater in insulation as well as your pipes for good measure.