Valheim can be played solo, and it's always a pleasant experience on your solitaire.
It might be best to play Valheim with a friend or two by your side, but you are totally free to enter Vanheim on your own if you prefer to play solo. You can even play offline if you want: Valheim doesn't require you to be connected to the internet. Every time you create a world in Valheim it gets saved to your machine and to the Steam Cloud, so if you log out you just lose cloud saves.
The advantage of the Valheims server structure is that it functions as an "Opt-in / Opt-out" toggle in the World Select menu. with friends, you can toggle the “Server” option to bring your world online. You can even enter world-generating seeds manually, so if you find a good starting world you can breed it yourself (which you can do here)!
As for the actual gameplay, playing Valheim is perfectly fine as a single player experience. Hel, this is how I mainly play the game. Of course having a few Viking friends with you for the ride makes it a bit easier as you will have more hands available to harvest, build and fight, but health and Enemy damage will vary depending on the number of players in a world, so only your harvesting and building will take longer. Honestly, the game feels well balanced even at this early access stage. It may take you longer to build a giant colony when playing Valheim solo, but it doesn't sound like too much of a slog.
So, yes, you can totally play Valheim solo, to include it offline. If you ever want to bring your world online, you can, and your character is persistent on servers (although it may be best to start a new one if you decide to join someone else's server for avoid losing what your main character is holding at the time.). Don't be afraid to jump into a different server by the way: PvP is off by default, and player damage activation has to be done manually by each player who wants to participate. THAT IS TO SAY. Enjoy your game solo, but you don't have to fear strangers in Valheim.
-