How to Make a Valheim Dedicated Server on Your PC (Free, with Steam)
Valheim's dedicated server is free and comes with Steam. It installs in two clicks, you configure it by changing one line in a file and, with crossplay, you don't even have to open ports. The hard part is keeping that PC on.
What you need
A Windows or Linux PC that stays on for as long as you want to play, with plenty of memory: for a group of friends without mods, about 4 GB for the server, on top of what the game uses if you play on the same PC (how much RAM depending on the world and mods). And a connection with good upload speed: the server sends the world to everyone.
On Linux, the official manual also asks for the libatomic1, libpulse-dev and libpulse0 packages.
Rather not set it up yourself? Valheim servers from €8 a month, no contract and a full refund within 72 hours. Or create a free Valheim server, no card needed.
Installing Valheim Dedicated Server
If you have Valheim from the Microsoft Store, the server comes with the game, in C:\XboxGames\Valheim\Content\Server, and you start it with StartHeadlessServer.bat.
Show tools in Steam
In the library, in the dropdown at the top left, tick “Tools”.
Install it
Search for “Valheim Dedicated Server” and install it. It's free.
Open its folder
Right-click → “Manage” → “Browse local files”.
Configuring startup
Everything is configured in one line of start_headless_server.bat (on Linux, start_server.sh): the one that begins with start valheim_server. Make a copy of the file first and edit the copy: Steam rewrites the original on every update. The catch is that the copy isn't launched from Steam, but with a double-click.
What you change on that line: -name, the name in the list; -port, the port (2456 if you leave it alone); -world, the world it loads, which is created if it doesn't exist; -password, the password; -public 1 or 0, to show up in the list or not; and -crossplay, for crossplay. Backups are set with -saveinterval (1800 seconds by default), -backups, -backupshort and -backuplong. On the same line go, if you want them, the world modifiers (difficulty, portals, map...).
start valheim_server -nographics -batchmode -name "Ana's Vikings" -port 2456 -world "Vikings" -password "mead42" -public 1 -crossplayStarting it, checking it and stopping it
Start your copy
Double-click your .bat. If Windows asks about the firewall, tick every box.
Wait for the message
When the window says “Game server connected”, the server is ready.
Stop it with Ctrl+C
In its window, never with the X: the official manual warns that with the X it can keep running in the background.
Letting your friends in
With -crossplay there's no need to open ports: your friends join with your public IP and the port, or with the code that appears in the pause menu when you're inside. You, from the same PC or the same house, join with the code: with crossplay the local IP doesn't work.
Without -crossplay, only Steam players can join and you have to forward UDP 2456 and 2457 on your router to your PC. If it's just for your household, -public 0 and joining with the local IP also works. It's all in Valheim ports: what to open and when you don't need to.
Your world and your admins
The server saves worlds in the same folder as the game: on Windows, %USERPROFILE%\AppData\LocalLow\IronGate\Valheim, in worlds_local. If the server is on the PC you play on, to use your world you just put its exact name in -world. If it's in the Steam Cloud, move it to local first from the game's manage saves menu. If the server runs on another PC, this is how you move the world.
That same folder holds adminlist.txt, bannedlist.txt and permittedlist.txt, with one player ID per line: how to use them, in running a Valheim server.
The downsides of hosting at home
If the PC shuts down, goes to sleep or Windows restarts to update, the game is over for everyone. The electricity of a PC running for many hours shows up on the bill. And your upload speed delivers the world to everyone.
If you play on the same PC as the server, keep the server on 1.0.20 or later: before that, with vertical sync turned on in the game, the server could eat CPU without limit.
If you'd rather not keep a PC on
On NapNodes there's a free Valheim server, no card needed: you start it from the panel when you want to play and it stops on its own when nobody's on. And plans to keep it always on, with daily backups. The settings are the same as in this guide, but in “Settings”, without touching files.
Frequently asked questions
Is the Valheim dedicated server free?
Yes. “Valheim Dedicated Server” is in the Steam library, under “Tools”, at no cost. On the Microsoft Store it comes inside the game.
Can I play on the same PC where I host the server?
Yes, if it has memory to spare. With crossplay, join with the code: you can't with the local IP.
How do I stop the Valheim server without losing progress?
With Ctrl+C in its window. That way it saves the world before closing; with the X it can keep running in the background.
Why does my Valheim server close on startup?
The most common cause is the password: on a public server, Valheim requires at least 5 characters not contained in the world name. The other causes are in my Valheim server won't start.
Where does the Valheim dedicated server save worlds?
On Windows, in %USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worlds_local; on Linux, in ~/.config/unity3d/IronGate/Valheim. You change it with -savedir.
Shall we set it up for you?
Valheim servers from €8 a month, never oversold: your RAM is yours alone. And if you'd rather start without paying, there's a free Valheim server, no card needed.
Not sure whether your server is online? Check it in a second with the Valheim server status checker: players, version and password, free.
Free tool: Is my port open?. Check from the internet whether your home server's port is open (Minecraft, Valheim, Zomboid) and whether your ISP uses CG-NAT.
Free tool: What does it cost in electricity?. What it costs in electricity to keep the server running on your PC at home, side by side with a plan and the free server.
Keep reading
- Valheim Server Ports: What to Open (2456 and 2457 UDP) and When You Don't Need To
Which ports a Valheim server uses, how to forward them on your router, why crossplay doesn't need them and what to do if it doesn't show in the list.
- Valheim With Xbox, PlayStation 5, Switch 2 and Steam on the Same Server (Crossplay)
Valheim with friends on Xbox, PlayStation 5, Switch 2 and PC on a dedicated server: the 1.0 crossplay, the join code and the limit on mods.
- Valheim Server Not Starting: Errors and Fixes
Why a Valheim server closes on startup or loads an empty world: password, world name, ports, BepInEx mods, old worlds and disk space.