Quick answer
Factorio servers use UDP port 34197, and Factorio uses UDP only, so a TCP forward does nothing. If friends can't connect by IP, forward UDP 34197 to the server, make sure no firewall or antivirus drops the UDP packets, and check that your router doesn't randomize the source port of outgoing packets from 34197. Every player needs exactly the same game version and mods. For a public listing, server-settings.json needs your factorio.com username and token. If you can't port forward, friends on Steam can join through a Steam invite instead.
Ports
34197UDP: Game. Change with--portor in the config file
How to fix it, step by step
- Forward UDP 34197. Reserve the server PC's local IP and forward UDP 34197 to it. If you started the server with
--port, forward that port instead and shareIP:port. - Allow it through firewall and antivirus. Allow factorio.exe (or the headless binary) and UDP 34197. The Factorio wiki calls out antivirus as a common blocker.
- Check source port randomization. Some routers randomize the source port on packets leaving 34197, which breaks connections. Turn that off or add a rule that keeps the port, per your router's manual.
- Match version and mods. Everyone needs exactly the same game version and mods. The game compares mod checksums on join.
- Pick how friends join. Connect to address with your public IP, Browse public games (needs a public listing), a Steam invite (the wiki's recommendation for playing with friends), or Play on LAN for people on your network.
- Behind CGNAT. If port forwarding can't work (see the CGNAT guide), use Steam invites, a virtual LAN such as Hamachi, or a rented server.
Headless server setup
Create a save with factorio --create ./saves/my-save.zip, then start with factorio --start-server ./saves/my-save.zip, or --start-server-load-latest --server-settings ./data/server-settings.json. Copy data/server-settings.example.json and edit the copy.
Getting into the public server list
- Set
visibilityto public in server-settings.json. - Fill in your factorio.com
usernameandtoken(the token is safer than a password; keep it secret). - Hidden servers can still be joined by IP. Set
game_passwordfor a join password. - A domain can point at a custom port with an SRV record
_factorio._udp.<name>(Factorio 1.1.67+, not on Switch).
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?
A Factorio server is light, but your PC has to stay on for the factory to keep running when you're not playing. A small hosted Factorio server stays online with its own public IP.
Related guides
- Satisfactory server: friends stuck or can't join?
- Friends can't join your Terraria server?
- Friends can't join your Minecraft server? Here's the fix.
- Behind CGNAT? Host a game server without port forwarding.
- All guides
Sources: wiki.factorio.com/Multiplayer
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.