Which ports each game server needs

Default ports for FiveM, Minecraft, Rust, Source and CS2, ARK, SA-MP, and TeamSpeak, what each one carries, and how to open them.

Game servers5 min read

On this page
  1. The table
  2. Check what your server is actually listening on
  3. How to open them
  4. A closed query port makes a server invisible
  5. Related

One table, for the moment you need to know which port to open. Every entry is the default: if you changed a port in your own configuration, open the one you set, not the one listed here.

Each game's own guide covers the rest of running it: FiveM, Minecraft, Rust, and Source and CS2.

The table

GameProtocolDefault portWhat it carries
FiveMTCP30120HTTP endpoint, server list registration, and client file downloads
FiveMUDP30120Game traffic
FiveM (txAdmin)TCP40120Web admin interface. Restrict this by source
Minecraft JavaTCP25565Game traffic and the status ping the client list uses
Minecraft JavaUDP25565Query, only when enable-query=true
Minecraft JavaTCP25575RCON, only when enable-rcon=true. Restrict this by source
Minecraft BedrockUDP19132Game traffic over IPv4
Minecraft BedrockUDP19133Game traffic over IPv6
RustUDP28015Game traffic, set with +server.port
RustUDPwhatever you setSteam queries, set with +server.queryport
RustTCP28016RCON, set with +rcon.port. Restrict this by source
RustTCPwhatever you setRust+ companion app, set with +app.port, only if you use it
Source and CS2UDP27015Game traffic and Steam queries, on the same port
Source and CS2TCP27015RCON. Restrict this by source
Source and CS2UDP27020SourceTV, only when enabled
ARKUDP7777Game traffic
ARKUDP7778Raw socket traffic, Survival Evolved only, always the game port plus one
ARKUDP27015Steam queries
ARKTCP27020RCON. Restrict this by source
SA-MP and open.mpUDP7777Game traffic and queries, on the same port
TeamSpeak 3UDP9987Voice
TeamSpeak 3TCP30033File transfers
TeamSpeak 3TCP10011ServerQuery, raw. Restrict this by source

Notes on the awkward ones:

  • Minecraft Java's query is off by default. Nothing listens on UDP 25565 until you set enable-query=true in server.properties. Leave the port closed until you do.
  • ARK: Survival Evolved needs the game port plus one. Miss UDP 7778 and players get connection problems that look like nothing else on the list. Survival Ascended does not use that second port, so a fresh ASA server needs only the game port and the query port.
  • Rust's query port has no fixed default. Set it yourself with +server.queryport so you know which port to open. See Installing a Rust server on Linux.
  • Several games run more than one server per machine by incrementing these numbers. A second Source server on 27016, a second Rust on 28115, and so on. Each needs its own rules.

Check what your server is actually listening on

Before opening anything, ask the server. On Linux:

Shell
sudo ss -lntup

That lists every TCP and UDP socket in a listening state with the process that owns it. If your game is not in that output, the problem is the game server, not the firewall, and no rule will fix it.

How to open them

There are two firewalls between a player and your game server, and both have to allow the traffic.

Three things have to say yesA playerConnects to UDP 30120The network edgeAn inbound port rule, one per port andprotocol. FiveM on both TCP and UDP is tworules.The server's own firewallufw on Debian and Ubuntu, firewalld onRHEL, AlmaLinux and Rocky.The game, listeningsudo ss -lntupIf the game is not in this list, no rulewill fix it.The game server
Every one of these has to let the packet through. The two firewalls are yours to open, and the last check is whether the game is listening at all, which no rule can fix. Illustration.

At the network edge, add an inbound rule per port and protocol under Port rules. A rule is TCP or UDP, never both, so a service like FiveM that uses both on 30120 needs two rules. The rule is also where the packet-rate ceilings and protocol checks for that port live, see Rate limits.

Game presets opens the common set for a game in one action. That set is not everything in the table above. Most query ports, most RCON ports, SourceTV, txAdmin, and Rust+ are not part of a preset, so add those as rules of your own afterwards. Three presets go further: Rust's also opens RCON on TCP 28016, ARK's opens the query port on UDP 27015, and TeamSpeak 3's opens ServerQuery on TCP 10011 and file transfer on TCP 30033.

FiveMPresetTCP 30120UDP 30120Your rulesTCP 40120 txAdminMinecraft JavaPresetTCP 25565Your rulesUDP 25565 query, if enabledTCP 25575 RCON, if enabledMinecraft BedrockPresetUDP 19132Your rulesUDP 19133 IPv6RustPresetUDP 28015TCP 28016 RCONYour rulesUDP query, as you set itTCP Rust+, if usedSource and CS2PresetUDP 27015Your rulesTCP 27015 RCONUDP 27020 SourceTV, if enabledARKPresetUDP 7777UDP 27015 queryYour rulesTCP 27020 RCONSA-MP and open.mpPresetUDP 7777Your rulesNothing elseTeamSpeak 3PresetUDP 9987 voiceTCP 30033 filesTCP 10011 ServerQueryYour rulesNothing else
What each game’s preset writes, and the rules left to you. Three presets also write a port that is not for players: RCON for Rust, the query port for ARK, and ServerQuery for TeamSpeak 3. The ember ports are administrative, so narrow their sources whoever wrote the rule. Derived from the table above and the Game presets page.

On the server itself, the operating system's own firewall has to allow it too. On Debian and Ubuntu with ufw:

Shell
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp
sudo ufw status

On RHEL, AlmaLinux, and Rocky with firewalld:

Shell
sudo firewall-cmd --permanent --add-port=30120/tcp
sudo firewall-cmd --permanent --add-port=30120/udp
sudo firewall-cmd --reload

A closed query port makes a server invisible

This one is worth recognising on sight, because it does not look like a firewall problem.

Most of these games answer two different kinds of traffic. The game port carries players. The query port answers the small status request that server browsers, listing sites, and Discord status bots send to ask who is online and what map is running. On Source, SA-MP, and Minecraft Java, that is the same port as the game. On Rust and ARK, it is a different one.

If the query port is closed and the game port is open, the server works and is unfindable. Players who already have the address connect normally and everything inside the server is fine, but nobody sees it in the browser, listing sites show it as offline, and any status bot reports it down. The symptom is a healthy server that gets no new players.

Separate query port: Rust, ARKGame port openUDP 7777Players with the address connect normally.Query port closedUDP 27015Browsers, listing sites and status bots getno answer: not in the browser, shown asoffline.Same port: Source, SA-MP, Minecraft JavaOne port, both jobsUDP 27015 on SourcePlayers and status requests arrive at thesame port, so the rule that lets players inlists the server too.
Where the query port is separate, opening only the game port gives you a server that plays fine and lists as offline. Where the game answers queries on its own port, the one rule does both jobs. Illustration; ports from the table above.

So if a server is reachable by direct connect and missing from the listings, check three things in this order:

  1. The query port is open, at the edge and on the host firewall.
  2. The query port your server is actually using matches the one you opened. Set it explicitly in the launch arguments rather than trusting a default.
  3. For Source engine games, that you applied a game server login token. Without one the server never registers with Valve's list, whatever your ports say. See Running a Source engine server.

If players cannot connect at all, that is a different problem, and When players cannot connect is the page for it.

Need a server, or a hand with one?

Pick a plan to deploy a server, or open a ticket in the panel. Support runs 24/7/365.