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