Though the origin of the tune is uncertain, it may have origins as early as early as the 16th Century in a tune called “The Unfortunate Rake.” It’s been interpreted many times, famously but Woodie Guthrie and the Animals.
A good wikipedia article has been developed about this traditional song. https://en.wikipedia.org/wiki/The_House_of_the_Rising_Sun