Ports, firewall and connecting
In short
When players cannot connect, or the server is missing from the list, the cause is almost always ports, the firewall or two missing convars.
| Port | Protocol | Purpose | Open to |
|---|---|---|---|
| 30120 | TCP + UDP | Game connections and the HTTP endpoints (info.json) | Everyone |
| 40120 | TCP | txAdmin web panel (TXHOST_TXA_PORT changes it in txAdmin 8+) | Only your IP, a VPN or a proxy |
| 3306 | TCP | MariaDB / MySQL | Nobody — bind to localhost |
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp
sudo ufw allow from YOUR.HOME.IP to any port 40120 proto tcp
sudo ufw allow OpenSSH
sudo ufw enableNew-NetFirewallRule -DisplayName "FiveM TCP" -Direction Inbound -Protocol TCP -LocalPort 30120 -Action Allow
New-NetFirewallRule -DisplayName "FiveM UDP" -Direction Inbound -Protocol UDP -LocalPort 30120 -Action Allow- Open
http://your-ip:30120/info.jsonin a browser — it should return JSON describing the server. - In FiveM press F8 and run
connect your-ip:30120. If this fails, port forwarding or the firewall is wrong. - Check that
sv_master1is commented out. - Confirm
sv_projectNameandsv_projectDescare set. - Wait — a new server can take up to 8 minutes to appear in the list.
- Behind a NAT or gateway that rewrites UDP source ports, the server may not list; check your router or firewall documentation.