Troubleshooting Gaming

Valheim dedicated server at home: ports, crossplay and CGNAT

What Iron Gate documents for hosting Valheim, from the 2456-2457 port range and the crossplay relay that skips forwarding to passwords and permitted lists, plus how to tell whether CGNAT will block you.

  • 9 sources cited
  • Checked
  • AI fact-checked, no human editor
  • Not tested hands-on
How we researched this
Based on
  • Iron Gate's Valheim support pages (A Guide to Dedicated Servers, Crossplay FAQ, Valheim 1.0 FAQ)
  • Iron Gate's Valheim FAQ page
  • Valheim's Steam store page (publisher-supplied requirements)
  • IETF RFC 6598 (shared address space for carrier-grade NAT)
  • Microsoft Support and Microsoft Learn pages (Windows Firewall app risks, netstat command, Wi-Fi 7 in Windows)
Sources checked
, 9 documents listed under Sources.
Testing
RouterHaus didn't test this hands-on.
Review
Its claims were checked against the sources listed below by an AI fact-checker working separately from the writer, on . No named human editor has reviewed it.
Independence
No manufacturer can buy a recommendation. Sponsored blocks, if any, are labelled and kept apart from our own content. Independence policy

The fix in brief

  • A Valheim dedicated server uses two ports. Iron Gate's guide: "The default Port Range that the Server uses is 2456-2457," and "Valheim uses the specified Port AND specified Port+1." It doesn't say UDP or TCP.
  • Crossplay servers need no port forward. Start the server with -crossplay and, per Iron Gate, it "transmits data via a relay server" and "does not require Port Forwarding to be accessible from outside of your local network."
  • Without crossplay, forward the range. Leave out -crossplay and "the Steam backend is used, which means only Steam users can see and join the Server," and the port you set "has to correspond with the Port Forwarding settings on your Router."
  • Check for CGNAT before you forward anything. If your router's internet (WAN) address is in 100.64.0.0/10, the range set aside for carrier-grade NAT, a forward on your router can't reach the server. A rented server avoids that, and crossplay, which needs no forward, should too (our inference; test it).
  • Lock the server down. Set a password, keep the admin list short, and remove the forward when you stop hosting. Iron Gate's permitted list is strict: adding one person "will ban everyone else from the server."
Illustration: a PC hosting a game server behind a home router and switch, with tags for the server's two ports and the crossplay relay option.
Illustration: RouterHaus

This guide covers hosting a Valheim server on a computer at home. For what CGNAT is and every way around it, see CGNAT explained; for the same job on another survival game, the Rust server hosting guide works through a four-port setup.

Three ways to host, and which one needs a forward

Only one of Valheim's hosting routes, a dedicated server on the Steam backend, needs you to open ports on your router.

Iron Gate's FAQ describes two starting points: "When starting the game you can create your own p2p-based play session that can be either public or private," or you can run a persistent server with the Valheim Dedicated Server application from Steam. source 3 Its dedicated server guide, dated April 11, 2024, then splits the dedicated route by backend. source 1

RouteWho can joinPort forwardFits when
Session started from the gameIron Gate's FAQ calls it a p2p-based session, public or private source 3Iron Gate's pages don't sayCasual play; Iron Gate's FAQ contrasts it with a persistent dedicated server
Dedicated server, Steam backend (default)"only Steam users can see and join the Server" source 1Yes: the port you set and the next one, 2456-2457 by defaultEveryone plays on Steam, your connection takes inbound traffic, and you want direct connections
Dedicated server, crossplay backend (-crossplay)"users from any platform" source 1No: data goes through a relay source 1Friends play on Xbox or the Microsoft Store version, or you're behind CGNAT (our inference, below)

Iron Gate's FAQ says "Servers are capped at 10 players." source 3 Its Valheim 1.0 FAQ (July 1, 2026) calls 1.0 "a game for 1-10 players," says "Valheim will support crossplay between all platforms," and lists Xbox One, Xbox Series X|S, PlayStation 5 and Nintendo Switch 2. source 4 The dedicated server itself runs on a computer: the crossplay FAQ says "You can’t set up a dedicated server on an Xbox." source 2

What Iron Gate documents: ports and protocol

Iron Gate documents one port setting, -port, and says the server uses that port and the one after it; it names no protocol.

The ports and the launch options that affect who can reach the server all come from "A Guide to Dedicated Servers," which describes itself as a guide "for Valheim (Steam version)". All pages here were read on December 5, 2026. source 1

SettingWhat Iron Gate saysNetwork effect
-port"has to correspond with the Port Forwarding settings on your Router"; the server uses "the specified Port AND specified Port+1"Default range 2456-2457. Forward both on the Steam backend.
-public"1 is default and will make the server visible in the browser"; 0 hides it, for a LAN server "where players can join via the local IP of the server"Listing only; a hidden server still answers anyone who has the address
-crossplay"Runs the Server on the Crossplay backend (PlayFab), which lets users from any platform join."Relay instead of a forward
-password"Set the password."The page sets no length or other rule
-instanceid"If you’re hosting multiple servers with the same port from the same MAC address," "write something unique here for each server to ensure that they get unique PlayFab IDs."Only for several crossplay servers on one machine

The protocol isn't stated. Iron Gate's guide doesn't say UDP or TCP anywhere. source 1 Rather than guess, you can ask the server machine. Microsoft's netstat reference says -a "Displays all active TCP connections and the TCP and UDP ports on which the computer is listening," -n shows port numbers numerically, and -o adds the process ID (PID), which you can match on the Processes tab in Task Manager. source 8 With the server running on Windows, open a Command Prompt and run:

  • netstat -ano | findstr :245

The | findstr :245 part is RouterHaus's shortcut, not from Microsoft's page: it keeps only lines containing ":245", so change it to the start of your own port if you changed it. On the lines for your two port numbers whose PID matches the server's process, the Proto column (TCP or UDP) is the protocol to forward. If you can't check, choosing "both" on the router opens more than the server may need (our caution, not Iron Gate's); crossplay, which needs no forward, is the tidier answer.

Two servers on one machine need ranges that don't overlap. By RouterHaus arithmetic from Iron Gate's "Port AND specified Port+1" rule (illustrative): a first server on 2456 uses 2456-2457, so a second set to 2458 uses 2458-2459, and each range gets its own forward.

Setting up a Steam-backend server with a forward

The Steam backend needs a fixed local address for the server, a forward for both ports, and the Windows Firewall prompt answered.

  1. Install the server. Iron Gate's guide has you show Tools in your Steam Library and install "Valheim Dedicated Server." source 1
  2. Edit a copy of the start script. Settings go in start_headless_server.bat (or start_server.sh on Linux). Iron Gate recommends a copy because "the original file will be reset each time it is updated in Steam" and you'd have to re-enter your settings. source 1 Set -name, -world, -password and -port there.
  3. Give the server machine a fixed address. Iron Gate's guide doesn't cover this; it's RouterHaus advice. A forward points at one local address, so a DHCP reservation on the router keeps the server on that address after a restart.
  4. Forward the range to that address: 2456-2457, or your -port and the next number. For the router's screens, Iron Gate says "Please refer to your router manual or ISP." source 1 Forward nothing else.
  5. Answer the firewall prompt. Iron Gate: "If you get a Windows Firewall-popup please fill all checkboxes to allow the Server to communicate with the Internet." source 1
  6. Wait for the ready message. When "Game server connected" appears, "the Server is up and running, ready to accept connections." Stop it with CTRL+C in the window, not the X, which Iron Gate says may leave it running in the background. source 1
  7. Test from inside, then from outside. See the test order below.

Iron Gate's guide doesn't mention UPnP, and the server is set up around a manual forward. UPnP lets software ask the router to open ports without you approving each one; it's convenient, and it's open to any program on your network, so it is neither always safe nor always dangerous. The UPnP security guide shows how to decide and check what it has opened, and NAT types explained compares UPnP, forwarding and DMZ. For a Valheim server, a reservation plus the one documented range is the narrower choice.

Crossplay: hosting without a forward

Adding -crossplay moves the server onto a relay, so you skip the forward, and players can join from Xbox and the Microsoft Store version as well as Steam.

Iron Gate's guide: "If you’re using the Crossplay backend, the server transmits data via a relay server," and the server "does not require Port Forwarding to be accessible from outside of your local network." Players connect with "the public IP address and port number, a join code or via the server list," and Iron Gate adds that "it’s not possible to connect using a local IP address or a loopback IP address." source 1 That last point catches people at home: on a crossplay server, players in the same house use the join code or the list, not the server's local address.

  • Join codes: the crossplay FAQ (February 7, 2025) says you'll "see a “Join code” by entering the pause menu," and a friend goes to "Join Game," presses "Add server" and pastes it. source 2
  • Xbox players can "join a dedicated server from an Xbox console just as normal," "provided that both your Xbox and the server have crossplay enabled." If the option is missing, Iron Gate says "you might need to adjust your parental control settings." source 2
  • PlayStation 5 and Switch 2: Iron Gate's 1.0 FAQ says "Valheim will support crossplay between all platforms" source 4; the Iron Gate pages cited here don't describe joining a dedicated server from those consoles separately.

Iron Gate's pages don't compare relay and direct connections for lag. In RouterHaus's reading, the relay matters most for one reason: Iron Gate says a crossplay server needs no forward to be reached from outside, so an inbound block such as CGNAT shouldn't stop players reaching it through the relay. That's our inference, not an Iron Gate statement; test it with a friend outside, using the join code or the server list, before you rely on it.

When outside players can't connect: CGNAT and double NAT

If players on your home network can join a Steam-backend server and nobody outside can, the forward probably isn't reaching the server because there's another NAT in the way.

  1. Outside player Connects to your public address on 2456
  2. Provider network Under CGNAT the public address is shared; nothing sends the connection on to you
  3. Provider gateway If it also routes, it's a second NAT your forward doesn't cover
  4. Your router The forward you set: 2456-2457 to the server's reserved address
  5. Valheim server Listening on the port you set and the next one
A forward only works for connections that reach your router. Carrier-grade NAT or a second routing box stops inbound connections earlier, whatever your router is set to. A crossplay server goes through a relay instead.

The two-minute check. Open your router's status page and note its internet (WAN) address:

  • 100.64.0.0 to 100.127.255.255: that's the 100.64.0.0/10 block that RFC 6598 sets aside as "Shared Address Space," designated for service providers "with the purpose of facilitating CGN deployment." source 6 You're behind CGNAT, and a forward on your router can't work.
  • A private address such as 192.168.x.x or 10.x.x.x: another router sits in front of yours. How to check for double NAT and its fixes cover getting down to one router.
  • Any other address that matches what a "what is my IP" site shows: your router has the public address, so the forward, the protocol or the server's firewall is the suspect.

The full CGNAT check covers the edge cases. Behind CGNAT your choices are crossplay, a rented server, or the general workarounds, which start with asking your provider for a public IPv4 address; reaching a home server behind CGNAT compares relays and tunnels.

Exposing a server safely

A forwarded port lets anyone on the internet reach the server's door, so the server's own access controls and a tidy firewall do the guarding.

  • Always set a password. Iron Gate's page gives no rule beyond "Set the password." source 1 RouterHaus's advice: make it long and unique, and don't reuse one from another account.
  • Use the role lists. Three files in the save folder, adminlist.txt, bannedlist.txt and permittedlist.txt, take one Platform User ID per line; Iron Gate says to "Add one Platform User ID per line to set desired roles." A permitted list is the strictest control, because "adding a person on the permitted list will ban everyone else from the server." source 1 Keep the admin list to people who need it.
  • Hiding from the list isn't protection. -public 0 only keeps the server out of the browser; anyone with your address and port can still try it. A password and the permitted list do the work.
  • Allow only the server through the PC's firewall. Microsoft says opening a port "makes your device less secure and might create opportunities for hackers or malware," and advises "Only allow an app or open a port when you really need to," and to remove apps or "close ports that you no longer need." source 7
  • Remove the router forward when you stop hosting (our advice). An open forward points at whatever is listening on that address later. The firewall checklist's inbound section covers what else to keep closed.
  • Prefer crossplay if you'd rather open nothing. It needs no inbound forward at all, by Iron Gate's description. source 1

Wired or Wi-Fi for the server and players

Put the server machine on a cable; Iron Gate's pages say nothing about Wi-Fi, so this is RouterHaus's advice, not the maker's.

A server answers every player at once, and a wireless link adds variable delay that every player shares. Valheim's Steam page lists a "Broadband Internet connection" in its recommended requirements and gives no upload figure. source 5 Iron Gate's server guide gives no RAM, CPU or bandwidth figures either; its only stated minimums are Linux library versions (GLIBC_2.29 and GLIBCXX_3.4.26), with Docker offered as an alternative to upgrading older systems. source 1 Since a home server sends to up to ten players over your upload, what upload speed does is worth a read if your plan is asymmetric.

For a player's gaming PC that stays put, a cable is still first choice; Wi-Fi is a reasonable alternative only with Wi-Fi 7 on both the router and the device, close to the router; on Windows, Microsoft says "Wi-Fi 7 is available starting with Windows 11, version 24H2." source 9 Ethernet vs Wi-Fi for gaming covers the decision and the evidence.

A safe test-first order

Each step rules one suspect in or out, so you change only what's broken.

  1. Read the console. No "Game server connected" means the server itself isn't up yet; fix that before touching the router.
  2. Check the WAN address for CGNAT or double NAT (above). If it's CGNAT, try crossplay or a rented server rather than forwarding.
  3. Join from inside your home. On the Steam backend, use the server's local address with the port; on crossplay, use the join code. If this fails, the server or its firewall is the suspect, not the router.
  4. Check what the server listens on with the netstat command, then make sure the forward uses that protocol and range.
  5. Have a friend outside join by your public address and port. Works: you're done. Fails while the inside join works: the forward, the protocol or another NAT.
  6. Measure the connection under load from the server machine, then again while players are on.
What you seeWhat it points to
Players at home join, nobody outside canCGNAT, double NAT, the forward or its protocol: CGNAT and double NAT
Nobody can join, even at homeThe server or the PC's firewall: setup steps
Crossplay players at home can't join by local addressExpected: Iron Gate says crossplay doesn't take a local IP; use the join code
An Xbox friend can't find the serverThe server needs -crossplay, and the console needs crossplay enabled: crossplay
Latency steady when idle, jumps under loadBufferbloat: the SQM guide

Network Health measures the path from that machine to the internet, not to each player, so a good result there and a laggy server points at the players' own connections or the distance between you. If you host other games as well, the server ports for other online games lists what each maker documents.

When a rented server is the better route

Iron Gate runs no servers of its own (its FAQ: "Iron Gate does not provide any official servers"), so if home hosting doesn't fit, the alternative is a server you rent. source 3

In RouterHaus's view, renting makes sense when:

  • The world should run all the time and you don't want a home PC on day and night.
  • You're behind CGNAT and crossplay isn't an option for your group, or your provider won't give you a public address.
  • Your upload is small and the household's video calls and uploads already fill it.
  • You'd rather not open anything on your home network at all.

Before renting, check that the host lets you set the same options this guide covers (password, the role lists and crossplay), since those are Iron Gate's controls, not the host's.

When new equipment is actually justified

Hosting Valheim rarely needs new hardware: crossplay, a reservation, a forward or a call to your provider fixes most problems for nothing.

  • Your router can't set forwards or reservations. Most can; check the manual first, as Iron Gate suggests.
  • Bufferbloat under load and no SQM on the router. Check that a replacement's maker documents SQM; router rankings are a starting point.
  • CGNAT. No router fixes it; the routes are a public address from the provider, a rented server, or crossplay (our inference; test it).
  • The server can't reach a cable where it lives. Options when you can't run a cable compares the routes.

A "gaming router" label changes none of these (gaming router vs standard router), and RouterHaus doesn't recommend gaming VPNs or boosters; Iron Gate's server guide mentions neither.

When to get help

Call your provider when the WAN check shows CGNAT and you want a public IPv4 address, or when your router sits behind a provider gateway you can't put into bridge mode. For game-side problems, Iron Gate's support pages are the place to start. source 1

If the fix is a cable run to where the server lives, or Wi-Fi coverage where cable can't reach, RouterHaus can help plan the wiring or Wi-Fi and connect you with a contractor licensed where local rules require it; start at a network consultation.

Frequently asked questions

What ports does a Valheim dedicated server use?

Iron Gate's guide says the default range is 2456-2457 and that Valheim uses the port you set with -port and the next one. It doesn't name UDP or TCP; with the server running on Windows, netstat -ano shows which protocol it listens on.

Do I need to port forward for a Valheim server?

Only on the default Steam backend. A server started with -crossplay uses a relay, and Iron Gate says it does not require port forwarding to be reachable from outside your local network.

Can I host a Valheim server behind CGNAT?

Not with a plain port forward, because inbound connections stop at your provider. A public IPv4 address from your provider or a rented server are the routes; crossplay, which uses a relay instead of a forward, should work too in RouterHaus's reading, but Iron Gate doesn't say so, so test it. Check your router's WAN address first: one in 100.64.0.0/10 means CGNAT.

Why can't my friend at home join my crossplay server by local IP?

Iron Gate says a crossplay server can't be reached by a local or loopback IP address. Use the join code from the pause menu, the server list, or your public IP address and port.

How many players can join a Valheim server?

Iron Gate's FAQ says servers are capped at 10 players.

Sources

Read on December 5, 2026. Page dates are given where the page shows one.

  1. Iron Gate: A Guide to Dedicated Servers, Valheim (April 11, 2024)
  2. Iron Gate: Crossplay FAQ, Valheim (February 7, 2025)
  3. Iron Gate: Valheim FAQ (multiplayer, servers and player cap; no date shown)
  4. Iron Gate: Valheim 1.0 FAQ (July 1, 2026)
  5. Steam: Valheim store page (system requirements, supplied by the developer and publisher)
  6. IETF RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space (April 2012)
  7. Microsoft Support: Risks of Allowing Apps Through Windows Firewall (Windows 11 and Windows 10)
  8. Microsoft Learn: netstat command reference (last updated September 8, 2026)
  9. Microsoft Support: Faster and more secure Wi-Fi in Windows

Your privacy choices

RouterHaus uses Google Analytics to understand which pages help people. We don't sell personal information. Advertising cookies are off.

Until you save a choice here, analytics cookies are off for visitors in the EEA, UK and Switzerland and in browsers that send Global Privacy Control; elsewhere they're on. When they're off, Google may still receive cookieless pings without identifiers. A choice you save here applies in this browser wherever you are, and your analytics choice applies even if the browser sends Global Privacy Control.

Details are in our privacy policy.