Desert Forge IT — Arizona IT · Field-tested tools & guidesFree consult →

How to Self-Host a Valheim Dedicated Server on Linux

Intermediate 30 min — Set up a persistent Valheim server using SteamCMD on Debian/Ubuntu.

Prerequisites

  • Debian 12 or Ubuntu 22.04 server
  • Minimum 4GB RAM (Valheim is memory-hungry)
  • SteamCMD installed
  • Ports 2456-2458 UDP accessible

Install SteamCMD

dpkg --add-architecture i386
apt update
apt install -y lib32gcc-s1 steamcmd

Download Valheim Server

mkdir -p /opt/valheim
steamcmd +@sSteamCmdForcePlatformType linux \
  +login anonymous \
  +force_install_dir /opt/valheim \
  +app_update 896660 validate \
  +quit

Configure Start Script

cat > /opt/valheim/start.sh << 'EOF'
#!/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 "Dedicated" \
  -password "changeme" \
  -savedir "/opt/valheim/data" \
  -public 0
export LD_LIBRARY_PATH=$templdpath
EOF
chmod +x /opt/valheim/start.sh

Set -public 1 to list on the server browser. Password must be at least 5 characters and NOT contain the server name.

systemd Service

[Unit]
Description=Valheim Dedicated Server
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/opt/valheim
ExecStart=/opt/valheim/start.sh
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Enable: systemctl enable --now valheim

Firewall

ufw allow 2456:2458/udp

Connect from Game

In Valheim: Join Game → Join IP → enter your server IP:2456 and the password.

Backups

World files are in the save directory:

# Backup world files
tar czf /opt/valheim/backups/world-$(date +%Y%m%d).tar.gz /opt/valheim/data/worlds/

Back up the .db and .fwl files — both are required for a complete world restore.

Troubleshooting

  • Can't connect: Check UDP ports 2456-2458, not TCP
  • Password rejected: Password can't contain the server name
  • Lag/desync: Valheim needs good single-thread CPU performance
  • Server not showing in browser: Set -public 1 and wait 10+ minutes
Play with friends?

Desert Forge hosting starts at $2/week — instant setup, DDoS protection, free tier available.

Get a server

← Back to Knowledge Base

DF: Game Hosting

Skip the setup. Game servers from $2/week with instant deployment.

Get a server