← Back to Blog

How to Run a Valheim Dedicated Server on a VPS (2026)

Published May 3, 2026  ·  9 min read  ·  Galaxy Cloud Solutions

Hosting Valheim off someone's home PC works until that person needs to shut down or their internet drops mid-session. A dedicated server on a VPS keeps the world running regardless of who is online. This sets it up to start on boot and restart automatically if it crashes.

⚡ Galaxy 1 ($20/mo) is built for this — use code LAUNCH2026 for 50% off

What You Need

Valheim's server uses 2–3GB of RAM with a few players active. The Galaxy 1 plan (4 vCPU, 4GB RAM, $20/mo) is the right fit. Nebula 2 with 2GB will run it but you will feel it with more than two or three players. The dedicated server software is free and downloads through SteamCMD — you just need a copy of Valheim on Steam to be able to connect to dedicated servers.

Step 1: Update and Install Dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install lib32gcc-s1 libsdl2-2.0-0 -y

Step 2: Create a Steam User

Do not run a game server as root. Make a dedicated user:

sudo useradd -m -s /bin/bash steam
sudo su - steam

Step 3: Install SteamCMD

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

Step 4: Download the Valheim Server

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

Downloads about 1GB of files. Look for Success! App '896660' fully installed. when it finishes.

Step 5: Create the Start Script

nano /home/steam/valheim/start_server.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 Valheim Server"   -port 2456   -world "MyWorld"   -password "yourpassword"   -public 1   -savedir /home/steam/valheim/saves

export LD_LIBRARY_PATH=$templdpath
chmod +x /home/steam/valheim/start_server.sh

Step 6: Systemd Service

exit
sudo nano /etc/systemd/system/valheim.service
[Unit]
Description=Valheim Dedicated Server
After=network.target

[Service]
Type=simple
User=steam
WorkingDirectory=/home/steam/valheim
ExecStart=/home/steam/valheim/start_server.sh
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable valheim
sudo systemctl start valheim

Watch the startup:

sudo journalctl -u valheim -f

Takes 30–60 seconds to fully initialize. You will see Game server connected when it is ready.

Step 7: Firewall

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

Connecting

In Valheim: Start Game → Join Game → Add Server. Enter your server IP with port 2456. World name and password match your start script.

Keeping It Updated

sudo systemctl stop valheim
sudo su - steam && cd ~/steamcmd
./steamcmd.sh +force_install_dir /home/steam/valheim +login anonymous +app_update 896660 validate +quit
exit && sudo systemctl start valheim

Valheim server running 24/7 from $20/mo

Galaxy 1: 4 vCPU, 4GB RAM, 80GB SSD — handles Valheim with room to spare. Use code LAUNCH2026 for 50% off your first month.

Get Started