Game server ports help guide · Updated 2026-10-19

Game server ports: what to forward, game by game.

Default ports and TCP vs UDP for Minecraft, Rust, CS2, Palworld, Valheim, ARK, Project Zomboid, Satisfactory and more, plus how to port forward correctly.

Quick answer

Most game servers need one or two UDP ports forwarded; Minecraft Java and Terraria use TCP. Defaults: Minecraft Java TCP 25565, Minecraft Bedrock UDP 19132, Rust UDP 28015 (+ query 28017), CS2 and Garry's Mod 27015 UDP + TCP, Palworld UDP 8211, Valheim UDP 2456-2457, ARK: Survival Ascended UDP 7777, Project Zomboid UDP 16261-16262, Satisfactory 7777 UDP + TCP and TCP 8888, Terraria TCP 7777, Enshrouded UDP 15637, 7 Days to Die 26900-26903, Factorio UDP 34197 and Hytale UDP 5520. Forward the exact protocol listed (TCP and UDP are separate rules), point it at a reserved local IP, and never open admin ports such as RCON or REST APIs to the internet.

How to fix it, step by step

  1. Find the port your server actually uses. Use the defaults below unless you changed them in the server's config or launch options. If you changed the game port, many games move the query port too, so check both.
  2. Reserve the server's local IP. In your router, give the server PC a fixed local IP (DHCP reservation). Otherwise the forward breaks the next time the PC gets a new address.
  3. Forward the exact protocol. Create a rule for each port with the protocol listed: UDP, TCP, or both. Choosing "TCP" for a UDP game is one of the most common reasons port forwarding doesn't work.
  4. Allow the server through the firewall. Allow the server program in Windows Defender Firewall (or open the ports in ufw/firewalld on Linux) on the network type you're on.
  5. Keep admin ports closed. RCON, REST APIs, web dashboards and telnet let anyone who finds them control the server. Leave them unforwarded unless you know you need remote admin, and then use a strong password.
  6. Check for CGNAT, then test from outside. If your router's WAN IP doesn't match your public IP, or starts with 100.64 to 100.127, forwarding can't work (see the CGNAT guide). Then test from mobile data or with the free outside check, not from your own Wi-Fi.

Default ports by game

  • Minecraft Java (full guide): 25565 TCP: Game port (server-port in server.properties) · 19132 UDP: Only if you run Geyser so Bedrock players can join.
  • Minecraft Bedrock (full guide): 19132 UDP: Game, IPv4 (set in server.properties) · 19133 UDP: Game, IPv6.
  • Palworld (full guide): 8211 UDP: Game traffic. Must be forwarded · 27015 UDP: Steam query / community server list · 8212 TCP: REST API. Never expose to the internet · 25575 TCP: RCON (deprecated). Don't expose.
  • Valheim (full guide): 2456 UDP: Game port (-port), used by in-game Join IP · 2457 UDP: Game port + 1, Steam query / server browser.
  • Hytale (full guide): 5520 UDP (QUIC): Game. Change it with --bind · 3478 UDP outbound: Friend-world connection coordination.
  • Counter-Strike 2 (full guide): 27015 UDP + TCP: Game traffic, pings (Steam query) and RCON. Set with -port · 27005 UDP: Client port (-clientport) · 26900 UDP outbound: Steam port (-sport).
  • Rust (full guide): 28015 UDP: Game (server.port). Needed to connect · 28017 UDP: Query (server.queryport). Needed to appear in the server browser; must differ from the game port · 28016 TCP: RCON (rcon.port). Don't open it to everyone · 28082 TCP: Rust+ companion app (app.port). Optional.
  • Project Zomboid (full guide): 16261 UDP: DefaultPort in servertest.ini. Players connect here · 16262 UDP: UDPPort, direct connection port · 27015 TCP: RCONPort default. Only if you use RCON; keep it closed otherwise.
  • Enshrouded (full guide): 15637 UDP: queryPort in enshrouded_server.json (the official default).
  • Terraria (full guide): 7777 TCP: Game (port= in serverconfig.txt, or -port).
  • 7 Days to Die (full guide): 26900 TCP: Game details query port (ServerPort) · 26900 UDP: Steam master server list · 26901 UDP: Steam communication · 26902 UDP: Game networking (LiteNetLib) · 26903 UDP: Currently unused, but forward it: leaving it closed may block joining · 8080-8081 TCP: Web dashboard and telnet. Only for remote admin; keep closed otherwise.
  • ARK: Survival Ascended (full guide): 7777 UDP: Game port. Players connect here · 7778 UDP: Peer port (game port + 1) · 27015 UDP: Query port, for Steam's server browser only · 27020 TCP: RCON. Optional; don't open it to everyone.
  • Garry's Mod (full guide): 27015 UDP + TCP: Game traffic, pings (Steam query) and RCON. Set with -port · 27005 UDP: Client port (-clientport) · 27020 UDP: SourceTV (+tv_port), only if you use it.
  • Satisfactory (full guide): 7777 UDP: Game traffic and Lightweight Query API (-Port=) · 7777 TCP: Server traffic and HTTPS API (-Port=) · 8888 TCP: Reliable messaging (-ReliablePort=). Required since 1.1.
  • Factorio (full guide): 34197 UDP: Game. Change with --port or in the config file.

TCP or UDP?

TCP and UDP are separate. A rule for TCP 7777 does nothing for UDP 7777. If a guide says "UDP + TCP", create both rules (or choose "Both" if your router offers it). Port checker websites usually test TCP only, so they report UDP game ports as "closed" even when they work; Server Doctor tests each game with its own protocol instead.

Ports labeled outbound

A few games list outbound ports (for example Hytale's UDP 3478 and CS2's Steam port). Those are connections your server makes out to the internet. You don't forward them; just make sure no firewall blocks outgoing traffic on them.

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?

If you'd rather not open ports on your home network at all, a tunnel (playit.gg), a VPN overlay every player joins, or a rented server avoids port forwarding entirely. A rented server also stays online when your PC is off.

Related guides

Sources: minecraft.wiki/w/Tutorial:Setting_up_a_Bedrock_Edition_server · rfc-editor.org/rfc/rfc6598 · valheim.com/support/a-guide-to-dedicated-servers/ · wiki.factorio.com/Multiplayer · playit.gg/

Still stuck? Get free help from real people in our Discord

Post your game, where it runs and what the check said in #help-forum. Other server hosts and the Server Doctor team can take a look. Free.

Join the Discord
FAQ

Game server ports questions, answered

Do game servers use TCP or UDP?

Most use UDP (Rust, Palworld, Valheim, ARK, Project Zomboid, Factorio, Minecraft Bedrock, Hytale). Minecraft Java and Terraria use TCP. Source games such as CS2 and Garry's Mod use UDP for game traffic and TCP for RCON on the same port, and Satisfactory needs both.

What port does a Minecraft server use?

Java Edition uses TCP 25565. Bedrock Edition uses UDP 19132 (and UDP 19133 for IPv6).

Why do port checker sites say my port is closed?

Most port checkers only test TCP and need a program answering on that port. For UDP games they almost always say "closed" even when friends can join. Use a check that speaks the game's own protocol.

Is it safe to port forward a game server?

Forwarding the game port itself is normal. Keep the server updated, and don't forward admin ports such as RCON, REST APIs or web dashboards unless you need them and they have strong passwords.

What if port forwarding still doesn't work?

Check that the protocol matches, the forward points at the right local IP, the firewall allows the server, and you aren't behind CGNAT or double NAT. Then test from outside your home network.

Server Doctor logo

Still stuck? Test it from the outside.

Enter the address your friends type. Server Doctor checks it from the internet and explains what's wrong. Free, no login.

Some hosting recommendations may use affiliate links, always disclosed. Learn more