Port Configuration
Proper port configuration is essential for players to connect to your Factorio server. This guide covers everything you need to know about Factorio's network requirements.
Default Port Information
Factorio dedicated servers use port 34197 by default. Important details:
- Protocol: UDP only
- Default Port: 34197
- Configurable: Yes, can be changed in server settings
Changing the Server Port
- Open your server configuration file
- Locate the port setting in
server-settings.json - Change the value to your desired port:
{
"port": 34197
}
- Save the file and restart your server
Firewall Configuration
Windows Firewall
- Open Windows Defender Firewall
- Click "Advanced settings"
- Select "Inbound Rules" and click "New Rule"
- Choose "Port" and click Next
- Select UDP and enter port 34197
- Allow the connection and complete the wizard
Linux Firewall (UFW)
For Ubuntu/Debian systems using UFW:
sudo ufw allow 34197/udp
sudo ufw reload
Linux Firewall (firewalld)
For CentOS/RHEL systems:
sudo firewall-cmd --permanent --add-port=34197/udp
sudo firewall-cmd --reload
Router Port Forwarding
If you're hosting from behind a NAT router, you'll need to configure port forwarding:
- Access your router's admin panel (typically
192.168.1.1or192.168.0.1) - Find the "Port Forwarding" section (may be under "Advanced" or "NAT")
- Create a new port forwarding rule:
- Service Name: Factorio Server
- External Port: 34197
- Internal Port: 34197
- Protocol: UDP
- Internal IP: Your server's local IP address
- Save and apply the changes
Verifying Port Accessibility
To check if your port is properly configured:
- Start your Factorio server
- Use an online port checker tool for UDP ports
- Test connection from outside your network
Troubleshooting Common Issues
Players Cannot Connect
If players receive "Couldn't establish network communication" error:
- Verify firewall rules are active
- Check router port forwarding configuration
- Ensure you're using the correct external IP address
- Confirm the server is actually running and bound to the port
Connection Timeouts
If connections time out:
- Check if your ISP blocks UDP traffic on this port
- Verify no VPN is interfering with connections
- Ensure server performance is adequate
Advanced Configuration
Multiple Servers on Same Machine
To run multiple Factorio servers on the same machine:
- Configure each server to use a different port
- Forward each port separately in your router
- Create separate firewall rules for each port