Navigation

Quick Info Installation Configuration Parameters Troubleshooting Performance

Valheim Dedicated Server Hosting Guide

Overview

Valheim is a brutal survival and exploration game for 1-10 players set in a procedurally-generated purgatory inspired by Viking culture. This comprehensive guide covers everything you need to know about hosting a Valheim dedicated server on a VPS or dedicated server.

Quick Info

Installation & Setup

System Requirements

Installing via Steam (Windows)

1. Open Steam and go to your Library
2. Use the dropdown menu and check "Tools"
3. Locate "Valheim Dedicated Server" in the list
4. Click "Install" and choose installation directory
5. Wait for download to complete

Installing via SteamCMD (Linux/Windows)

# Install SteamCMD first (if not already installed)
# Ubuntu/Debian:
sudo apt update
sudo apt install steamcmd

# Create server directory
mkdir -p ~/valheim-server
cd ~/valheim-server

# Download server files
steamcmd +login anonymous +force_install_dir ~/valheim-server +app_update 896660 validate +exit

# The server files will be downloaded to your specified directory

First-Time Setup

Before starting your server for the first time, you'll need to configure the startup parameters.

Server Configuration

Startup Scripts

Valheim uses startup scripts to configure the server. Edit the appropriate file for your OS:

Windows: start_headless_server.bat

@echo off
set SteamAppId=892970
valheim_server.exe -nographics -batchmode ^
    -name "MyValheimServer" ^
    -port 2456 ^
    -world "MyWorld" ^
    -password "MyPassword123" ^
    -public 1

Linux: start_server.sh

#!/bin/bash
export SteamAppId=892970

./valheim_server.x86_64 -nographics -batchmode \
    -name "MyValheimServer" \
    -port 2456 \
    -world "MyWorld" \
    -password "MyPassword123" \
    -public 1 \
    -logfile /path/to/valheim.log

Admin Configuration Files

Create these files in the server directory to manage administrators, bans, and whitelists:

adminlist.txt

# Add Steam64 IDs (one per line)
76561198012345678
76561198087654321

bannedlist.txt

# Add Steam64 IDs of banned players
76561198099999999

permittedlist.txt

# For whitelist mode - only these IDs can join
76561198012345678
76561198087654321

Startup Parameters

Essential Parameters

Parameter Description Example
-name Server name (appears in browser) "My Valheim Server"
-port Server port (default 2456) 2456
-world World/save name "Midgard"
-password Server password (required) "SecurePass123"
-public 1=Public listing, 0=Private 1
-savedir Custom save directory path "/path/to/saves"
-logfile Path to log file "/var/log/valheim.log"
-nographics Run headless (no GUI) Required for dedicated servers
-batchmode Run in batch mode Required for dedicated servers

Port Forwarding

You must forward/open the following ports on your firewall:

Linux Firewall (UFW)

# Allow Valheim ports
sudo ufw allow 2456:2458/udp
sudo ufw reload

Windows Firewall

# Open Windows Defender Firewall with Advanced Security
# Create new Inbound Rules for UDP ports 2456-2458
# Or use PowerShell:
New-NetFirewallRule -DisplayName "Valheim Server" -Direction Inbound -Protocol UDP -LocalPort 2456-2458 -Action Allow

Troubleshooting

Server Won't Start

Problem: Server fails to start or crashes immediately.

Solutions:

Server Not Appearing in Browser

Problem: Server doesn't show up in the in-game server list.

Solutions:

Connection Issues

Problem: Players cannot connect to the server.

Solutions:

Lag and Performance Issues

Problem: Server experiences lag, stuttering, or poor performance.

Solutions:

World/Save Corruption

Problem: World save is corrupted or progress is lost.

Solutions:

Performance Optimization

Server Resource Management

Backup Strategy

# Linux backup script example
#!/bin/bash
WORLD_NAME="MyWorld"
BACKUP_DIR="/path/to/backups"
DATE=$(date +%Y%m%d_%H%M%S)

# Create backup
cp ~/.config/unity3d/IronGate/Valheim/worlds/$WORLD_NAME.* $BACKUP_DIR/

# Keep only last 7 days of backups
find $BACKUP_DIR -name "*.fwl" -mtime +7 -delete
find $BACKUP_DIR -name "*.db" -mtime +7 -delete

Automated Restarts

Set up daily restarts to clear memory and apply updates:

# Linux crontab entry for 4 AM restart
0 4 * * * /path/to/restart_valheim.sh

# restart_valheim.sh:
#!/bin/bash
pkill -9 valheim_server
sleep 10
cd /home/valheim/server
./start_server.sh &

Console Commands (In-Game Admin)

Enable console with -console parameter, press F5 in-game:

Additional Resources

Important Notes