HostingRunning a dedicated server
Free with the game · Windows or Linux · home machine or rented hostA dedicated server keeps your world online around the clock, so friends play without the host being logged in. The server software is free: it ships with the game as "Valheim Dedicated Server" under Tools in your Steam library, and it runs on Windows or Linux, on a spare machine at home or a rented host. Worth knowing before you start: the world only advances while someone is online, and cheat commands are disabled on dedicated servers entirely.
Install the tool, then open its folder and copy start_headless_server.bat (or the .sh on Linux) and edit the copy. Three arguments matter: -name is what the server list shows, -world names the world file, and -password needs at least five characters and cannot appear in the server name. Forward UDP ports 2456 and 2457 to the machine in your router, let the executable through the firewall, and start the script. Friends join through the community server list or with your IP and port 2456 under Join by IP.
Next to the world files you will find adminlist.txt, bannedlist.txt and permittedlist.txt. One player ID per line; a filled permitted list turns the server whitelist-only. Admins get the admin commands (kick, ban, save) but not cheats. To move your existing co-op world onto the server, copy its .db and .fwl files from your local worlds_local folder (under AppData\LocalLow\IronGate\Valheim on Windows) into the same folder on the server and point -world at its name.
By default a dedicated server talks Steam networking only. Add the -crossplay flag to the start script and it switches to the cross-platform backend so Xbox and Game Pass players can join too, which will matter even more when the PS5 and Switch 2 versions land with 1.0. The full platform picture is in the crossplay guide. If the server refuses to appear in the list, it is almost always one of three things: the password rule, the ports not actually forwarded, or the firewall eating UDP.