Docs / Game Servers / Valheim Dedicated Server Setup Guide

Valheim Dedicated Server Setup Guide

By Admin · Jan 11, 2026 · Updated Apr 23, 2026 · 223 views · 1 min read

Requirements

Players RAM CPU Storage
2-5 2 GB 2 vCPU 5 GB
5-10 4 GB 2 vCPU 10 GB
10+ 8 GB 4 vCPU 15 GB

Installation via SteamCMD

# Install dependencies
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y lib32gcc-s1 steamcmd

# Create server user
sudo useradd -m -s /bin/bash valheim
sudo su - valheim

# Install the server
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir /home/valheim/server +login anonymous +app_update 896660 validate +quit

Configuration

# Create startup script
cat > /home/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 "MyWorld" \
  -password "server-password" \
  -crossplay \
  -public 1

export LD_LIBRARY_PATH=$templdpath
EOF

chmod +x /home/valheim/start.sh

Systemd Service

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

[Service]
User=valheim
WorkingDirectory=/home/valheim/server
ExecStart=/home/valheim/start.sh
Restart=on-failure
RestartSec=15
LimitNOFILE=100000

[Install]
WantedBy=multi-user.target
sudo systemctl enable --now valheim

Firewall

sudo ufw allow 2456:2458/udp comment "Valheim"

Auto-Updates

#!/bin/bash
# /home/valheim/update.sh
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir /home/valheim/server +login anonymous +app_update 896660 +quit

sudo systemctl restart valheim
# Daily update check at 5 AM
echo "0 5 * * * valheim /home/valheim/update.sh >> /var/log/valheim-update.log 2>&1" | sudo tee /etc/cron.d/valheim-update

World Backups

#!/bin/bash
# Backup worlds directory
TIMESTAMP=$(date +%Y%m%d_%H%M)
tar czf /backup/valheim/worlds_${TIMESTAMP}.tar.gz -C /home/valheim/.config/unity3d/IronGate/Valheim worlds_local
find /backup/valheim -name "*.tar.gz" -mtime +14 -delete

Performance Tips

  • Reduce publicBeta if experiencing lag
  • The world generates terrain on exploration — limit how far players explore early on
  • More players and more built structures = more RAM needed
  • Consider a dedicated Breeze for the game server

Tip Valheim's world saves happen every 20 minutes. Time your backup script to run between saves to avoid corrupted backups.

Was this article helpful?