Guide
15 min readJul 29, 2026

FiveM Port 30120: Port Forwarding and Firewall Guide

Open the correct FiveM TCP and UDP port, match server.cfg and Windows Firewall, keep txAdmin private, and fix a server that friends cannot reach.

The short answer

A default FiveM server listens on port 30120 over both TCP and UDP. Point both router rules at the reserved local IPv4 address of the server, allow both protocols through the host firewall, and keep the server online while testing from another network. Do not expose the separate txAdmin web panel just to make players connect. If you cannot change the router or your ISP uses CGNAT, a VPN works only when it provides a real inbound port for both TCP and UDP; an ordinary privacy VPN does not.

FiveM ports at a glance

The official FiveM sample configuration binds the same port number on two protocols. Treat TCP and UDP as separate paths even though both say 30120.

PurposeDefaultProtocolPublic rule?
FiveM player/server endpoint30120TCP + UDPYes, to the FXServer host
txAdmin web interfaceOften 40120TCPNo, not for player connections

30120 and 40120 do different jobs

Players connect to the FXServer endpoint. The txAdmin port opens an administrative web panel, can be changed, and should stay private unless you deliberately secure remote administration. Opening it does not fix a missing FiveM server.

Build a matching FiveM configuration

Enter the reserved local IPv4 of the server and the port you want FiveM to use. The generator runs only in your browser.

server.cfg endpoints
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"
Router rule
Name: FiveM Server
External port: 30120
Internal port: 30120
Protocol: TCP + UDP (or two rules)
Target IP: 192.168.1.50
Windows PowerShell (run as administrator)
New-NetFirewallRule -DisplayName "FiveM TCP 30120" -Direction Inbound -Protocol TCP -LocalPort 30120 -Action Allow -Profile Private
New-NetFirewallRule -DisplayName "FiveM UDP 30120" -Direction Inbound -Protocol UDP -LocalPort 30120 -Action Allow -Profile Private

Friends connect with connect PUBLIC-IP:30120. The 0.0.0.0 in server.cfg is a listening address, not an address to give players.

How to port forward a FiveM server

  1. 1

    Test on the LAN first

    Start FXServer and connect from another device using LOCAL-IP:PORT. If this fails, fix the server, configuration, or host firewall before touching the router.

  2. 2

    Reserve the host address

    Use a DHCP reservation in the router. A changing local IPv4 is why many working rules fail after a reboot.

  3. 3

    Match both endpoint lines

    Keep endpoint_add_tcp and endpoint_add_udp on the same port. Restart FXServer after a change and check whether TXHOST_FXS_PORT overrides the file.

  4. 4

    Create the router rules

    Send the public TCP and UDP port to the same port on the reserved server address. Use two rules when the router has no Both option.

  5. 5

    Allow inbound traffic on the host

    Allow FXServer or add narrow TCP and UDP inbound rules. You normally do not need broad outbound rules or a disabled firewall.

  6. 6

    Test from another internet connection

    Keep FXServer running and use FiveM Direct Connect from outside your Wi-Fi. A same-LAN public-IP test can fail when the router lacks NAT loopback.

Test the right layer

1. Local listener

On the host, open http://127.0.0.1:30120/info.json. Failure means FXServer is not serving the expected TCP port.

2. LAN path

From another home device, try http://192.168.1.50:30120/info.json and a FiveM connection. This isolates the host firewall.

3. Public TCP path

From outside, try http://PUBLIC-IP:30120/info.json. Success confirms TCP only; it does not prove UDP is open.

4. Real FiveM join

From an external connection, run connect PUBLIC-IP:30120. This is the final TCP-and-UDP proof.

When a port-forwarding VPN is the practical fallback

First ask the ISP for a public IPv4 if your router WAN address is behind CGNAT. If that is unavailable—or you cannot control the router—a VPN can provide the inbound path. It must forward the same port number over both TCP and UDP and permit server hosting. A normal VPN with no inbound forwarding will not help, and a VPN may add latency.

Check for CGNAT before paying

Home PC, VPS, or managed host?

Where FXServer runsWhat you configureWhat not to do
Home PCRouter NAT + host firewall + server.cfgDo not target the gaming PC if another machine hosts FXServer
VPS or cloud VMCloud firewall/security group + operating-system firewallDo not look for a home-router forwarding page
Managed FiveM hostUse the IP and port assigned in its control panelDo not assume the host assigned 30120

FiveM port forwarding not working

No local info.json and no LAN join

FXServer is stopped, bound to a different port, or blocked locally. Check the startup log, server.cfg, and TXHOST_FXS_PORT.

LAN works but public info.json fails

Recheck the TCP router rule, target address, Windows profile, upstream ISP gateway, and CGNAT.

Public info.json works but players time out

TCP works; UDP may still be missing. Add or correct the UDP rule and test with a real external FiveM client.

Direct Connect works but the server is not listed

Reachability works. Check server-list configuration, server version, and listing requirements rather than adding ports.

It stopped after a reboot

The server probably received a new local IPv4. Reserve the address and update both router rules.

Public IP fails only from inside the LAN

This can be a NAT-loopback limitation. Use the local IP at home and test the public address from mobile data.

Safer FiveM hosting

  • Open only the game endpoint you actually use; do not place the whole server PC in DMZ.
  • Keep FXServer, artifacts, resources, and the host operating system updated.
  • Keep txAdmin on the LAN or behind a properly secured private-access method.
  • Use strong admin credentials and remove router and firewall rules when the server is retired.

Related diagnostics

Check your public IP and NAT

FiveM port FAQ

What is the default FiveM port?

The default FiveM server endpoint is 30120. The official sample server.cfg binds both TCP and UDP to 0.0.0.0:30120.

Does FiveM use TCP or UDP port 30120?

Both. Create matching TCP and UDP paths unless your router offers one rule with the protocol set to Both.

Is txAdmin port 40120 the FiveM game port?

No. txAdmin's web panel is separate from the player endpoint. Its port can vary, and it should stay private unless you intentionally secure remote administration.

Can I change the FiveM port from 30120?

Yes. Change both endpoint_add_tcp and endpoint_add_udp, restart FXServer, and make the router and firewall use the new number. Friends must connect to that public port.

Why is FiveM port forwarding not working?

The usual causes are a server that is not listening, a changed local IP, a missing protocol, a host firewall rule, Double NAT, or CGNAT. Test from the server outward in that order.

Do I port forward a FiveM server on a VPS?

Usually no home-router rule is involved. Allow the port in the VPS operating-system firewall and the provider's network firewall or security group.

Can I host FiveM through a VPN?

Yes only if the VPN forwards an inbound port over both TCP and UDP. Configure FiveM to listen on the assigned public port when the provider does not let you choose 30120.

Official references

Port and configuration claims above are based on current Cfx.re, Microsoft, and standards documentation.

Share this article