TürkiyeVPS

How to Host a Valheim Server on Linux with SteamCMD: Step-by-Step Guide

Set up your own Valheim dedicated server on Ubuntu 24.04: server files with SteamCMD, a start script, password and world settings, ports 2456-2457, a systemd service, the admin list, world backups and fixes for common errors.

8 min read

To play Valheim with friends in the same world, nobody's PC has to stay on all day. Run the game's free dedicated server on a Linux server and the world stays online 24/7, so everyone can log in whenever they like and keep building and exploring. In this guide we set up a Valheim server from scratch on Ubuntu 24.04.

Quick summary: download the Valheim server files (App ID 896660) anonymously with SteamCMD, set the server name, world name and password in a start script, open ports 2456-2457/UDP and run the server as a systemd service. For a small group of friends, 4 GB of RAM is a comfortable start.

How many resources do you need?

  • RAM: On a fresh world the server starts with around 2 GB, but memory use grows as the world is explored and more is built. For a group of 2-10 players, 4 GB is a comfortable start. If you use mods or the world has grown very large, 8 GB is safer.
  • CPU: The Valheim server calculates physics and structural integrity around players; CPU load rises noticeably at large bases. On servers whose CPU is shared with other customers you may see stutters at peak hours, so choose a server with dedicated vCPU.
  • Disk: The server files take about 1-2 GB. Leave a few GB for world files and automatic backups.
  • Player count: An unmodded Valheim server accepts at most 10 players.
  • Public IP: For players to connect directly and for the server to appear in the list, the server needs its own public IPv4 address. A server behind a shared (NAT) IP is not suitable.

To compare RAM needs with other games, see How much RAM does a Minecraft server need?

1. Prepare the system

Connect to your server over SSH. SteamCMD needs 32-bit libraries; enable the i386 architecture and install the required packages:

sudo dpkg --add-architecture i386
sudo apt update && sudo apt upgrade -y
sudo apt install -y lib32gcc-s1 lib32stdc++6 libatomic1 libpulse0 libpulse-mainloop-glib0 curl tmux

Don't run the server as root; create a separate user:

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

2. Install SteamCMD and download the server files

Switch to the valheim user and download Valve's official SteamCMD package:

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

The Valheim server files are downloaded with App ID 896660 using an anonymous login, no Steam account needed:

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

When it finishes you should see Success! App '896660' fully installed. If you get an error, run the command again; SteamCMD resumes where it left off.

3. Create the start script

The server folder ships with a sample start_server.sh, but updates can overwrite it, so keep your own script somewhere else:

nano ~/start.sh
#!/bin/bash
cd /home/valheim/server
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970
exec ./valheim_server.x86_64 -nographics -batchmode \
  -name "My Valheim Server" \
  -port 2456 \
  -world "MyWorld" \
  -password "StrongPass123" \
  -public 1 \
  -saveinterval 600 \
  -backups 4
chmod +x ~/start.sh

Key parameters:

Parameter What it does
-name Name shown in the server list
-port Game port; the server uses this port and the next one (2456 and 2457)
-world World name; if no world with this name exists, a new one is created on first start
-password Join password: must be at least 5 characters and must not appear in the server name
-public 1 lists the server in the community list, 0 means join by IP only
-saveinterval Autosave interval (seconds; default 1800)
-backups Number of automatic world backups to keep
-crossplay Lets Xbox and Game Pass players connect too
-preset Difficulty preset: casual, easy, normal, hard, hardcore, immersive, hammer

If the password breaks the rule, the server won't start; if you see a password-related error in the logs, check this first.

4. Open the firewall

Return to your own user (exit) and open the Valheim ports:

sudo ufw allow OpenSSH
sudo ufw allow 2456:2457/udp
sudo ufw enable

5. Start the server for the first time

Do the first run in a tmux session:

sudo -iu valheim
tmux new -s valheim
~/start.sh

The world is generated on first start, so it can take a little while. Once you see Game server connected in the log, the server accepts connections. Press Ctrl+B, then D to detach from tmux; the server keeps running.

To join, open Valheim and go to Start → Join Game → Add Server, then enter SERVER_IP:2456. It may take a few minutes to appear in the community list; joining by IP is always faster.

6. systemd service and automatic updates

When Valheim is updated, players can't join a server running the old version. Updating the server on every start is a practical solution. Stop the server in tmux (tmux attach -t valheim, then Ctrl+C), return to your own user and create the service file:

sudo nano /etc/systemd/system/valheim.service
[Unit]
Description=Valheim server
After=network-online.target
Wants=network-online.target

[Service]
User=valheim
WorkingDirectory=/home/valheim/server
ExecStartPre=/home/valheim/steamcmd/steamcmd.sh +force_install_dir /home/valheim/server +login anonymous +app_update 896660 +quit
ExecStart=/home/valheim/start.sh
KillSignal=SIGINT
Restart=on-failure
RestartSec=15
TimeoutStartSec=0
TimeoutStopSec=60

[Install]
WantedBy=multi-user.target

The KillSignal=SIGINT line matters: it makes the server save the world while shutting down. Enable the service and follow the logs:

sudo systemctl daemon-reload
sudo systemctl enable --now valheim
sudo journalctl -u valheim -f

When an update is released, sudo systemctl restart valheim updates the server first and then restarts it. For scheduled tasks, see our server management commands guide.

7. The admin list

Valheim keeps its settings and world files in the server user's home directory:

/home/valheim/.config/unity3d/IronGate/Valheim/

Files in this folder:

File / folder Contents
worlds_local/ World files (MyWorld.db and MyWorld.fwl)
adminlist.txt Steam IDs of admin players (one per line)
bannedlist.txt Banned players
permittedlist.txt If not empty, only listed players can join

To make yourself an admin, add your 17-digit Steam64 ID to adminlist.txt and restart the server. In game, open the console with F5 to use admin commands such as kick, ban and save.

8. Move and back up your world

You can move a world you started on your own PC to the server. On Windows, worlds are in %USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worlds_local. Stop the server, copy the .db and .fwl files to the server's worlds_local/ folder (for example with scp or WinSCP), fix the file owner and make the -world value in the start script match the file name:

sudo systemctl stop valheim
sudo chown valheim:valheim /home/valheim/.config/unity3d/IronGate/Valheim/worlds_local/*
sudo systemctl start valheim

The server's own automatic backups sit on the same disk; they don't protect against disk failure or accidental deletion. Back up the worlds_local/ folder off the server regularly. Our VPS backups with restic guide shows how.

Security

Share the server password only with your players and pick one that is hard to guess. Use SSH keys instead of passwords, keep the system updated and don't run the server as root. If you install mods, download them only from sources you trust. See our Linux server security guide for the basics.

TürkiyeVPS game servers for Valheim

Our game server plans run in Istanbul on an Intel Core i5-10400F with dedicated vCPU, guaranteed RAM, 60–100 GB disk, your own IPv4 address, unmetered speed, 3 TB of traffic per month and root access; the server is set up automatically after payment. For an unmodded Valheim server and a group of up to 10 friends, Oyun VDS 2 with 4 GB RAM (2 vCPU, 80 GB disk) is a good start; if you use mods or your world has grown large, Oyun VDS 3 with 8 GB RAM or Oyun VDS 4 with more CPU is more comfortable. Our standard VPS plans don't include a dedicated public IPv4 address, so they are not suitable for a game server that players connect to directly. Payment is accepted in USDT (TRC20). For larger survival communities, see our Rust server guide.

Frequently Asked Questions

Is hosting a Valheim server free?

The Valheim dedicated server software is free and downloaded anonymously with SteamCMD; you don't need to buy the game or create a Steam account for the server. You only pay for the machine it runs on. Players do need to own the game.

How much RAM does a Valheim server need?

A fresh world starts at around 2 GB, but memory use grows with exploration and building. For an unmodded server with up to 10 players, 4 GB is recommended; for modded or very large worlds, 8 GB.

My server doesn't show up in the list or players can't connect. What should I do?

First check with sudo ufw status that ports 2456-2457/UDP are open. It can take a few minutes to appear in the list; meanwhile try joining directly with SERVER_IP:2456. If the server doesn't start at all, check journalctl -u valheim; the most common cause is a password shorter than 5 characters or one contained in the server name.

Can Xbox and Game Pass players join my server?

Yes. Add the -crossplay parameter to the start script and players outside Steam can connect as well. In this mode players can also join with the join code shown in game instead of the IP.

Can I install mods on the server?

Yes. Valheim mods usually run on the BepInEx framework, and the same mod versions must be installed on both the server and the players' games. Every mod increases RAM and CPU usage; 8 GB RAM is safer for modded servers. Back up your world before installing mods.