FiveM ports and firewall configuration
If players time out at “Connecting” while the server console looks healthy, a closed port is the most likely cause. FiveM needs very few ports, but it needs both TCP and UDP on the game port — and a couple of ports should never be reachable from the internet at all.
Short answer: Players connect on 30120 TCP and UDP (set by endpoint_add_tcp and endpoint_add_udp). txAdmin’s panel listens on 40120 TCP — restrict it to your own IP. Keep the database (3306) closed to the internet. To run several servers on one machine, give each its own game port and txAdmin port (TXHOST_TXA_PORT in txAdmin 8+). Test with http://your-ip:30120/info.json.

#The ports
| Port | Protocol | Used for | Open to |
|---|---|---|---|
| 30120 | TCP + UDP | Game connections, resource downloads, server info | Everyone |
| 40120 | TCP | txAdmin web panel | Only your IP (or VPN) |
| 3306 | TCP | MySQL / MariaDB | Nobody outside the machine |
| 22 / 3389 | TCP | SSH / Remote Desktop | Only you, ideally |
#Setting and changing the game port
endpoint_add_tcp "0.0.0.0:30121"
endpoint_add_udp "0.0.0.0:30121"Change the port only; keep 0.0.0.0 unless the machine has several network interfaces and you want a specific one. Players then connect with connect your-ip:30121.
Since txAdmin 8, txAdmin’s own port is set with the TXHOST_TXA_PORT environment variable (default 40120, and it cannot be 30120); the old +set txAdminPort convar is deprecated. Hosting panels usually set it for you.
#Firewall examples
ufw allow 30120/tcp
ufw allow 30120/udp
ufw allow from <your.ip> to any port 40120 proto tcp
ufw deny 3306New-NetFirewallRule -DisplayName "FiveM TCP" -Direction Inbound -Protocol TCP -LocalPort 30120 -Action Allow
New-NetFirewallRule -DisplayName "FiveM UDP" -Direction Inbound -Protocol UDP -LocalPort 30120 -Action AllowProviders often run a network firewall in front of your server too — open the ports there as well. At home, forward 30120 TCP and UDP on the router to your PC’s local IP.
#Testing the port
curl http://<server-ip>:30120/info.jsonA JSON response means TCP works. UDP cannot be tested this simply — if /info.json works but players still time out, UDP is blocked. Also check that sv_requestParanoia is not set so high that info requests are refused.
Questions
What port does FiveM use?
What port does txAdmin use?
How do I change my FiveM server port?
endpoint_add_tcp and endpoint_add_udp in server.cfg.Do I need to open the database port?
How do I run two FiveM servers on one machine?
Ready to pick a map?
Twelve themes on three base map styles, $8 each, instant download.