To host a Valheim dedicated server that other players can join over the internet, you need to open TCP port 2456 and UDP ports 2456–2458 on your router. The game uses UDP for gameplay and TCP for the Steam query/join handshake, so forwarding all four ports to your server PC’s local IP address is the standard, working configuration.
Why Valheim Needs Specific Ports
Valheim’s dedicated server software listens on a small, fixed range of ports. Unlike some games that let you pick any number, Valheim defaults to 2456 as the base game port and then uses the next two numbers for additional communication channels. This is why you see the range 2456–2458 in most guides. The server also requires TCP 2456 for Steam’s client-to-server queries — this is how the game browser shows your server as online and lets players join directly from the Steam friends list or by IP.
If you only forward UDP, players may see the server as “not responding” or time out when trying to connect, even though the world is running. The TCP rule is often the missing piece in troubleshooting threads.
How Port Forwarding Works in This Context
Your router assigns each device on your local network a private IP address (like 192.168.1.10). When a player on the internet sends data to your public IP address on port 2456, the router doesn’t know which device should receive it. Port forwarding is a rule that says: “send any traffic arriving on port 2456 to 192.168.1.10:2456.”
You need to set this up for both TCP and UDP on each port in the range. Some routers let you specify a range (2456–2458) in one rule; others require you to create three separate rules for 2456, 2457, and 2458. Both approaches work as long as the protocol and port numbers match.
Step-by-Step: Forwarding Valheim Ports
These steps apply to most home routers. The exact menu names vary by brand, but the logic is the same.
- Set a static local IP for your server PC. In Windows, open Command Prompt and type
ipconfigto find your IPv4 address (e.g., 192.168.1.10). Then, in your router’s DHCP settings, assign that address as a static lease so it never changes. Alternatively, set a static IP in Windows Network Settings. - Log into your router’s admin page. Open a browser and enter your router’s gateway IP (usually 192.168.1.1 or 192.168.0.1). The username and password are often printed on the router label or in its manual.
- Find the Port Forwarding section. Look for “Port Forwarding,” “Virtual Server,” “NAT,” or “Applications & Gaming” in the router menu.
- Create a rule for TCP 2456. Enter the service name (e.g., “Valheim TCP”), the external port range (2456–2456), the internal port range (2456–2456), the protocol (TCP), and the server’s local IP address.
- Create a rule for UDP 2456–2458. Repeat the process, but set the protocol to UDP and the port range to 2456–2458. If your router doesn’t support ranges, create three separate UDP rules: 2456, 2457, and 2458.
- Save and apply the rules. Most routers require a reboot or at least a settings apply before the rules take effect.
- Test the connection. From a device outside your network (like a phone on cellular data), try to connect using your public IP and port 2456. You can also use an online port checker tool to verify the ports are open.
Choosing Between Dedicated Server and In-Game Host
Valheim offers two ways to play multiplayer: hosting from the main menu (peer-to-peer) or running a dedicated server. The port requirements differ slightly.
- In-game host: When you select “Host” from the main menu, your game client acts as the server. You only need to forward UDP 2456 and TCP 2456 — the game does not use 2457 or 2458 in this mode.
- Dedicated server: The separate
valheim_server.exeprocess uses the full range. Forward TCP 2456 and UDP 2456–2458 as described above.
If you’re using a dedicated server, also check the start_server.sh (Linux) or start_headless_server.bat (Windows) file. The default command line includes -port 2456. If you change this number, you must update your port forwarding rules to match the new port and the next two numbers after it.
Common Problems and Fixes
Even after forwarding ports correctly, players might still fail to join. Here are the usual culprits:
- Windows Firewall blocking the server. The first time you run
valheim_server.exe, Windows prompts you to allow it through the firewall. If you clicked “Cancel,” the server runs locally but is unreachable from outside. Go to Windows Defender Firewall > Allow an app through the firewall and add bothvalheim_server.exeandvalheim.exe(for the host mode). - Router’s UPnP conflicting with manual rules. Some routers automatically open ports via UPnP when the game starts. If you also have manual rules, they can conflict. Disable UPnP for Valheim or remove duplicate rules.
- Using the wrong public IP. Your public IP may change periodically unless you have a static IP from your ISP. Check it at the time of play. For a permanent solution, use a dynamic DNS service.
- Carrier-grade NAT (CGNAT). Some ISPs put customers behind a shared public IP, making port forwarding impossible. If your router’s WAN IP starts with
100.64.through100.127., you’re behind CGNAT. You’ll need to ask your ISP for a public IP or use a VPN service that supports port forwarding. - Server not listening on the correct interface. In the server’s config file (
valheim_servers.cfgor the command line), ensure-public 1is set if you want it to appear in the community list. If it’s set to 0, only direct IP connections work.
Port Forwarding vs. Alternatives
Port forwarding is the traditional method, but it’s not the only way to host a Valheim server.
- Port forwarding: Free, but requires router access and a public IP. Works well for small groups of friends.
- VPN (like Hamachi or ZeroTier): Creates a virtual LAN. Players install the VPN client and join as if they were on your local network. No port forwarding needed, but everyone must be on the same VPN network.
- Rented server: A hosting company runs the server for you. No router configuration at all — you just get an IP and port to connect to. Costs money but is the most reliable for large groups or 24/7 uptime.
- PlayIt or similar tunneling services: These give you a public URL that forwards to your local server without opening ports. They can be free but often have bandwidth limits.
Safety and Security Considerations
Opening ports exposes your home network to the internet. While Valheim’s server is generally safe, any open port is a potential entry point. Follow these precautions:
- Only forward the specific ports. Don’t forward a wide range like 1–65535. Use exactly 2456–2458 for UDP and 2456 for TCP.
- Keep the server software updated. Iron Gate releases patches that fix security and stability issues. Run the latest version.
- Use a strong server password. Set a password in the server config to prevent random players from joining.
- Consider a dedicated machine or VM. If you’re hosting frequently, run the server on a separate PC or a virtual machine with limited access to your main network.
- Monitor logs. Check the server log for unusual connection attempts. If you see repeated failures from the same IP, you can block it in your router’s firewall.
Frequently Asked Questions
Do I need to open TCP 2457 and 2458? No. Valheim only uses TCP for the Steam query on port 2456. The other ports are UDP-only. Forwarding TCP on 2457 and 2458 is unnecessary and may cause confusion.
Can I change the port number from 2456? Yes, you can specify a different base port with the -port argument when launching the server. If you set it to 3000, then you need to forward UDP 3000–3002 and TCP 3000. The game will still work, but players must enter the new port when connecting.
Why can I connect locally but not from the internet? Local connections bypass your router, so port forwarding isn’t tested. The issue is likely a missing UDP rule, a firewall block, or CGNAT. Double-check your router rules and test with an external port checker.
What if my router doesn’t have a port forwarding option? Some ISP-provided routers hide this feature. You can either log in as an admin and look for “Advanced Settings,” or contact your ISP to enable it. Alternatively, use a VPN or rented server.
Do I need a static public IP? Not strictly, but it helps. If your IP changes, players won’t be able to find your server. A free dynamic DNS service (like DuckDNS or No-IP) gives you a hostname that always points to your current IP.
Is UPnP enough? Valheim’s dedicated server does not automatically use UPnP in all configurations. Some community reports say it works, but it’s unreliable. Manual forwarding is the recommended method.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Valheim Server Not Showing in Community List Fixes
- Soundbar vs 2.1 Speaker System: Which Is Better?
- DisplayPort vs HDMI: Which Cable Should You Use?
- Survive Lava for Brainrot Tier List170 points
- MySQL Dump Import: Fix Common Errors
- Mouse Moving on Its Own? Causes & Fixes