TL;DR:
- Install SteamCMD and the 3 Ubuntu libraries Iron Gate's guide lists, download Steam app 896660 as an unprivileged user, and run the server as a systemd service.
- Checked against Valheim 1.0.17 (Steam build 25730807, October 6, 2026). The Linux server files take about 2.2 GB on disk.
- The
-crossplayflag lets Steam, Xbox, PlayStation 5, Nintendo Switch 2 and Mac players join by IP address, join code or the server list. - Steam-backend players connect on UDP ports 2456 and 2457. The password needs at least 5 characters and must not appear in the server name.
- Each start archives the world, at most once every 10 minutes, then updates the server through SteamCMD.
- Iron Gate publishes no CPU or RAM figure for the server, and its 1.0 FAQ describes Valheim as a game for 1 to 10 players.
Applies to: Ubuntu 24.04 LTS · Valheim Dedicated Server 1.0.17 · checked October 2026
A Valheim dedicated server is Iron Gate's free server program (Steam app 896660) that hosts a Valheim world without a game client running, so players can join while the host is offline. This tutorial installs it on Ubuntu 24.04 with SteamCMD, runs it under systemd as its own user, and covers launch flags, crossplay for console players, uploading a world from your PC, backups and updates. A VPS keeps the world online when your own PC is off.
Valheim dedicated server requirements
Iron Gate's dedicated server guide and the server files list these facts for the Linux build:
| Resource | Official guidance |
|---|---|
| CPU and RAM | No figure published for the dedicated server |
| Players | 1 to 10 per server (Valheim 1.0 FAQ) |
| Storage | About 2.2 GB of server files, plus the world saves and backups |
| Network | Ports 2456 and 2457 for the Steam backend (Steam networking runs over UDP). The crossplay backend uses a relay server |
| Linux libraries | libatomic1, libpulse-dev and libpulse0; GLIBC 2.29 and GLIBCXX 3.4.26 or newer |
| OS | Linux, Windows or macOS |
Ubuntu 24.04 ships glibc 2.39 and the GCC 14 C++ library, so the server runs without Iron Gate's Docker wrapper for older systems.
Without an official RAM figure, this tutorial starts with 2 vCPU and 4 GB RAM, a starting size rather than an Iron Gate figure. After an evening of play, the Memory: line in systemctl status valheim shows what the world uses.
Prerequisites
- A VPS running Ubuntu 24.04 LTS with your SSH public key added at deploy. Arct Cloud plans with 2 vCPU, 4 GB RAM and 40 GB NVMe storage are
cvm.micro,vm.microand the High Performancehvm.micro. - An SSH key pair. See How to Generate an SSH Key on Windows, macOS, and Linux.
- A non-root user with sudo privileges that logs in with your SSH key. The commands below create one.
- A copy of Valheim for each player, on any platform the game ships on.
On a new server, log in as root and create the sudo user. The rsync line copies root's authorized SSH key to the new account, because the key added at deploy belongs to root:
adduser deploy
usermod -aG sudo deploy
rsync --archive --chown=deploy:deploy ~/.ssh /home/deploy
Open a second terminal and confirm ssh [email protected] works before you log out as root. Replace 203.0.113.10 with your server's public IP address.
The packages below keep the same names on Ubuntu 26.04 LTS. Commands run as the sudo user. Replace values written in capitals, such as YOUR_SERVER_NAME, with your own.
Step 1: Install SteamCMD and the required libraries
SteamCMD is Valve's command-line Steam client. Ubuntu ships it as a 32-bit package in the multiverse repository, and libpulse-dev comes from universe, so enable the universe and multiverse repositories and the i386 architecture first. How to Install SteamCMD on Ubuntu 24.04 covers the install in more detail.
sudo apt update
sudo apt install -y software-properties-common
sudo add-apt-repository -y multiverse
sudo add-apt-repository -y universe
sudo dpkg --add-architecture i386
sudo apt update
The package asks you to accept Valve's Steam License Agreement, which incorporates the Steam Subscriber Agreement. Read it, then record your answer so the install runs without a dialog:
echo steam steam/question select "I AGREE" | sudo debconf-set-selections
echo steam steam/license note '' | sudo debconf-set-selections
Install SteamCMD and the three packages Iron Gate's guide lists for Linux:
sudo apt install -y --no-install-recommends steamcmd libatomic1 libpulse-dev libpulse0
--no-install-recommends tells apt to skip recommended packages and install only what these four depend on.
Step 2: Enable UFW and allow SSH
Allow SSH before you enable UFW, or UFW blocks your next SSH login:
sudo ufw allow OpenSSH
sudo ufw enable
Type y when UFW asks to confirm. UFW now denies other incoming traffic until Step 8.
Step 3: Create a system user for the server
Run the server and SteamCMD as an unprivileged service user, so the game process has no root access:
sudo useradd --system --create-home --home-dir /home/valheim --shell /usr/sbin/nologin valheim
Step 4: Download the Valheim dedicated server for Linux
App ID 896660 is the Valheim Dedicated Server tool. It downloads with an anonymous login, so no Steam account is needed:
sudo -u valheim -H /usr/games/steamcmd \
+force_install_dir /home/valheim/server \
+login anonymous \
+app_update 896660 validate \
+quit
+force_install_dir must come before +login. The full /usr/games/steamcmd path is needed because sudo's default secure_path on Ubuntu does not include /usr/games.
The output ends similar to this:
...
Success! App '896660' fully installed.
The download includes linux64/steamclient.so, which the server loads from its own folder.
Step 5: Set the server name, world and password
The server takes its settings as launch arguments. Keep the three values in an environment file that only root can edit; the systemd unit in Step 7 passes them to the server:
sudo install -d -m 0755 /etc/valheim
sudo tee /etc/valheim/valheim.env > /dev/null <<'EOF'
VALHEIM_NAME=YOUR_SERVER_NAME
VALHEIM_WORLD=YOUR_WORLD_NAME
VALHEIM_PASSWORD=YOUR_PASSWORD
EOF
sudo chmod 600 /etc/valheim/valheim.env
What each value does:
VALHEIM_NAMEbecomes-name, the name in the server list.VALHEIM_WORLDbecomes-world. The server creates a world with this name, or loads the existing world with that name.VALHEIM_PASSWORDbecomes-password. Iron Gate'sstart_server.shsets two rules: at least 5 characters, and the password must not appear in the server name.
Spaces inside a value are allowed. The unit passes these values on the server's command line, so the password also shows in the process list and in systemctl status output. Remove it before you share that output.
Step 6: Create the backup script
The service runs this script before every start, while the server is stopped, so each archive holds a consistent save. It archives the save folder, which holds the worlds and the admin, ban and permitted lists. Create /usr/local/bin/valheim-backup:
sudo tee /usr/local/bin/valheim-backup > /dev/null <<'EOF'
#!/bin/sh
set -eu
DATA=/home/valheim/data
DEST=/home/valheim/backups
[ -d "$DATA" ] || exit 0
mkdir -p "$DEST"
find "$DEST" -name 'valheim-*.tar.gz' -mmin -10 | grep -q . && exit 0
tar -czf "$DEST/valheim-$(date +%Y%m%d-%H%M%S).tar.gz" -C "$DATA" .
find "$DEST" -name 'valheim-*.tar.gz' -mtime +14 -delete
EOF
sudo chmod 755 /usr/local/bin/valheim-backup
The script skips the first start, before a world exists, skips the archive when one is less than 10 minutes old, and keeps 14 days of archives. The 10-minute check stops a crash loop from filling the disk.
Step 7: Run the server as a systemd service
Create /etc/systemd/system/valheim.service:
sudo nano /etc/systemd/system/valheim.service
Paste this unit, then save with Ctrl+O and exit with Ctrl+X:
[Unit]
Description=Valheim Dedicated Server
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=valheim
Group=valheim
WorkingDirectory=/home/valheim/server
EnvironmentFile=/etc/valheim/valheim.env
Environment=LD_LIBRARY_PATH=/home/valheim/server/linux64
Environment=SteamAppId=892970
ExecStartPre=/usr/local/bin/valheim-backup
ExecStartPre=-/usr/games/steamcmd +force_install_dir /home/valheim/server +login anonymous +app_update 896660 +quit
ExecStart=/home/valheim/server/valheim_server.x86_64 -name ${VALHEIM_NAME} -port 2456 -world ${VALHEIM_WORLD} -password ${VALHEIM_PASSWORD} -savedir /home/valheim/data -public 1 -crossplay
KillSignal=SIGINT
TimeoutStartSec=1800
TimeoutStopSec=120
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
What the unit does:
- The
Environment=lines match whatstart_server.shexports. - Each start runs the backup, then a SteamCMD update. The
-lets the server start when Steam is unreachable;TimeoutStartSec=1800allows 30 minutes for updates. -savedir /home/valheim/datakeeps worlds and permission files in one folder instead of the default~/.config/unity3d/IronGate/Valheim.-public 1lists the server in the in-game server list. With-public 0, Iron Gate's guide says players join only by IP address.KillSignal=SIGINTsends the same signal as Ctrl+C, the stop method Iron Gate's manual asks for.TimeoutStopSec=120gives the server 2 minutes before systemd forces it to stop.
Start the server and enable it at boot:
sudo systemctl daemon-reload
sudo systemctl enable --now valheim
sudo systemctl status valheim --no-pager
The Loaded: line ends in enabled and the Active: line reads active (running). Follow the log with sudo journalctl -u valheim -f.
World modifiers are launch arguments too: add -preset hard, -modifier raids none or -setkey nomap to ExecStart, then reload systemd and restart the service.
Step 8: Open UDP ports 2456 and 2457 in UFW
Iron Gate's manual says the server uses the -port value and the next port, 2456 and 2457 by default. The Steam backend needs both. With -crossplay, traffic goes through a relay server and needs no open ports, so these rules matter if you drop the flag later.
sudo ufw allow 2456:2457/udp
sudo ufw status
The output looks similar to this:
Status: active
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
2456:2457/udp ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
2456:2457/udp (v6) ALLOW Anywhere (v6)
The comment in start_server.sh mentions ports 2456 to 2458, but the manual describes two ports. If your provider runs a network firewall in front of the server, open the same ports there.
Step 9: Connect and verify the server
Check the log for the backend's ready line:
sudo journalctl -u valheim --no-pager | grep -E 'join code|Game server connected'
The command prints Game server connected, the ready message Iron Gate's manual names, or the crossplay line that ends with registered with join code and the code. If it prints nothing, read the full log with sudo journalctl -u valheim -e.
In Valheim, open the Join Game tab, select Add server, and enter 203.0.113.10:2456 or the join code. Replace 203.0.113.10 with your server's public IPv4 address. Connect and enter the password. Iron Gate's guide says a crossplay server cannot be reached by a local or loopback IP address, so use the public address even when testing.
Manage players and admins
The save folder holds adminlist.txt, bannedlist.txt and permittedlist.txt. Each takes one player ID per line, case-sensitive, copied exactly as the in-game F2 panel or the server log shows it. Iron Gate's Patch 1.0.12 notes give V_123456789 as an example of the new ID format and say the ban and permitted lists also accept older IDs such as Steam_123456789. Add yourself as an admin and restart the server:
echo "YOUR_PLAYER_ID" | sudo -u valheim tee -a /home/valheim/data/adminlist.txt
sudo systemctl restart valheim
Admins open the console with F5 and use Kick, Ban, Unban and Banned. If F5 does nothing, turn on the console in the game's settings menu. Adding anyone to permittedlist.txt blocks every player who is not on that list.
Valheim dedicated server crossplay for console players
Valheim 1.0 shipped on September 9, 2026 with crossplay between all platforms: Steam on Windows, Linux and Mac, the Mac App Store, the Microsoft Store, Xbox One, Xbox Series X|S, PlayStation 5 and Nintendo Switch 2. Checked October 2026:
-crossplayruns the server on the PlayFab backend, which any platform can join. Without it, the server uses the Steam backend, and only Steam players can see and join it. Iron Gate's ownstart_server.shships with-crossplayon.- Players join a crossplay server by IP address and port, by join code, or from the server list. The join code changes on each server restart; the IP address and port stay the same.
- Iron Gate's crossplay FAQ says Xbox players join when both the console and the server have crossplay enabled. If the option is missing on the console, check its parental control settings.
To run a Steam-only server, remove -crossplay from ExecStart, run sudo systemctl daemon-reload, restart the service, and keep UDP 2456 and 2457 open.
Upload an existing world from your PC
On Windows, Valheim keeps local worlds in %USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worlds_local. Worlds saved to Steam Cloud sit in the Steam userdata folder instead. Valheim 1.0 saves a world as several files and folders, so copy the whole folder.
The scp command comes with the OpenSSH Client, an optional feature on Windows 10 (version 1809 and later) and Windows 11. With the game closed, run this in PowerShell on your PC:
scp -r "$env:USERPROFILE\AppData\LocalLow\IronGate\Valheim\worlds_local" [email protected]:world-upload
For other ways to move files, see how to copy files to a VPS. On the server, stop Valheim, move the current world folder aside, copy the uploaded worlds in and give the files to the service user:
sudo systemctl stop valheim
sudo mv /home/valheim/data/worlds_local /home/valheim/worlds_local.old-$(date +%Y%m%d-%H%M%S)
sudo install -d -o valheim -g valheim /home/valheim/data/worlds_local
sudo cp -r ~/world-upload/. /home/valheim/data/worlds_local/
sudo chown -R valheim:valheim /home/valheim/data/worlds_local
The mv moves the world the server generated in Step 7 out of the save folder, so its files do not mix with the upload or end up in the backup archives.
Set VALHEIM_WORLD to the world's name exactly as Valheim's world list shows it, then start the server:
sudo nano /etc/valheim/valheim.env
sudo systemctl start valheim
A world saved before 1.0 as a .db and .fwl pair also loads: Iron Gate's notes for the new save system say the game makes a backup before it converts an old world.
Update the Valheim server
Players cannot join a server that runs an older version than their game, so update after each Valheim patch. Every restart checks Steam for a new build:
sudo systemctl restart valheim
To verify every file as well, stop the server and run the download with validate:
sudo systemctl stop valheim
sudo -u valheim -H /usr/games/steamcmd \
+force_install_dir /home/valheim/server \
+login anonymous \
+app_update 896660 validate \
+quit
sudo systemctl start valheim
To restart and update every night, create /etc/systemd/system/valheim-restart.service:
[Unit]
Description=Restart the Valheim server
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl restart valheim.service
Create /etc/systemd/system/valheim-restart.timer:
[Unit]
Description=Restart the Valheim server daily
[Timer]
OnCalendar=*-*-* 05:00:00
[Install]
WantedBy=timers.target
Enable the timer and confirm the next run:
sudo systemctl daemon-reload
sudo systemctl enable --now valheim-restart.timer
systemctl list-timers valheim-restart.timer
The timer uses the server's time zone; check it with timedatectl. The restart disconnects players and issues a new join code, so pick an hour when the server is empty.
Back up and restore the world
Each start writes an archive to /home/valheim/backups, unless the last one is less than 10 minutes old. The server also keeps 4 automatic backups by default, the first after 2 hours and the rest 12 hours apart (-backups, -backupshort, -backuplong), and saves the world every 30 minutes (-saveinterval 1800). List the archives:
sudo ls -lh /home/valheim/backups
To restore one, stop the server, move the current save folder aside and extract the archive. Replace YYYYMMDD-HHMMSS with the archive's timestamp:
sudo systemctl stop valheim
sudo mv /home/valheim/data /home/valheim/data.old-$(date +%Y%m%d-%H%M%S)
sudo -u valheim mkdir /home/valheim/data
sudo -u valheim tar -xzf /home/valheim/backups/valheim-YYYYMMDD-HHMMSS.tar.gz -C /home/valheim/data
sudo systemctl start valheim
These archives sit on the same disk as the world. For copies kept off the server, see VPS backups.
Troubleshoot common Valheim server errors
| Symptom | Cause | Fix |
|---|---|---|
sudo: steamcmd: command not found | /usr/games is not in sudo's path | Call /usr/games/steamcmd |
Error bad password in the journal | The -password value failed the server's check | Use 5 or more characters that do not appear in the server name |
| Console players cannot find the server | Server runs the Steam backend | Add -crossplay to ExecStart |
| The join code stopped working | The server restarted and issued a new code | Use the new code from the journal, or the IP address and port |
Steam players time out without -crossplay | UDP 2456 or 2457 blocked | Check sudo ufw status and any provider firewall |
| Players get a version error after a game patch | The server runs an older build | sudo systemctl restart valheim to update |
FAQ
Is a Valheim dedicated server free?
Yes. The Valheim Dedicated Server tool, Steam app 896660, downloads free with an anonymous SteamCMD login. Each player still needs their own copy of Valheim to connect.
How much RAM for a dedicated Valheim server?
Iron Gate publishes no RAM or CPU figure for the dedicated server. This guide starts with 2 vCPU and 4 GB RAM, which is not an official number, and reads the Memory line in systemctl status after a session to decide whether the world needs more.
What ports does a Valheim dedicated server use?
UDP 2456 and 2457 by default. Iron Gate's manual names the -port value and the next port up, and Steam's networking runs over UDP. A server started with -crossplay sends traffic through a relay server, so it needs no port forwarding.
Can Xbox players join a Valheim dedicated server?
Yes. Start the server with the -crossplay argument, and Xbox, PlayStation 5 and Switch 2 players can join by IP address, join code or the server list. Iron Gate says the Xbox needs crossplay enabled too.
Where is the Valheim dedicated server config file?
The server has no settings file. It reads launch arguments, which Iron Gate's start_server.sh sets on one line. This tutorial keeps the name, world and password in /etc/valheim/valheim.env and the other flags in the systemd unit.
Can I set the world seed on a Valheim dedicated server?
Yes, by uploading a world. Create the world in Valheim on your PC with that seed, upload it to the server and set the world name to match. Iron Gate's manual lists no seed launch argument.
Does a Valheim dedicated server support mods?
Valheim has no official mod support. Iron Gate's 1.0 FAQ says there is no Steam Workshop and no mod support on consoles, and that it cannot guarantee community mods work with 1.0.
Next steps
- How to Host a Palworld Dedicated Server on Ubuntu 24.04 uses the same SteamCMD, service user and systemd pattern.
- How to Install SteamCMD on Ubuntu 24.04 covers SteamCMD on its own.
- A Guide to Dedicated Servers, Iron Gate's reference for every launch argument.
High Performance plans run on AMD Ryzen 9 up to 5.7 GHz or AMD EPYC Genoa 9004 Series up to 4.3 GHz, with DDR5 RAM. Compare plans.
This work is licensed under CC BY-NC-SA 4.0.