Quick answer
Valheim dedicated servers use UDP ports 2456 and 2457 (the -port value and the next one up). On the Steam backend (no -crossplay) you must forward both. With -crossplay the server uses a relay, so no port forwarding is needed, but LAN and loopback IPs don't work. If the server isn't showing up in the list, the list can take 5 to 10 minutes and needs -public 1; join directly with IP:2456 instead.
Ports
2456UDP: Game port (-port), used by in-game Join IP2457UDP: Game port + 1, Steam query / server browser
How to fix it, step by step
- Wait for "Game server connected". The world takes a minute or two to load. Connecting before the log says
Game server connectedfails. - Check the password rules. The password is case-sensitive, at least 5 characters, and must not be contained in the world name or seed. Otherwise the server logs
Error bad password:and doesn't start. - Pick the backend that fits your group. Everyone on Steam: leave out
-crossplayand forward the ports. Anyone on Xbox, PS5, Switch 2 or Game Pass: add-crossplay; no port forwarding is needed. Edit a copy of the start script, because Steam overwrites the original on update. - Forward UDP 2456-2457 (Steam backend). Forward the UDP range 2456-2457 to the server PC's reserved local IP, and allow the server through the firewall (tick every box in the Windows Firewall pop-up).
- Join by IP, not the list. In Valheim: Join Game, Join IP, then
public-ip:2456. In Steam's server browser favourites, use the query port (public-ip:2457). Hosted servers rarely use 2456, so use the exact address you were given. - Match versions. A dedicated server doesn't update itself on restart. Update it with SteamCMD (
app_update 896660 validate) and make sure players are on the same version. - Crossplay: use the current join code. The 6-digit join code changes every time the server restarts. Read the current one from the log or pause menu. Crossplay must be enabled on both the server and each player's game.
Why the server isn't showing up in the list
-public 0hides it on purpose. Use-public 1.- New servers can take 5 to 10 minutes to appear.
- The list is unreliable either way: join by IP or join code.
Mods and console players
Everyone needs the same mods at the same versions (r2modman helps), and mods must be updated for 1.0. Console players can't install mods, so a server with client-side mods excludes them. Adding anyone to permittedlist.txt blocks everyone who isn't on it.
Test it from the outside
Your own Wi-Fi can't tell you whether friends can reach the server. The free Server Doctor check contacts your server once from the internet, the way the game does, and tells you the most likely cause. The same check runs in Discord with /fix.
No PC to host 24/7?
Valheim worlds only exist while the server runs, so friends can't play when your PC is off. A hosted Valheim server stays online, and crossplay mode or a host means nobody has to touch a router.
Related guides
- Friends can't join your Minecraft server? Here's the fix.
- Minecraft Bedrock: "Unable to connect to world"
- Palworld friends can't join your dedicated server?
- Hytale friends can't connect to your server?
- Behind CGNAT? Host a game server without port forwarding.
- All guides
Sources: valheim.com/support/a-guide-to-dedicated-servers/ · valheim.com/support/crossplay-faq/ · low.ms/knowledgebase/valheim-troubleshooting-guide · valheim-server-help.github.io/howToConnect/ · playit.gg/