By the end of this tutorial you'll have a Valheim dedicated server running around the clock, with its own world, a password, an admin list, and a backup routine so you never lose progress. It's written for anyone who wants a server that stays online when nobody is logged in, whether that's on a home machine, a rented VPS, or a panel host. You don't need to be a Linux wizard, but you should be comfortable copying commands into a terminal.
Why a dedicated server instead of host-and-play
When one player hosts from inside the game, the world only exists while that person is online. The moment they quit, everyone gets kicked. A dedicated server fixes that. It runs as its own program, keeps the world loaded all the time, and lets people drop in and out whenever they want. Your bonfires keep burning and your tamed boars keep breeding even at 3am.
The trade-off is that you manage it yourself. That's what the rest of this guide is for.
What the server actually needs
Valheim is friendlier on hardware than a lot of survival games, but it's not free. The server is single-threaded for most of its heavy work, so a fast CPU core matters more than a high core count. Here's a sensible baseline for a small group.
| Players | RAM | CPU | Disk |
|---|---|---|---|
| 1 to 4 | 2 to 4 GB | 2 fast cores | 3 GB free |
| 5 to 10 | 4 to 8 GB | 3 to 4 fast cores | 5 GB free |
RAM use climbs as your world gets explored and as more players spread out across the map, because the server keeps loaded zones in memory. Eight GB is plenty for almost any private group. The disk number leaves room for the game files plus a growing world and several backups.
Step 1: Install SteamCMD
SteamCMD is the command-line tool that downloads dedicated server files from Steam. You don't need a paid copy of Valheim on the account you use here, since the dedicated server is free to download. These instructions assume Ubuntu or Debian. If you're on a managed game panel, you can usually skip straight to the start parameters in Step 3, because the panel handles the install for you.
First, enable the 32-bit architecture that SteamCMD expects and install it.
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository -y multiverse
sudo apt update
sudo apt install -y steamcmd
During install you'll be asked to accept the Steam license. Use the arrow keys and Tab to select I AGREE, then press Enter. If the steamcmd package isn't found, you can grab the tarball directly instead.
sudo apt install -y lib32gcc-s1 curl
mkdir -p ~/steamcmd
cd ~/steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
That second method drops a steamcmd.sh script in the folder you're sitting in.
Step 2: Download the Valheim server files
The Valheim dedicated server has the Steam app ID 896660. Run SteamCMD, log in anonymously, point it at an install directory, and tell it to download that app.
steamcmd +force_install_dir ~/valheim-server +login anonymous +app_update 896660 validate +quit
If you used the tarball method, call the script instead.
~/steamcmd/steamcmd.sh +force_install_dir ~/valheim-server +login anonymous +app_update 896660 validate +quit
This pulls down roughly 1 to 2 GB. When it finishes you'll see a line like Success! App '896660' fully installed. and your ~/valheim-server folder will contain valheim_server.x86_64 along with a sample start script called start_server.sh.
Step 3: Set your start parameters
The sample start_server.sh is a fine starting point, but you'll want your own values. Open it in a text editor.
nano ~/valheim-server/start_server.sh
Here's a clean version you can paste in. Replace the name, world, and password with your own.
#!/bin/bash
export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970./valheim_server.x86_64 \
-name "Valheim with the crew" \
-port 2456 \
-world "Midgard" \
-password "ironbark42" \
-crossplay \
-savedir "/home/steam/.config/unity3d/IronGate/Valheim" \
-public 1
export LD_LIBRARY_PATH=$templdpath
Let's go through the flags so you know what each one does.
- -name is the label that shows up in the server browser. It does not have to match the world name.
- -port 2456 is the game port. Valheim also uses the next port up (2457) automatically, so leave a gap if you run more than one server on the same box.
- -world "Midgard" is the internal world file name. If a world with that name doesn't exist yet, the server creates a fresh one. If it does exist, it loads it.
- -password "ironbark42" must be at least 5 characters and cannot be part of the server name. Skip this only if you really want an open server.
- -crossplay turns on the PlayFab network so Xbox and PC players can join the same server. More on this below.
- -savedir sets where world files and configs live. Setting it explicitly makes backups predictable.
- -public 1 lists the server in the community browser. Set it to
0to hide it so people can only join by IP.
Note the SteamAppId=892970 line. That's the ID of the base Valheim game, and the server needs it set to start, which is separate from the 896660 download ID. Save and exit nano with Ctrl+O, Enter, then Ctrl+X. Make the script executable.
chmod +x ~/valheim-server/start_server.sh
Step 4: Open the right ports
Valheim talks over UDP, not TCP. This trips a lot of people up. You need to open 2456 to 2457 on UDP. If you turned on crossplay, that traffic uses Microsoft's PlayFab relay and doesn't need extra inbound ports, but the two UDP ports are still required for the Steam side.
If you use UFW, the firewall on many Ubuntu boxes, the rules look like this.
sudo ufw allow 2456:2457/udp
sudo ufw reload
sudo ufw status
The status output should show your range as allowed.
To Action From
-- ------ ----
2456:2457/udp ALLOW Anywhere
If your server sits behind a home router, you also need to forward UDP 2456 to 2457 to the machine's local IP in the router admin page. On a VPS or panel host, the provider's firewall is what matters, so add the rule there too. A common mistake is opening the ports on TCP. That won't work, so double-check you picked UDP.
Step 5: Run the server
Start it directly first, just to confirm it boots.
cd ~/valheim-server./start_server.sh
You'll see a stream of log lines. The ones that tell you it's healthy are the Steam connection and the world load.
Loading world: Midgard
World loaded ( 0.342s )
Game server connected
Steam manager initialized
DungeonDB Start 13234
Once you see Game server connected, the server is live. Press Ctrl+C to stop it for now, because running it directly in your terminal means it dies when you log out. We'll fix that next.
Step 6: Keep it running with systemd
To make the server start on boot and restart if it crashes, set up a systemd service. Create the unit file.
sudo nano /etc/systemd/system/valheim.service
Paste this in, adjusting the user and paths if yours differ.
[Unit]
Description=Valheim Dedicated Server
After=network.target
[Service]
Type=simple
User=steam
WorkingDirectory=/home/steam/valheim-server
ExecStart=/home/steam/valheim-server/start_server.sh
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Reload systemd, enable the service so it survives reboots, and start it.
sudo systemctl daemon-reload
sudo systemctl enable valheim
sudo systemctl start valheim
Check that it came up cleanly and watch the live log.
sudo systemctl status valheim
sudo journalctl -u valheim -f
The -f flag follows the log in real time, which is handy while people are connecting. Press Ctrl+C to stop following (this does not stop the server).
Step 7: Set up admins and a permitted list
Valheim uses three plain text files for access control. They live in the same folder as your worlds, which is the -savedir path from Step 3. The files are adminlist.txt, permittedlist.txt, and bannedlist.txt. Each takes one Steam ID (or PlayFab ID for crossplay players) per line.
cd /home/steam/.config/unity3d/IronGate/Valheim
nano adminlist.txt
Add your IDs, one per line.
76561198000000000
76561198111111111
Admins can use in-game commands like kicking players, banning, and toggling no-cost build mode by pressing F5 to open the console. The permittedlist.txt file is a whitelist. Leave it empty and anyone with the password can join. Put IDs in it and only those players are allowed, which is great for a strict private group. The bannedlist.txt file does the opposite and blocks the IDs you list.
You can find a player's Steam ID by having them check their profile URL or a lookup site. After editing any of these files, the server picks up changes within a short delay, but restarting the service guarantees it.
sudo systemctl restart valheim
Step 8: Connect and a quick note on crossplay
In Valheim, open the menu, pick Join Game, then the Community tab to find a public server by name, or the Join IP button to type your server's address as your.ip.address:2456. Enter the password when prompted.
The -crossplay flag matters here. With it on, your server registers on the crossplay network and shows up in the Crossplay list, so Xbox and Microsoft Store players can join alongside Steam players. With it off, the server only appears on the Steam network. You can't mix the two browsers, so decide based on who you're playing with. If your group is all on Steam, leaving crossplay off can make the server easier to find by IP.
Step 9: Back up your worlds
Worlds are precious and corruption does happen, usually from a hard crash mid-save. Each world is stored as a pair of files in the save directory: a .db file (the actual world data) and a .fwl file (the metadata and seed). For a world named Midgard you'll have Midgard.db and Midgard.fwl, plus .old copies the game keeps as a safety net.
A simple nightly backup script does the job. Create it.
nano ~/backup-valheim.sh
#!/bin/bash
SAVE_DIR="/home/steam/.config/unity3d/IronGate/Valheim/worlds_local"
DEST="/home/steam/valheim-backups"
STAMP=$(date +%Y-%m-%d_%H-%M)
mkdir -p "$DEST"
tar -czf "$DEST/valheim_$STAMP.tar.gz" -C "$SAVE_DIR".
# keep only the 14 most recent backups
ls -1t "$DEST"/valheim_*.tar.gz | tail -n +15 | xargs -r rm
Make it executable and schedule it with cron to run every night at 4am.
chmod +x ~/backup-valheim.sh
crontab -e
Add this line at the bottom.
0 4 * * * /home/steam/backup-valheim.sh
Now you'll always have the last two weeks of saves. To restore, stop the server, extract the archive back over the worlds_local folder, and start it again. Test a restore once before you need it for real, so you know the process works.
Troubleshooting
The server doesn't show up in the browser. This is the most common complaint. First confirm -public 1 is set. Then check you're looking at the right list, Community for Steam-only and Crossplay for crossplay servers. The community browser can also take a few minutes to register a new server, so give it time. If you still can't see it, join by IP to prove the server itself is reachable, then treat the browser issue as separate.
"Password is too short" or the server refuses to start. The password must be at least 5 characters and cannot appear inside the server name. So if your server is named "ironbark camp" you can't use "ironbark" as the password. Pick something unrelated and at least 5 characters long.
Players can't connect at all. Nine times out of ten this is the ports. Confirm you opened UDP, not TCP, on 2456 to 2457. From another machine you can test reachability, but remember UDP doesn't respond to a normal port scan the way TCP does, so the real test is just trying to join. If you're behind a home router, verify the port forward points at the machine's current local IP, which can change if you didn't set a static lease.
The world didn't load and a new one appeared. The -world name is case sensitive and must match the existing .fwl and .db files exactly. A typo makes the server create a brand new world instead of loading yours. Stop the server, check the filenames in worlds_local, and fix the name in your start script.
The service keeps restarting. Read the log with sudo journalctl -u valheim -e and look near the bottom. A missing SteamAppId, a wrong path in the service file, or a permissions problem on the save directory are the usual causes. Make sure the User in the unit file actually owns the server and save folders.
Out of memory or sudden lag. If the box runs low on RAM as the map gets explored, free some up or move to a machine with more memory. A large explored world plus several players spread out is the heaviest case. Watch usage with free -h while people play.
Wrapping up
You now have a Valheim server that survives reboots, restarts itself on a crash, controls who can join, and backs up its worlds automatically. The pieces that catch people out are almost always the UDP ports and the password rules, so if something goes wrong, start there. From here you can tune the world modifiers in-game, add more admins, or move the whole thing to a beefier host as your group grows. If you'd rather skip the setup entirely, a managed game host like Bytte.cloud gives you the same control panel, ports, and backups without touching SteamCMD yourself. Either way, build something worth defending.



