You can legally build a treehouse on your private land in most areas. To do so, you will likely need a building permit from the city. Plus, you must abide by local codes, including setback requirements. Working with a contractor on your treehouse construction can ensure everything is done with safety in mind.