Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Valheim Failed to Connect: Step-by-Step Fix

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide walks you through the most common causes of "failed to connect" errors in Valheim when joining a dedicated server or a friend’s world. You’ll learn how to check your network, adjust game settings, and verify server configuration so you can get back to building and exploring without further interruptions.

What You'll Need

  • Access to the Valheim game client (Steam version).
  • If you are the server host: access to the server machine’s firewall and router settings.
  • The server’s IP address and port (default is 2456).
  • Optional: a tool like Ping or Telnet (built into Windows/macOS) to test connectivity.

Step-by-Step

  1. Verify the server is online and reachable. Ask the server owner to confirm the server is running. If you are the host, check that the Valheim server process is active and hasn’t crashed. On the server machine, open a command prompt (Windows) or terminal (Linux/macOS) and run ping to see if the machine responds.
  2. Check the server’s IP and port. Valheim uses UDP port 2456 by default. If the server has a different port, you must enter it in the client as IP:port (e.g., 192.168.1.10:2457). Ensure you have the correct IP: for a local server, use the local IP (e.g., 192.168.x.x); for an internet server, use the public IP or a hostname.
  3. Test the port with Telnet or a port checker. On Windows, open Command Prompt and type telnet 2456. If the screen goes blank or shows a message, the port is open. If you get an error, the port is blocked. On macOS/Linux, use nc -vz 2456. Alternatively, use an online port checker tool (like yougetsignal.com) to test from outside the network.
  4. If you are the host, open the firewall. On the server machine, go to Windows Defender Firewall (or your OS firewall) and create an inbound rule to allow UDP port 2456 (or your custom port). If you have a router, log into its admin panel and forward UDP port 2456 to the server’s local IP address. Also, enable port forwarding for the Steam ports (UDP 2456-2458) if you are using Steam networking.
  5. If you are connecting from outside your LAN, ensure the public IP is correct. For a home server, your public IP changes periodically. Use a dynamic DNS service (like No-IP) to get a stable hostname. If you are using a VPN or a cloud server, use the provided IP/hostname.
  6. Disable any VPN or proxy on your client. VPNs can interfere with Valheim’s connection. Temporarily turn off your VPN and try again. If you must use a VPN, add Valheim to its split-tunnel exceptions.
  7. Check your game version. Ensure your Valheim client is updated to the same version as the server. In Steam, right-click Valheim, select Properties → Updates, and make sure it’s set to “Always keep this game updated.” If the server is on a different version, you may see a “version mismatch” error (which is distinct from a failed to connect).
  8. Try joining via the in-game server list. Sometimes direct IP fails due to a typo. In Valheim, click “Join Game,” then “Add Server” and enter the IP:port carefully. If the server is listed publicly, search for its name in the community tab.
  9. If you are the host, check the server’s configuration file. On the server machine, locate the start_server.sh (Linux) or start_headless_server.bat (Windows) script. Make sure the -port argument matches the port you are forwarding. Also, verify that the server is not set to “public” if you are using a private IP—set -public 0 for LAN-only, or -public 1 for internet.
  10. Restart everything. Restart the Valheim server, the client, and your router (if you are the host). A fresh start clears temporary glitches and updates ARP tables.

Common Mistakes

  • Using TCP instead of UDP. Valheim uses UDP only. Port forwarding that says “TCP” won’t work. Make sure the rule is set to UDP.
  • Wrong port number. The default is 2456, but many guides mention 2456-2458. The server uses 2456 for the game, but Steam uses 2457-2458 for matchmaking. Forward all three for best results.
  • Forgetting to forward the port on the router. You might open the firewall on the server, but if your router isn’t forwarding the port, external connections fail.
  • Using the wrong IP address. When connecting from the same network, use the server’s local IP (e.g., 192.168.1.5), not the public IP. Using the public IP from inside the network often fails due to NAT loopback issues.
  • Conflicting server instances. If you have two Valheim servers running on the same machine, they might be using the same port. Ensure each has a unique port.
  • Antivirus or firewall blocking the client. Even if the server is fine, your own firewall might block Valheim. Add Valheim to the allowed list in Windows Defender Firewall.

Tips

  • Use a static IP for the server. Set a static local IP for the server machine so port forwarding doesn’t break when the DHCP lease renews.
  • Test locally first. If you are the host, try connecting to the server using the local IP from another computer on the same network. If that works, the problem is likely port forwarding or the public IP.
  • Use a dedicated server tool. For larger groups, consider using a hosting service or a dedicated server manager like LGSM (Linux) or a Windows batch file. These handle port configuration automatically.
  • Update your router’s firmware. Outdated firmware can cause NAT issues. Check the manufacturer’s site for updates.
  • Check for server logs. The server console shows connection attempts. If you see “Failed to connect” in the logs, it’s likely a network issue. If you see nothing, the client isn’t reaching the server at all.

Troubleshooting

If you’ve followed all steps and still get “failed to connect,” try these additional checks:

  • Try a different client. Have a friend try to connect. If they succeed, the problem is on your end—check your firewall, VPN, or game files.
  • Verify game files. In Steam, right-click Valheim → Properties → Local Files → Verify Integrity of Game Files. Corrupted files can cause connection issues.
  • Disable IPv6. Some networks have IPv6 misconfigurations. Temporarily disable IPv6 on your network adapter (Control Panel → Network and Sharing Center → Change adapter settings → right-click your adapter → Properties → uncheck IPv6) and try again.
  • Check the server’s CPU/RAM. If the server is overloaded, it may reject connections. Monitor the server’s resource usage; if it’s at 100%, restart the server or upgrade hardware.
  • Contact your ISP. Some ISPs block incoming connections on common game ports. A quick call can confirm if port 2456 is blocked.
  • Use a different port. If you can’t get 2456 to work, change the server to port 2457 or 2458 (update the start script and port forwarding) and try that.

Frequently Asked Questions

Why does Valheim say “failed to connect” even when the server is online?

This usually means the client cannot reach the server’s IP/port due to network issues—firewall, port forwarding, or wrong IP. Double-check the IP and port, and test with a port checker.

Can I connect to a Valheim server over the internet without port forwarding?

No, unless you use a VPN or a hosting service. Port forwarding is required for direct connections to a home server.

What ports need to be open for Valheim?

UDP ports 2456-2458. Port 2456 is the game port, while 2457 and 2458 are used by Steam for matchmaking and networking.

Why can I connect to a server on my LAN but not from outside?

This indicates that port forwarding is not set up correctly, or your public IP is dynamic and has changed. Verify the router’s port forwarding rule and use a dynamic DNS service.

Does Valheim require a dedicated server to play with friends?

No, you can host a non-dedicated server by starting a world and inviting friends. However, dedicated servers are more stable and allow players to join even when the host is offline.

What does “Connection refused” mean?

It means the server is reachable but not accepting connections—either the port is wrong, the server is full, or the server is not running. Check the server’s status and port number.