I have just purchased a house in El Paso, Tx that was build in the 1940's. I am redoing the house completely. I have noticed, by removing all flooring and noticing many water stains, that the hot water heater has been moved many time throughout the life of the house. Now I'm looking to do it once more. There is a "shed" type building attached to the house but still outside of the house (only accessible by going outside.) My question is can a hot water heater be located in this "shed" type building and be in "code?"

Just FYI the plumbing would be easy due to the house having a crawlspace under the house and the "shed" type structure has easy access to the crawlspace.

Please let me know what you think.

First time post. Thanks for the chance.