Cross-platform multiplayer in Valheim allows players from Steam (PC), Xbox One, Xbox Series X/S, and Microsoft Store to share the same game world. To bridge network routing across diverse platforms, Iron Gate integrated Microsoft PlayFab Party backend services. Enabling crossplay modifies the server network stack: instead of using raw Steamworks sockets exclusively, the server registers its session with cloud relays and generates a session Join Code.
This article covers the core mechanics of Valheim crossplay, configuring systemd services with the -crossplay argument, firewall port management, and diagnosing PlayFab Join Code resolution failures.
Valheim crossplay architecture: Steam vs PlayFab#
By default, the Valheim Dedicated Server (Steam App ID 896660) operates over native Steamworks Networking via UDP on ports 2456–2457. In this direct configuration, clients send packets straight to the server public IP address.
Adding the -crossplay startup argument activates the PlayFab networking provider:
- The server initiates an outbound HTTPS/UDP handshake with Microsoft PlayFab authentication servers.
- A PlayFab Party tunnel establishes NAT punch-through mechanisms.
- The server receives a unique alphanumeric string known as the Join Code.
- Console players connect using this Join Code without needing direct static IPs or manual router port mapping.
Steam PC players can continue to connect directly via IP and port as long as firewall forwarding is configured.
Configuring startup flags and the -crossplay argument#
To enable crossplay on a dedicated Linux host, append -crossplay to the valheim_server.x86_64 execution command. Open the server systemd unit file:
sudo nano /etc/systemd/system/valheim.service
Ensure the ExecStart line specifies the world name, password, and the crossplay flag:
[Unit]
Description=Valheim Dedicated Server
After=network.target
[Service]
Type=simple
User=valheim
Group=valheim
WorkingDirectory=/opt/valheim
ExecStart=/opt/valheim/valheim_server.x86_64 \
-name "My Valheim Realm" \
-port 2456 \
-world "Dedicated" \
-password "SecretPassword123" \
-public 1 \
-crossplay
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Reload the systemd manager configuration and restart the service:
sudo systemctl daemon-reload
sudo systemctl restart valheim
On a modern server management platform, enabling crossplay and inspecting Join Codes is handled through an interactive dashboard toggle without manually modifying system unit definitions.
Firewall configuration and UDP port forwarding#
Although PlayFab employs relay nodes for NAT traversal, opening UDP ports 2456–2458 in the local firewall remains necessary to ensure low latency and direct connectivity for Steam players:
sudo ufw allow 2456:2458/udp comment "Valheim game and query ports"
sudo ufw reload
sudo ufw status verbose
If the server sits behind a router or cloud security group, forward ports 2456–2458 UDP to the local host address. Ensure the server has unimpeded outbound UDP access to standard PlayFab relay ranges (ports 30000–65535 UDP for STUN/media relay).
Extracting the Join Code and verifying session status#
Once the server boots with -crossplay, it reports registration status to the system journal. Extract the Join Code and session state using journalctl:
sudo journalctl -u valheim -e --no-pager | grep -i "playfab"
Look for confirmation messages:
Session "My Valheim Realm" with join code 123456 and IP <PUBLIC_IP>:2456 is active with 0 player(s)
The line:
PlayFab session registered: Trueconfirms that the server is successfully connected to the PlayFab cloud relay and is ready to accept PC and Xbox console players.
Troubleshooting console player connection failures#
- Server hangs on
PlayFab session registered: False: Check host DNS resolution and outbound HTTPS/UDP access to Microsoft endpoints:
nslookup title.mps.playfabapi.com
curl -I https://title.mps.playfabapi.com
Failed to connecterror when console players use Join Code: Join Codes regenerate every time the Valheim server process restarts. Verify players are using the code from the active session:
sudo journalctl -u valheim --since "10 minutes ago" | grep -oP 'join code \K[0-9A-Za-z]+'
- Disconnection after 30 seconds of gameplay on consoles: This typically indicates aggressive UDP connection tracking timeouts on the host or router firewall. Increase conntrack UDP timeouts:
sudo sysctl -w net.netfilter.nf_conntrack_udp_timeout=60
sudo sysctl -w net.netfilter.nf_conntrack_udp_timeout_stream=180




