FiveM Port Forwarding: Open 30120 TCP and UDP
FiveM port forwarding step by step: open 30120 TCP and UDP in the firewall and router, test from outside, and fix CGNAT, txAdmin and "Could not bind" errors.
- Applies to
- FiveM Legacy and FiveM for GTAV Enhanced servers on Windows and Linux; txAdmin v8.1.2 (October 23, 2026) endpoint checks; Windows Firewall and Ubuntu ufw
- Last verified
On this page
- Direct Answer
- Why FiveM Needs Port 30120 on Both TCP and UDP
- Ports a FiveM Server Uses
- Check the endpoint_add_tcp and endpoint_add_udp Lines First
- How to Port Forward a FiveM Server, Step by Step
- Port Forwarding on a VPS, Dedicated Server or Game Host
- Change the Port or Run Two FiveM Servers on One Machine
- Fix “Could not bind on 0.0.0.0:30120 - is this address valid and not already in use?”
- Troubleshooting
- Next Steps
Direct Answer
FiveM port forwarding lets players outside your network reach the server’s game port, 30120 by default, on both TCP and UDP. FXServer opens it through the endpoint_add_tcp and endpoint_add_udp lines in server.cfg, and a join fails when a firewall or router passes only one protocol. To fix it, keep both lines on the same port, allow inbound TCP and UDP 30120 in Windows Firewall or ufw, forward both protocols on the router to the server’s LAN address, then test from another network with http://<public-ip>:30120/info.json and an F8 connect. A router WAN address in 100.64.0.0/10 means the ISP’s carrier-grade NAT, where a forward cannot work.
Why FiveM Needs Port 30120 on Both TCP and UDP
The official Proxy Setup page lists the steps a FiveM client takes to join a server. The steps fall into two halves, both aimed at the same port:
- TCP (HTTP) first. The client fetches
/info.json, sends aninitConnectrequest toPOST /clientand gets a connection token back. It then asks for the server endpoints (getEndpoints) and the configuration (getConfiguration), which leads to resource downloads under/files/. - UDP second. The client sends a UDP info request, then an ENet connect request and a UDP handshake. Only when those are accepted does the game start loading.
An open TCP port with blocked UDP therefore lets the first half succeed while the join stalls later. FXServer serves the HTTP routes, /info.json and /client included, on the interfaces set by endpoint_add_tcp, while endpoint_add_udp creates the UDP host.
Every request in that list starts from the player’s game, so players never forward ports themselves. Outbound traffic is not the usual problem either: Windows Firewall allows all outbound traffic unless a rule prohibits it, and ufw installs with a default outgoing policy of allow. You need inbound rules on the server side only.
What changed in 2026: Cfx retired its *.users.cfx.re reverse proxy, called Nucleus. A staff update on March 30, 2026 moved the shutdown to June 30, 2026 and said that anything which used to resolve through the Nucleus URL falls back to the server’s actual connectEndpoint. For most servers the join path did not change. An earlier reply in the same thread said that very few servers used the proxy for the server listing, probably only those that set sv_forceIndirectListing without providing the endpoint they wanted, and that all FXServer HTTP routes, /info.json and /client included, stay available through the endpoint_add_tcp interfaces. Unless you run your own proxy in front, players reach your server’s address directly, so TCP 30120 has to be reachable, not only UDP.
Ports a FiveM Server Uses
| Port | Protocol | What listens | Who must reach it |
|---|---|---|---|
| 30120 (default) | TCP | FXServer HTTP routes: /info.json, /client, endpoints, configuration, /files/ | Players |
| 30120 (same number) | UDP | FXServer game connection: UDP info request, ENet connect and handshake | Players |
| 40120 | TCP | The txAdmin web panel, default of TXHOST_TXA_PORT | Only you, and only to manage txAdmin from another machine |
| 40120 to 40150 | TCP or UDP game endpoints | Reserved: txAdmin rejects game endpoints in this range | Nobody |
Cfx infrastructure also contacts your server. It polls game servers from a published set of addresses to collect the data the server browser shows, such as player counts. The list is https://static.cfx.re/ips.txt. If you restrict who may reach your server, by remote address or with a DDoS filter, allow every address in that file. Filtered and proxied setups are covered in FiveM DDoS protection and proxy setup.
Check the endpoint_add_tcp and endpoint_add_udp Lines First
The example server.cfg in the official vanilla setup guide opens the game port with these lines:
# Only change the IP if you're using a server with multiple network interfaces, otherwise change the port only.
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
Four rules apply on FiveM Legacy and FiveM for GTAV Enhanced alike:
- Use the same port for both protocols. txAdmin will not start a server unless one
ip:portappears in both anendpoint_add_tcpand anendpoint_add_udpline. Its error ends with “Players would not be able to connect.” - Write one line per protocol and interface. txAdmin rejects the same command twice for one interface, and on FiveM for GTAV Enhanced each command supports only a single endpoint.
- Keep the game port outside 40120 to 40150. txAdmin reserves that range for itself.
- Forward the same port number you bind. When no primary port (
netPort) is set, FXServer takes it from the firstendpoint_add_tcpline, and the server-commands reference says this port is used by the heartbeat for the master list entry; FXServer’s heartbeat code sends it as the server’sport. If the router maps a different outside port, the server list is told the inside port instead of the one that is open.
On a game server host, the provider may pin the port with txAdmin’s TXHOST_FXS_PORT variable, which forces FXServer to bind to that port by enforcing or replacing the endpoint_add_* commands. Any other port then fails with “the endpoint_add_tcp port MUST be” followed by the required port. Use the port the host gives you; forwarding is the host’s job there.
How to Port Forward a FiveM Server, Step by Step
These steps assume a server at home behind a router. On a VPS or dedicated server, skip steps 3 to 5 and read the section after this one.
1. Confirm FXServer Is Listening on Port 30120
Start the server, then open http://127.0.0.1:30120/info.json in a browser on the server machine itself; on a machine without a browser, use the socket checks below instead. The server-issues page says it should return a JSON object containing your server’s info. If it does not load, nothing from outside will work either. The vanilla setup page notes one cause for a server started by hand: if no resources start and you cannot connect (“timed out” or “connection refused”), the server was started without +exec.
To see which program holds the port on Windows, run these in PowerShell:
Get-NetTCPConnection -LocalPort 30120
Get-NetUDPEndpoint -LocalPort 30120
Both cmdlets filter by local port, and their OwningProcess value is the PID of the program that owns the socket. On Linux, ss lists TCP (-t) and UDP (-u) listening sockets (-l) with their processes (-p) in numeric form (-n):
sudo ss -tulpn 'sport = :30120'
2. Allow Inbound TCP and UDP 30120 in the Server’s Firewall
Windows (Windows Firewall). Open PowerShell as administrator and add one rule per protocol:
New-NetFirewallRule -DisplayName "FiveM 30120 TCP" -Direction Inbound -Protocol TCP -LocalPort 30120 -Action Allow
New-NetFirewallRule -DisplayName "FiveM 30120 UDP" -Direction Inbound -Protocol UDP -LocalPort 30120 -Action Allow
Each rule takes one protocol: Microsoft’s reference says that when a port is given as a number, -Protocol must be set to TCP or UDP. Without -Profile, the rule applies to the Domain, Private and Public profiles, because the default is Any. A port rule also covers both server builds, whose executables differ: FXServer.exe on Legacy and cfx-server.exe on Enhanced.
To create the same rules in the console, press Start, type wf.msc and press Enter. Select Inbound Rules, then Action and New rule. Choose Custom, keep All programs, set the protocol to TCP with local port 30120 on the Protocol and Ports page, leave Scope as it is unless you want to limit the rule to certain remote addresses, choose Allow the connection, select the profiles, then name the rule and select Finish. Repeat for UDP. Microsoft notes that an inbound rule typically needs only the local port.
Ubuntu (ufw). ufw is Ubuntu’s default firewall configuration tool:
sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp
sudo ufw status
The manual adds that ufw allow with a port and no protocol opens TCP and UDP together. ufw starts out disabled, so if sudo ufw status reports it inactive, ufw is not what blocks your players. On a remote machine, allow SSH before you run sudo ufw enable. The manual warns that enabling ufw flushes its chains and may drop existing connections such as SSH, and it suggests adding ufw allow proto tcp from any to any port 22 first. The Linux guide linked under Next Steps covers the rest of a Linux install.
3. Give the Server a Fixed Address on Your Network
A port forward points at one internal IP address. On Windows, ipconfig without parameters shows each adapter’s IPv4 address, subnet mask and default gateway. On Linux, ip address show lists the addresses. Write down the server’s IPv4 address and its default gateway.
The default gateway must be the router you will forward on. Netgate’s troubleshooting guide explains that a host with a different gateway sends its replies out through that other router, where they are dropped or arrive from the wrong address.
If the router assigns addresses by DHCP, reserve the server’s address in the router’s DHCP settings. Netgate calls these static mappings: they set the preferred IP address for a device based on its MAC address. Without one, the forward can end up pointing at another device after the server gets a new address.
4. Forward TCP and UDP 30120 on the Router
Router screens differ by brand, and so does the name of the feature: Netgate notes that port forwarding is also known as “Destination NAT” or “Inbound NAT”. Whatever the screen is called, it needs four values:
| Field | Value |
|---|---|
| Protocol | TCP and UDP; create two rules if the router takes one protocol per rule |
| External port | 30120, or whichever port your endpoint lines use |
| Internal IP | The server’s LAN address from step 3 |
| Internal port | The same number as the external port |
Forward only the game port. A forward exposes only the ports and protocols in its rule, and Netgate adds that the target machine must still protect forwarded services with its own host-based controls. Players never need 40120.
5. Rule Out a Second Router or Carrier-Grade NAT
A forward only works on the device that holds your public address. Compare the WAN (internet) address on your router’s status page with your public IP as seen from outside. The Cfx support article on server visibility suggests canyouseeme.org for finding your public IP.
| Router WAN address | What it means | What to do |
|---|---|---|
| Same as your public IP | Your router is the edge device | Go on to step 6 |
| In 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 | Private-Use space (RFC 1918): another router sits in front of yours | Forward on that edge router too, toward your router, or switch the edge device to bridge mode |
| In 100.64.0.0/10 | Shared Address Space (RFC 6598), which ISPs use for carrier-grade NAT (CGN) | You cannot forward on the ISP’s NAT; ask the ISP for a public IPv4 address, or host the server on a machine that has one |
| Public, but not the address outside sites see | Translation happens upstream of your router | Treat it like CGN and ask the ISP |
The double-NAT row follows Netgate, which says the forward must also be entered on the edge router and that some upstream gear can switch to a bridge mode to remove the double NAT. The CGN rows follow RFC 6598: it lists peer-to-peer applications that cannot seed content “due to the inability to open incoming ports through the CGN”, and notes that an outside address can be globally unique yet not reachable from the internet behind a CGN.
6. Test From Outside Your Network
Netgate’s rule is to always test port forwards from outside the network, for example from a cellular device. A forward on the router’s external side does not work for local clients without NAT reflection, which Netgate says many firewalls do not implement. Run the official checks in this order:
- info.json from outside. On a phone using mobile data, or a PC on another network, open
http://<public-ip>:30120/info.json. A JSON object means TCP passes your firewall and your router. - Port check. Enter your port at canyouseeme.org, the service the docs suggest. It confirms whether the port is visible from outside, which also requires FXServer to be running.
- Direct connect. On a FiveM client on another network, press F8 and run
connect <public-ip>:30120. This is the only check that runs the whole join, UDP steps included. If it fails, the docs name incorrect port forwarding or a firewall blocking connections as the likely cause.
Port Forwarding on a VPS, Dedicated Server or Game Host
- VPS or dedicated server. There is normally no home router in the path, so there is nothing to forward: steps 1, 2 and 6 are the whole job. If your provider also runs a firewall in front of the server, open TCP and UDP 30120 there as well.
- Several network interfaces or public IP addresses. The docs’ comment says to change the IP in the endpoint lines only on a server with multiple network interfaces; there, put the address players should use in both lines. The Proxy Setup page adds that
sv_listingIpOverrideis only needed when the server list cannot guess which IP to query, usually on systems with multiple IPs or when the server is firewalled off for all hosts except a server proxy. - Game server host. The provider handles forwarding and may lock the port with
TXHOST_FXS_PORT. Connect with the address and port the host shows you.
Change the Port or Run Two FiveM Servers on One Machine
Two servers cannot share 30120. Give the second server its own port, for example 30121, on both endpoint lines, and open and forward 30121 TCP and UDP the same way:
endpoint_add_tcp "0.0.0.0:30121"
endpoint_add_udp "0.0.0.0:30121"
Players must then include the port, as in connect <public-ip>:30121. Per the Proxy Setup page, a bare host or IP in a connect command resolves to port 30120, while host.example:30121 resolves to 30121.
If both servers run under txAdmin, each txAdmin also needs its own panel port through TXHOST_TXA_PORT, whose default is 40120 and which cannot be 30120. The txAdmin docs strongly encourage separate txData folders for separate servers, since the admins.json file would otherwise conflict. Setting the panel port is covered in txAdmin login problems and port 40120.
Fix “Could not bind on 0.0.0.0:30120 - is this address valid and not already in use?”
FXServer prints this message when it cannot create the UDP host for an endpoint_add_udp line, and in FXServer’s source it is a fatal error, so the server stops. The TCP listener has its own messages: Could not bind MultiplexTcpServer to followed by the address, and Listening on socket failed - libuv error followed by libuv’s error name. libuv documents UV_EADDRINUSE as “address already in use”. When txAdmin runs the server, the same failure appears in its console as:
Detected FXServer error: Port 30120 is busy! Setting backoff delay to 5s.
txAdmin then waits longer before each new attempt: the delay grows by 5 seconds per bind error, up to 45 seconds. The message itself names the two causes.
- The port is already in use. The holder can be another FXServer, such as a copy started by hand next to txAdmin or an earlier process that did not exit, or any other program bound to that port. Find it with the commands from step 1, or with
netstat -a -n -o. That lists the ports the computer listens on, TCP and UDP, with the process ID (PID), which you can look up in Task Manager. Stop that process, or move one server to another port. - The address is not valid on this machine. txAdmin checks each endpoint address before starting and reports “the
endpoint_add_udpinterface” followed by the address and “is not available for this host.” Behind a router, your public IP belongs to the router, not the server, so it does not belong in an endpoint line. Keep0.0.0.0, or use an address thatipconfigorip address showlists.
Troubleshooting
Friends Can’t Join My FiveM Server, but I Can
You most likely join through 127.0.0.1 or a LAN address. 127.0.0.0/8 is the loopback range, so a test against 127.0.0.1 only proves the server runs; it says nothing about the firewall or the router. Friends outside your home need your public IP, with TCP and UDP open and forwarded (steps 2 to 6). Friends on your own network should connect to the server’s LAN address, because the router’s forward does not apply to local clients without NAT reflection.
“Failed to connect to … port 30120 after 21053 ms: Timed out”
A typical report on the Cfx forum reads Failed to connect to <ip> port 30120 after 21053 ms: Timed out - CURL error code 28 (Timeout was reached). In curl’s own list, error 28 is an operation timeout: the specified time-out period was reached, here while curl was still trying to connect. Error 7 means curl failed to connect() to the host or proxy. Netgate draws the line that matters here: a connection that is rejected instead of timing out usually means the forward works, but nothing listens on that port, or the forwarded port does not match the listening port. A message such as “Connection refused” means something, frequently the inside host, is actively rejecting the connection.
- Timed out: check the firewall rules (step 2), the forward and its internal IP (steps 3 and 4), and double NAT or CGN (step 5). Netgate also lists an ISP that blocks the port: such filters are more common on residential connections, so check the ISP’s terms of service about running servers. If the ISP filters the port, moving the server to a different port may work around it, but first make sure running a server does not break those terms.
- Connection refused: check that FXServer is running and listening (step 1), and that the forward points at the same port.
Players see these errors from the other side; owner and player fixes are in Fix FiveM CURL error 28 and 56.
info.json Loads From Outside, but Players Still Time Out When Joining
/info.json and the first join requests are HTTP over TCP, so the TCP half works and the problem is on the UDP side. Look for a router forward or firewall rule created for TCP only, a UDP rule with a different port, or an endpoint_add_udp line that does not use the same ip:port as endpoint_add_tcp. The F8 connect test from step 6 is the check that covers UDP; run it again after each change.
The Port Checker Says 30120 Is Closed
- FXServer is not listening during the check. Rerun step 1.
- The server’s own firewall blocks it, even though the router forwards correctly. Netgate lists a firewall on the target machine as a common cause.
- The forward points at an old internal IP, or the server’s default gateway is not the router holding the forward (step 3).
- UPnP created a conflicting forward. Netgate notes that traffic forwarded to an unexpected host may come from UPnP IGD and PCP.
txAdmin Says “Unable to start the server due to error(s) in your config file(s)”
txAdmin checks the endpoint lines before it starts the server and refuses to start on any error. The endpoint messages, quoted from txAdmin v8.1.2 (released October 23, 2026) and shown here for the TCP command, and their fixes:
| txAdmin message | Fix |
|---|---|
| “Your config file does not specify a valid endpoints for FXServer to use.” | Add both endpoint lines at the start of server.cfg; txAdmin suggests 0.0.0.0:30120 |
“Your config file does not not contain a ip:port used in both endpoint_add_tcp and endpoint_add_udp commands.” | Give the TCP and UDP lines the same ip:port |
“the endpoint_add_tcp port 40120 is dedicated for txAdmin and CAN NOT be used for FXServer.” | Choose a game port outside 40120 to 40150 |
| “…is being used by txAdmin and CAN NOT be used for FXServer at the same time.” | The game port equals the txAdmin port; change one of them |
“the endpoint_add_tcp port MUST be” followed by a port | Your host set TXHOST_FXS_PORT; use that port |
“the endpoint_add_tcp interface MUST be” followed by an address | Your host set TXHOST_INTERFACE; use that address |
“…is not in a valid ip:port format.” | Write the endpoint as "0.0.0.0:30120" |
“you CANNOT execute endpoint_add_tcp twice for the interface” | Remove the duplicate line |
The doubled “not” in the second message is in txAdmin’s source.
The Server Is Reachable but Missing From the Server List
Reachability is one condition of the listing, not all of them. An active sv_master1 "" line makes the server appear private with the connect button disabled, and sv_lan true keeps it off the public list. The server-issues page adds that a server can take up to 8 minutes to appear in the list after launch if no other heartbeats are sent, and that a NAT or gateway that masks UDP source ports can stop it from showing up; for pfSense it points to Netgate’s static port setting. Netgate explains that pfSense rewrites the source port on outgoing connections by default, while the static port option keeps the original source port. Work through FiveM server not showing in the server list for the full checklist. A server that is listed with blank details needs the Portal fix for “Missing server data”.
Next Steps
- Reachable from outside but not in the browser: FiveM server not showing in the server list.
- Hosting on a Linux VPS: How to run a FiveM server on Linux.
- Starting over or building a second server: How to make a FiveM server.
Browse FiveCrate assets
Original FiveM assets made in-house, with free updates and a multi-server license.
Official documentation and repository references
- Cfx.re Docs: Setting Up a Vanilla FXServer
- Cfx.re Docs: Server Commands
- Cfx.re Docs: Server Issues
- Cfx.re Docs: Proxy Setup (client connection process)
- txAdmin source (v8.1.2): fxsConfigHelper.ts endpoint checks
- Microsoft Learn: New-NetFirewallRule
- Ubuntu Manpage: ufw(8)
- Netgate Docs: Troubleshooting NAT Port Forwards
Related guides
FiveM DDoS Protection and Proxy Setup Explained
FiveM DDoS protection from the Cfx docs: connect and server proxies, nginx and Cloudflare setup, sv_proxyIPRanges, ips.txt, and what a proxy cannot hide.
FiveM Server Linux Setup on Ubuntu and Debian (2026)
FiveM server Linux setup for Ubuntu and Debian: install FXServer, run txAdmin over SSH, open ports with ufw and keep the server online with tmux or systemd.
Fix FiveM CURL Error 56 and 28 Connection Failures
FiveM CURL error 56 or 28 when joining a server? Learn what each code means, how to read the full message, and the owner and player checks that fix it.
FiveM Server Not Showing in Server List? 2026 Checklist
FiveM server not showing in the server list? Work through port 30120 TCP/UDP, sv_master1, Cfx static IPs, the Portal key, old FXServer builds and allowlists.
How to Make a FiveM Server in 2026 (txAdmin + Portal)
How to make a FiveM server in 2026: download FXServer, finish txAdmin setup, deploy a recipe, add a Cfx Portal key, set listing details and open port 30120.

