From this page of the Valheim game guide, you will learn how to build a base camp off your home island.
In the early stages of the game, you will spend most of your time on your starting island. The size and biomes found on this island differ depending on the random seed. However, you are guaranteed to get Meadows, which is the safest area of all. Considering the amount of time you will spend in this location, it will involuntarily become your operations center and most likely your main base.
At some point you will have to leave the first island and travel to other locations. These expeditions are risky - if you don't have a bow as you encounter a serpent on your rafting journey, you will meet a tragic end. Additionally, if you arrive at the shore of a new island and die there, you will reappear at the original respawn point. Therefore, it is a good idea to build a small base camp as soon as you come ashore. A makeshift settlement like this should consist of a roofed house with a campfire, a bed, a workbench, and at least one chest.
The advancement level of this base is largely dependant on the biome. If you choose to settle in the meadows again, then the simplest building without fencing will suffice. If you like, you can also surround it with a palisade for safety reasons.
If you choose to build a base in one of the more dangerous biomes, such as the mountains, then you need to ensure that it is properly defended. Most importantly, you will have to surround it with a palisade to shield it from the outside world. Of course, such a barricade does not guarantee 100% safety, because it can be destroyed. To add defensibility to the palisade, attach some flooring to function as a shooting position.
To further enhance security, sharp stakes can also be erected. These spiky sticks will deal damage to anyone who bumps into them (including you). However, you need to remember that they can also become damaged and, consequently, require repairing.