Valheim Crossplay Server Deployment via SteamCMD
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
sudo dpkg --add-architecture i386sudo apt updatesudo apt install -y steamcmdsudo adduser --disabled-password --gecos "" valheimmkdir C:\steamcmdcd C:\steamcmdInvoke-WebRequest -Uri https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip -OutFile steamcmd.zipExpand-Archive .\steamcmd.zip -DestinationPath ..\steamcmd.exe +quitStep 2: Install the Dedicated Server (AppID 896660)
sudo machinectl shell valheim@mkdir -p ~/valheim-serversteamcmd +force_install_dir /home/valheim/valheim-server \ +login anonymous \ +app_update 896660 validate \ +quitC:\steamcmd\steamcmd.exe +force_install_dir C:\ValheimServer ^ +login anonymous ^ +app_update 896660 validate ^ +quitStep 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.
sudo ufw allow 2456:2458/udpsudo ufw reloadNew-NetFirewallRule -DisplayName "Valheim UDP" -Direction Inbound -Protocol UDP -LocalPort 2456-2458 -Action AllowStep 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.
#!/bin/bashexport templdpath=$LD_LIBRARY_PATHexport LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATHexport 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 43200export LD_LIBRARY_PATH=$templdpath@echo offset SteamAppId=892970valheim_server.exe ^ -name "Vardoran Crossplay" ^ -port 2456 ^ -world "yggdrasil" ^ -password "REPLACE_LONG_PASSWORD" ^ -public 1 ^ -crossplay ^ -savedir "C:\ValheimData" ^ -backups 4 ^ -backupshort 7200 ^ -backuplong 43200Make 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.
Server passwords are required and have rules
secret or changeme to production.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>.fwlis the world metadata (seed, version, name). Tiny, but the world cannot load without it.worlds_local/<world>.dbis the actual map data, building state, and player drops. Grows over time, this is the file you really care about.worlds_local/<world>.fwl.oldand.db.oldare the most recent in process backups Iron Gate keeps automatically.worlds_local/backup_short_*andbackup_auto_*are the timestamped archives produced by the-backupshortand-backuplongflags.
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.
crontab -e# Daily safe backup at 05:000 5 * * * systemctl stop valheim && \ tar -czf /opt/valheim/backups/yggdrasil-$(date +\%F).tgz \ /home/valheim/valheim-data/worlds_local && \ systemctl start valheimPerformance 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
backupsdirectory 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.