EN

Game servers

How to Create a Valheim Server

Complete guide to create a dedicated Valheim server on a VPS or dedicated Linux server: installation with SteamCMD, password, administrators, crossplay, systemd service and world backup.

9 min read, updated on 18 November 2026

On this page

Your values

Enter them once and the commands in this guide update.

This guide explains how to install a dedicated Valheim server on your VPS or dedicated Linux server, protect it with a password, appoint administrators and back up your world. Iron Gate, the game's studio, provides a native Linux version of the server.

Order a Server

To host your Valheim world, HostMyServers offers several suitable options:

Prerequisites

  • SSH access as root or user with sudo privileges
  • 64-bit x86_64 Linux system (Debian 12/13 or Ubuntu 22.04/24.04)
  • Active firewall: nftables, iptables or ufw (use only one tool at a time)
  • Ports 2456 and 2457 UDP accessible
  • The Valheim game on Steam to connect

Required Configuration

Iron Gate does not publish minimum requirements for the server. The values below are guidelines: consumption increases with the number of players and the size of the bases built.

Players CPU RAM Storage
2 to 5 2 fast cores 4 GB 10 GB SSD
6 to 10 4 fast cores 8 GB 20 GB NVMe SSD

The server takes up about 2 GB on disk. Allow extra space for the world and its backups.

System Update

Terminal
sudo apt update && sudo apt upgrade -y

Installing Dependencies

lib32gcc-s1 is required by SteamCMD, and the libatomic1, libpulse-dev and libpulse0 packages are requested by the official server manual:

Terminal
sudo apt install -y curl tar ca-certificates lib32gcc-s1 libatomic1 libpulse-dev libpulse0

Creating a Dedicated User

The server must never run as root. Create a dedicated user:

Terminal
sudo adduser --disabled-password --gecos "" valheim

Ports Used

Port Protocol Usage
2456 UDP Game (value of -port)
2457 UDP Next port, also used by the server

Valheim uses the port chosen with -port and the next port. The server does not offer RCON or a web administration interface: no other port needs to be opened.

Firewall Configuration

With UFW

Terminal
sudo ufw allow 2456:2457/udp
sudo ufw reload

With iptables

Terminal
sudo iptables -A INPUT -p udp --dport 2456:2457 -j ACCEPT
sudo iptables-save | sudo tee /etc/iptables/rules.v4

Saving the rules across reboots requires the iptables-persistent package.

With nftables

These commands use the inet filter table and the input chain, present by default in /etc/nftables.conf on Debian.

Terminal
sudo nft add rule inet filter input udp dport 2456-2457 accept
(echo "flush ruleset"; sudo nft list ruleset) | sudo tee /etc/nftables.conf

Installing SteamCMD

Log in as the valheim user and prepare the folders:

Terminal
sudo -iu valheim
mkdir -p ~/steamcmd ~/valheim-server ~/valheim-data
cd ~/steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar -xzf -

Downloading the Valheim Server

Start the server installation (application ID 896660):

Terminal
~/steamcmd/steamcmd.sh +force_install_dir /home/valheim/valheim-server +login anonymous +app_update 896660 validate +quit

When it finishes, the message Success! App '896660' fully installed. is displayed. If the installation stops with an error, run the same command again.

Launch Script

The provided start_server.sh file is replaced with every update. As Iron Gate recommends, work on your own script, placed outside the server folder:

Terminal
nano ~/start-valheim.sh
Terminal
#!/bin/bash
cd /home/valheim/valheim-server || exit 1

export LD_LIBRARY_PATH="./linux64:$LD_LIBRARY_PATH"
export SteamAppId=892970

exec ./valheim_server.x86_64 \
    -name "My Valheim Server" \
    -port 2456 \
    -world "MyWorld" \
    -password "ChangeThisPassword" \
    -savedir /home/valheim/valheim-data \
    -public 1 \
    -saveinterval 1800 \
    -backups 4 \
    -backupshort 7200 \
    -backuplong 43200

Protect the file, because it contains the password:

Terminal
chmod 700 ~/start-valheim.sh

Main Parameters

Parameter Description
-name Name displayed in the server list
-port First port used (2456 by default)
-world World name, created if it does not exist
-password Server password
-savedir Folder for worlds and access lists
-public 1: visible in the list, 0: accessible by IP address only
-saveinterval World save interval, in seconds (1800 by default)
-backups Number of automatic backups kept (4 by default)
-backupshort Delay before the first automatic backup, in seconds (7200 by default)
-backuplong Delay between subsequent backups, in seconds (43200 by default)
-crossplay Enables crossplay (see below)

World Modifiers (optional)

Parameter Possible values
-preset Normal, Casual, Easy, Hard, Hardcore, Immersive, Hammer
-modifier combat veryeasy, easy, hard, veryhard
-modifier deathpenalty casual, veryeasy, easy, hard, hardcore
-modifier resources muchless, less, more, muchmore, most
-modifier raids none, muchless, less, more, muchmore
-modifier portals casual, hard, veryhard
-setkey nobuildcost, playerevents, passivemobs, nomap

Place -preset before -modifier, because a preset overwrites the modifiers defined before it.

First Launch

Still as the valheim user, launch the server to check that it starts and to create the world:

Terminal
~/start-valheim.sh

The server is ready when the message Game server connected appears. Then stop it with Ctrl+C, without abruptly closing the session, and exit the valheim user:

Terminal
exit

Configuration as systemd Service

Create Service File

Terminal
sudo nano /etc/systemd/system/valheim.service

File content:

Configuration
[Unit]
Description=Valheim Dedicated Server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=valheim
Group=valheim
WorkingDirectory=/home/valheim/valheim-server
ExecStart=/home/valheim/start-valheim.sh
KillSignal=SIGINT
TimeoutStopSec=120
Restart=on-failure
RestartSec=20
LimitNOFILE=100000

[Install]
WantedBy=multi-user.target

KillSignal=SIGINT reproduces the Ctrl+C that Iron Gate requires to stop the server cleanly.

Enable and Start Service

Terminal
sudo systemctl daemon-reload
sudo systemctl enable valheim.service
sudo systemctl start valheim.service

Management Commands

Terminal
# Check status
sudo systemctl status valheim.service

# Stop server
sudo systemctl stop valheim.service

# Restart server
sudo systemctl restart valheim.service

# View logs
sudo journalctl -u valheim.service -f

Verify the Server

Wait for the startup message in the logs:

Terminal
sudo journalctl -u valheim.service | grep 'Game server connected'

Then check that the ports are listening:

Terminal
sudo ss -ulpn | grep -E ':(2456|2457)\b'

Connecting to Server

  1. Launch Valheim and choose your character.
  2. Open the tab for joining a server.
  3. Use Join IP and enter SERVER_IP:2456.
  4. Enter the server password.

With -public 1, the server can also appear in the community list after a few minutes.

Enabling Crossplay (optional)

Without any particular option, the server uses the Steam network: only Steam players can join it. To welcome players from other platforms, such as Xbox or Game Pass, add -crossplay at the end of the command in start-valheim.sh, adding \ to the previous line:

Terminal
    -backuplong 43200 \
    -crossplay

Restart the service, then retrieve the join code from the logs:

Terminal
sudo journalctl -u valheim.service | grep -i 'join code'

With crossplay, traffic goes through a relay service: opening the ports is no longer necessary. You can connect with the public IP address and port, the join code or the server list. A local address does not work.

Administration

Access Lists

Three text files are located in /home/valheim/valheim-data:

File Role
adminlist.txt Administrators
bannedlist.txt Banned players
permittedlist.txt Allowed players

Add one ID per line, in the Platform_UserID format, respecting uppercase letters. For a Steam player, this gives for example:

Text
Steam_76561198000000000

The ID appears in the F2 panel in game and in the server logs. Edit these files as the valheim user:

Terminal
sudo -u valheim nano /home/valheim/valheim-data/adminlist.txt

Restart the server if a change is not taken into account.

In-Game Commands

Administrators open the console with F5. If it does not open, add the -console option to Valheim's launch options in Steam.

Command Description
Kick NAME Kick a player
Ban NAME Ban a player
Unban NAME Unban a player
Banned Show banned players

File Structure

Path Description
/home/valheim/valheim-server/ Server files, replaced by updates
/home/valheim/start-valheim.sh Your launch script
/home/valheim/valheim-data/worlds_local/ Worlds (.db and .fwl) and automatic backups
/home/valheim/valheim-data/*.txt Access lists

Importing an Existing World

Each world consists of two files, .db and .fwl, which must be kept together.

  1. Stop the server: sudo systemctl stop valheim.service

  2. On your Windows PC, find the world in %USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worlds_local.

  3. Upload both files to /home/valheim/valheim-data/worlds_local/, for example with SFTP.

  4. Give ownership back to the valheim user:

    Terminal
    sudo chown -R valheim:valheim /home/valheim/valheim-data
  5. Enter the world name, without its extension, in -world, then restart the server.

Server Update

Players and the server must use the same version of the game. After a Valheim update, you therefore need to update the server:

Terminal
sudo systemctl stop valheim.service
sudo -iu valheim /home/valheim/steamcmd/steamcmd.sh +force_install_dir /home/valheim/valheim-server +login anonymous +app_update 896660 validate +quit
sudo systemctl start valheim.service

Your script and data are outside the server folder: the update does not change them.

World Backup

Built-in Backups

The server itself keeps copies in worlds_local, with _backup_auto- in their name. By default, it keeps one copy that is 2 hours old and three copies spaced 12 hours apart. They are on the same disk as the world: complement them with an external backup.

Backup Script

This script briefly stops the server to get a consistent copy, then restarts it:

Terminal
sudo nano /usr/local/sbin/backup-valheim.sh
Terminal
#!/bin/bash
set -euo pipefail
umask 027

BACKUP_DIR="/home/valheim/backups"
DATE=$(date +%Y-%m-%d_%H-%M-%S)
ARCHIVE="$BACKUP_DIR/valheim_$DATE.tar.gz"

install -d -o valheim -g valheim -m 750 "$BACKUP_DIR"

systemctl stop valheim.service
trap 'systemctl start valheim.service' EXIT

tar -czf "$ARCHIVE" -C /home/valheim valheim-data start-valheim.sh
chown valheim:valheim "$ARCHIVE"

# Delete backups older than 7 days
find "$BACKUP_DIR" -name "valheim_*.tar.gz" -mtime +7 -delete
Terminal
sudo chmod 750 /usr/local/sbin/backup-valheim.sh
sudo /usr/local/sbin/backup-valheim.sh
sudo ls -lh /home/valheim/backups

Schedule Backup

Terminal
sudo nano /etc/cron.d/valheim-backup
Text
# Backup every night at 5:30 AM
30 5 * * * root /usr/local/sbin/backup-valheim.sh

Regularly copy these archives off the server. They contain your launch script, and therefore the server password.

Restore a Backup

Terminal
sudo systemctl stop valheim.service
sudo mv /home/valheim/valheim-data /home/valheim/valheim-data.old
sudo -u valheim tar -xzf /home/valheim/backups/valheim_DATE.tar.gz -C /home/valheim
sudo systemctl start valheim.service

Replace DATE with the date of the archive.

Troubleshooting

Server won't start

  • Check the logs: sudo journalctl -u valheim.service -n 100
  • Check that the script is executable: ls -l /home/valheim/start-valheim.sh
  • Check the password: at least 5 characters, and not contained in the server name
  • Check the disk space and memory: df -h and free -h

error while loading shared libraries

A library is missing, for example libatomic.so.1 or libpulse. Reinstall the dependencies:

Terminal
sudo apt install -y libatomic1 libpulse-dev libpulse0

version GLIBC_2.29 not found

The server requires at least GLIBC_2.29 and GLIBCXX_3.4.26. Your system is too old: upgrade to Debian 12/13 or Ubuntu 22.04/24.04.

steamclient.so Error

If the logs report that steamclient.so cannot be found, create the expected link:

Terminal
sudo -iu valheim
mkdir -p ~/.steam/sdk64
ln -sf ~/valheim-server/linux64/steamclient.so ~/.steam/sdk64/steamclient.so
exit

Players can't connect

  • Wait for Game server connected in the logs
  • Check that ports 2456 and 2457 are open on UDP
  • Check that the server is listening: sudo ss -ulpn | grep -E ':(2456|2457)\b'
  • Check that permittedlist.txt is empty or does contain the player
  • If the connection still fails, also open port 2458 on UDP: the script provided by Iron Gate mentions the 2456-2458 range

Incompatible version

The game and the server do not have the same version. Update the server, then update the game in Steam.

My world has disappeared

The name passed to -world probably no longer matches the existing world, or -savedir has changed. List the worlds present:

Terminal
sudo ls -l /home/valheim/valheim-data/worlds_local

Without -savedir, the server saves to ~/.config/unity3d/IronGate/Valheim.