It depends on where you're hiking. Where I live, there are rules about camping on state and federal land. If you're on an established trail that allows camping, there are usually set camp sites along the way. Find a guide book or website with info about the trail, and see what it says.