NEW 📢 Limited launch offer: up to 70% off your first month on every game!See plans

Factorio ports and firewall explained

FactorioUpdated Nov 3, 20269 min read

A Factorio server uses one port for the game, over UDP. A second port is used only if you turn on RCON, the remote console for outside tools. On PlayNHost your ports are assigned and open for you, and players only need the Server Address from the Overview page.

Which ports does a Factorio server use?

PortProtocolFactorio defaultOn your PlayNHost serverWhere you see it
Game port: players connect hereUDP34197The Primary portServer Address on Overview, and Ports & Network
RCON port: outside admin tools connect hereNot stated by WubeNone listed by WubeA second port that comes with your server, used only when RCON is onRCON Port in Game Settings, and Ports & Network

The Factorio wiki says "Factorio servers use port 34197" and "Factorio uses UDP only", with its own reliable delivery built on top of UDP. Its command line page lists --rcon-port as "Port to use for RCON", with no default number.

The panel starts Factorio with --port and your Primary port every time. It adds --rcon-port and --rcon-password only when RCON Enabled? is on and RCON Port holds a number. So the game always listens on the port the panel shows, and RCON stays closed until you set it up.

Why is my Factorio port usually not 34197?

Each PlayNHost server gets its own port from the machine it runs on, so many servers can share one IP address without getting in each other's way. 34197 is the number Wube uses for a server you run yourself. Your server's number is usually different, so always give players the address and port the panel shows, never a number from a guide for home servers.

Where do I find the address and ports in the panel?

  1. Open your server in the panel. On the Overview page, find Server Address, for example 203.0.113.10:25568. Click the copy button next to it. This is the game port, and the only port players need.
  2. For the full list, click Ports & Network in the left menu. Under All ports, the row with the Primary badge, described as The port players connect to, is the game port.
  3. The second row is the port for RCON. Its number is the one in RCON Port: click the Settings tab above the page, then Game Settings, to compare.
The Overview page of a Factorio server with the copy button next to Server Address

The Join button on the same server card also copies the address.

How do players connect to a Factorio server on PlayNHost?

Players open Multiplayer in Factorio, choose Connect to address, paste the whole address with the port after the colon, and connect. They never type the RCON port. Once your server is listed publicly, they can also find it by its Server Name under Browse public games. The full steps are in How to join your Factorio server.

Can players join without typing the port?

Yes, if you own a domain name. Factorio reads DNS SRV records since version 1.1.67, the Factorio wiki says, so a name can carry your port. At your domain's DNS provider, point a name such as factory.example.com at your server's IP with an A record, then add an SRV record for _factorio._udp.factory.example.com with your game port and that name as the target. Players then type factory.example.com alone. The Nintendo Switch version does not read SRV records, so Switch players still type the address with the port. If your server's address ever changes, for example after a move to another location, update both records.

Do I need to open ports on my router or firewall?

No. The machine your Factorio server runs on accepts connections from the internet on the ports the panel gives to servers, for both TCP and UDP, and every port under All ports is one of them. The panel says so on that page: Every port accepts TCP and UDP. Your players' home routers let outgoing connections through, so they do not open anything either.

The port forwarding steps on the Factorio wiki are for a server you run at home behind your own router. With a hosted server they are not your job.

What does the firewall not allow?

Only the ports listed under All ports reach your server from outside. Anything that listens on a port of its own cannot be reached unless it uses one of them. If your plan includes extra ports, All ports shows Add a port. The machine chooses the new port's number, as the panel says: Port numbers are assigned by the machine your server runs on - you can name a port, but not choose its number. If there is no Add a port button, your plan includes no extra ports.

Can I change which port is the primary, or remove one?

Keep the game port as Primary. Make primary in a row's ... menu moves only the game port, and RCON Port keeps its number. Making the RCON row primary would move the game onto the RCON number, so the address your players use would change, and the game and RCON would share one number.

Do not use Remove port on the RCON row. On plans without extra ports the panel refuses it anyway; where it goes through, Factorio would still be started with that number when RCON is on, and a removed port goes back to the machine, where another server can get it.

How do I turn on the RCON port?

RCON lets outside tools, such as a Discord bot, run commands on your server. The panel's Console works without it.

  1. Click the Settings tab above the page, then Game Settings, and look at RCON Port.
  2. New Factorio servers come with a second port, and its number is already in RCON Port: it is the second row under All ports. Leave that number as it is. If RCON Port is empty, your server has no port for RCON yet: open a ticket and ask for one. Never enter the game port from Server Address.
  3. Enter an RCON Password, switch RCON Enabled? on, and restart the server.
The RCON Enabled?, RCON Port and RCON Password fields in Game Settings of a Factorio server

Your tool connects to the server's IP, the RCON Port and the RCON Password. The full steps are in How to turn on RCON for your Factorio server.

Common Factorio port problems and fixes

My server is not in Browse public games

The port is not the cause: Factorio lists a server only when it has your factorio.com Server Username and Server Token, and players must be signed in to factorio.com to browse the list. See How to list your Factorio server in the public server browser. If the Console shows Matching server connection failed, see Your Factorio server shows Matching server connection failed: Missing token. Players can always join with Connect to address in the meantime.

A friend cannot connect with the address

  • Copy the address again from Server Address. A missing port, a port from a guide for home servers or the RCON port is the most common cause.
  • Check that the badge says Online. The panel shows it once the Console prints Hosting game at.
  • School, work and public networks can block game ports. Ask the player to try another network.

Version and mod causes are in Factorio server problems and fixes.

My RCON tool cannot connect

  • Check that RCON Enabled? is on, RCON Port holds a number and RCON Password is set. With RCON Port empty, RCON stays off even with the switch on.
  • Check that the number in RCON Port is one of the rows under All ports. A number that is not listed there cannot be reached from outside.
  • Restart the server after any change: the panel adds RCON to the start line only when the server starts.
  • Use the RCON Port number in the tool, not the game port.

Good to know

Already hosting it somewhere else? Move your server to us

OUR LATEST BLOGS