How to Set Up a Valheim Dedicated Server
Keep your Viking world alive 24/7. Install a Valheim dedicated server on Linux with SteamCMD, set a password and open the UDP ports.
Valheim is far better with a dedicated server: your world stays alive even when the host logs off, progress is shared, and everyone gets consistent performance. Here's how to run one on a Linux VPS using SteamCMD.
Sizing your server
Valheim's world simulation is CPU-bound and grows with base size and player count:
- 2 players: 2 GB RAM, 2 vCPU.
- 4–6 players: 4 GB RAM, 2–4 vCPU.
- 10 players / big bases: 6–8 GB RAM and fast cores.
Single-core speed matters more than core count, because much of Valheim's simulation runs on one thread.
Step 1: Install SteamCMD
SteamCMD is Valve's command-line tool for downloading dedicated servers. Enable the multiverse repo and install it:
sudo add-apt-repository multiverse -y
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install steamcmd screen -y
Step 2: Create a user and download the server
sudo adduser --disabled-password valheim
sudo su - valheim
steamcmd +force_install_dir ./valheim-server +login anonymous +app_update 896660 validate +quit
App ID 896660 is the Valheim dedicated server. This pulls a few hundred MB.
Step 3: Create a start script
Inside valheim-server, make start.sh:
#!/bin/bash
export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970
./valheim_server.x86_64 -name "My Viking Server" -port 2456 -world "Midgard" -password "changeme123" -crossplay
export LD_LIBRARY_PATH=$templdpath
Make it executable with chmod +x start.sh. The password must be at least 5 characters and cannot appear in the server name.
Step 4: Launch inside screen
screen -S valheim
./start.sh
Detach with Ctrl+A then D. First launch generates the world, which takes a minute or two.
Step 5: Open the ports
Valheim uses UDP ports 2456, 2457 and 2458:
sudo ufw allow 2456:2458/udp
Step 6: Join
In game, open the console (F5) and use connect IP:2456, or add the server under Join Game → Add Server. Enter the password you set and you're in.
Keeping the world safe
Your world lives in ~/.config/unity3d/IronGate/Valheim/worlds_local/. Back up both the .db and .fwl files — the .db is your actual world and the .fwl holds its seed and metadata:
cp ~/.config/unity3d/IronGate/Valheim/worlds_local/Midgard.* ~/backups/
Automate that with a cron job before each nightly restart.
Mods and BepInEx
For mods, install the BepInEx framework and Thunderstore mods on both the server and every client — mismatched mod lists cause connection failures. Keep a text list of exactly which mods and versions you run so players can match it.
World modifiers and admin control
Modern Valheim lets you tune difficulty without mods using world modifiers. Pass them as launch arguments to set combat difficulty, resource rates, raids and portal rules server-wide — for example -modifier combat hard or -modifier resources more. This is the cleanest way to shape the experience for your group.
For moderation, add each player's Steam ID to adminlist.txt in the server's save folder. Admins can then open the in-game console and use commands like kick, ban and save. Keep a matching permittedlist.txt if you want an invite-only server that ignores the join password entirely.
Common issues
- Password rejected: it must be at least 5 characters and cannot be a substring of the server name.
- Server not in the list: make sure you launched with
-crossplay(for the Xbox/PC list) or the community browser, and that UDP 2456–2458 are open. - World won't load after an update: a mod is out of date — update BepInEx and every plugin, and restore your
.db/.fwlbackup if needed.
The easy route
Valheim's single-threaded simulation punishes slow CPUs, so fast cores and NVMe storage make a real difference on large bases. Nxeon's VPS gives you both plus full root for BepInEx and cron backups, and a one-click Valheim deploy skips the SteamCMD steps entirely if you'd rather just start raiding.