Hosting Guides

Valheim Crossplay Server Deployment via SteamCMD

7 min readLinux & WindowsSteamCMDUnity
Once your server is online, jump to the Valheim command and config reference.

Iron Gate ships the Valheim dedicated server as a small, well behaved Unity binary that runs cleanly on both Linux and Windows. Adding the -crossplay startup flag routes matchmaking through PlayFab instead of the Steam-only relay, which is what lets Xbox and Microsoft Store players join alongside Steam players. The flag is the only thing required, but it changes how the server is discovered, so it pays to understand exactly what it does before flipping it on.

Prerequisites

  • Ubuntu 22.04 LTS or Windows Server 2019 and newer.
  • 4 GB RAM minimum, 8 GB recommended for 10 player worlds.
  • UDP 2456, 2457, and 2458 open at the firewall.
  • A dedicated non root user (Linux) or non administrator service account (Windows).

Step 1: Install SteamCMD

user@ubuntu
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y steamcmd
sudo adduser --disabled-password --gecos "" valheim
PowerShell (Windows Server)
mkdir C:\steamcmd
cd C:\steamcmd
Invoke-WebRequest -Uri https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip -OutFile steamcmd.zip
Expand-Archive .\steamcmd.zip -DestinationPath .
.\steamcmd.exe +quit

Step 2: Install the Dedicated Server (AppID 896660)

user@ubuntu
sudo machinectl shell valheim@
mkdir -p ~/valheim-server
steamcmd +force_install_dir /home/valheim/valheim-server \
+login anonymous \
+app_update 896660 validate \
+quit
PowerShell (Windows Server)
C:\steamcmd\steamcmd.exe +force_install_dir C:\ValheimServer ^
+login anonymous ^
+app_update 896660 validate ^
+quit

Step 3: Firewall Rules

Valheim uses three consecutive UDP ports: the base game port, the Steam query port, and an internal handshake port. All three must be open even with crossplay enabled.

user@ubuntu
sudo ufw allow 2456:2458/udp
sudo ufw reload
PowerShell (Windows Server)
New-NetFirewallRule -DisplayName "Valheim UDP" -Direction Inbound -Protocol UDP -LocalPort 2456-2458 -Action Allow

Step 4: Launch Script with -crossplay

The -crossplay flag tells the server to register with the PlayFab backend in addition to Steam. Without it, only Steam clients can discover and join. With it, the server appears in the unified community browser and Xbox players can join by entering the join code.

~/valheim-server/start_crossplay.sh
#!/bin/bash
export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970
./valheim_server.x86_64 \
-name "Vardoran Crossplay" \
-port 2456 \
-world "yggdrasil" \
-password "REPLACE_LONG_PASSWORD" \
-public 1 \
-crossplay \
-savedir /home/valheim/valheim-data \
-backups 4 \
-backupshort 7200 \
-backuplong 43200
export LD_LIBRARY_PATH=$templdpath
C:\\ValheimServer\\start_crossplay.bat
@echo off
set SteamAppId=892970
valheim_server.exe ^
-name "Vardoran Crossplay" ^
-port 2456 ^
-world "yggdrasil" ^
-password "REPLACE_LONG_PASSWORD" ^
-public 1 ^
-crossplay ^
-savedir "C:\ValheimData" ^
-backups 4 ^
-backupshort 7200 ^
-backuplong 43200

Make the Linux script executable with chmod +x start_crossplay.sh, then launch it under tmux or a systemd service so the server keeps running after you log out. On Windows, run the batch file from a service wrapper such as NSSM.

Step 5: World File Layout

Valheim stores every world as a pair of files inside the save directory you passed to -savedir. Lose one of them and the world is unrecoverable.

  • worlds_local/<world>.fwl is the world metadata (seed, version, name). Tiny, but the world cannot load without it.
  • worlds_local/<world>.db is the actual map data, building state, and player drops. Grows over time, this is the file you really care about.
  • worlds_local/<world>.fwl.old and .db.old are the most recent in process backups Iron Gate keeps automatically.
  • worlds_local/backup_short_* and backup_auto_* are the timestamped archives produced by the -backupshort and -backuplong flags.

Step 6: Safe Backup Workflow

Stop the server, or use a filesystem snapshot, before copying the live .db file. The server flushes writes on a tick boundary, so copying mid write produces an archive that loads as a partially corrupted world. The cleanest pattern is a daily cron that triggers a graceful shutdown, archives the world files, then restarts.

user@ubuntu
crontab -e
# Daily safe backup at 05:00
0 5 * * * systemctl stop valheim && \
tar -czf /opt/valheim/backups/yggdrasil-$(date +\%F).tgz \
/home/valheim/valheim-data/worlds_local && \
systemctl start valheim

Performance and Tuning

  • The Iron Gate binary is single threaded for world simulation. Prioritize CPU clock speed over core count.
  • Cap the server at 10 active players. The networking layer struggles to keep terrain streaming consistent above that.
  • Mirror the backups directory off-host nightly. A dead disk should never take the world with it.

Conclusion

SteamCMD plus a tight launch script is all Valheim needs. Add -crossplay to unify Steam and Xbox players through PlayFab, and pair it with a stop-archive-start backup window so the .fwl and .db files are always recoverable.