portsfirewallnetworking9 min read · updated 9/11/2026

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.

FiveM Server Ports: 30120, 40120 and Firewall Rules Explained

#The ports

PortProtocolUsed forOpen to
30120TCP + UDPGame connections, resource downloads, server infoEveryone
40120TCPtxAdmin web panelOnly your IP (or VPN)
3306TCPMySQL / MariaDBNobody outside the machine
22 / 3389TCPSSH / Remote DesktopOnly you, ideally

#Setting and changing the game port

server.cfg — second server on 30121
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

Linux (ufw)
ufw allow 30120/tcp
ufw allow 30120/udp
ufw allow from <your.ip> to any port 40120 proto tcp
ufw deny 3306
Windows (PowerShell as Administrator)
New-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

Providers 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

From another machine
curl http://<server-ip>:30120/info.json

A 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?
30120, on both TCP and UDP.
What port does txAdmin use?
40120 TCP by default.
How do I change my FiveM server port?
Change the port in both endpoint_add_tcp and endpoint_add_udp in server.cfg.
Do I need to open the database port?
No. Keep 3306 closed; the server connects to the database locally.
How do I run two FiveM servers on one machine?
Give each a different game port (30120, 30121…) and a different txAdmin port.

Ready to pick a map?

Twelve themes on three base map styles, $8 each, instant download.