Setting Up a Valheim Dedicated Server
Step 1 — Install SteamCMD
add-apt-repository multiverse -y
dpkg --add-architecture i386
apt update
apt install steamcmd lib32gcc-s1 -y
Step 2 — Create a User and Download Valheim
adduser steam
su - steam
steamcmd +force_install_dir ~/valheimserver +login anonymous +app_update 896660 validate +quit
Step 3 — Create a Startup Script
nano ~/start-valheim.sh
#!/bin/bash
export TERM=xterm
cd ~/valheimserver
./valheim_server.x86_64 -name "My Valheim Server" -port 2456 -world "Dedicated" -password "yourpassword" -public 1
chmod +x ~/start-valheim.sh
Step 4 — Open Firewall Ports
ufw allow 2456/udp
ufw allow 2457/udp
Step 5 — Start with screen
screen -S valheim ~/start-valheim.sh
Crossplay (PC + Xbox)
Add -crossplay to the startup script flags to enable crossplay with Xbox players.
Finding Your Server In-Game
In Valheim, go to Join Game → Add server and enter YOUR_SERVER_IP:2456.