Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
VGSources
Blog

How to Port Forward a FiveM Server (TCP and UDP 30120)

A practical guide to making a self-hosted FiveM server reachable: forward the configured game port for both TCP and UDP, keep txAdmin separate, and diagnose firewall, NAT and CGNAT problems with an external direct-connect test.
Length11 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To make a self-hosted FiveM server reachable over the internet, forward the game endpoint’s TCP and UDP port—usually 30120—from your router to the computer running FXServer, allow the same traffic through that computer’s firewall, and test from outside your home network. The port shown in server.cfg is authoritative: if you changed it, forward that exact value instead.

Which ports does a FiveM server use?

FiveM’s player connection uses the FXServer game endpoint. In the common configuration, both protocols use port 30120:

As an Amazon Associate I earn from qualifying purchases.

Service Typical port Protocol What it does
FXServer game endpoint 30120 TCP and UDP Player connections to the FiveM server
txAdmin web panel 40120 by default TCP Administration, monitoring and setup in a browser
Custom game endpoint The value in server.cfg TCP and UDP The player connection when the default has been changed

Forwarding only TCP or only UDP can produce a partial or failed connection. Create rules for both protocols unless your router offers one combined TCP/UDP rule. Do not treat port 40120 as the game port. A browser can reach txAdmin while players still cannot reach FXServer.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What you need before creating a rule

  • Access to the router’s administrator interface and permission to change NAT or port-forwarding settings.
  • The private LAN address of the computer running FXServer, such as an address assigned by your home router.
  • A stable address for that computer. A DHCP reservation is usually easier to maintain than manually configuring a static address on the host.
  • The endpoint values from the server’s actual server.cfg, rather than an assumed default.
  • Administrator access to the host operating system so you can create firewall exceptions.
  • A second internet connection for testing, such as a phone hotspot or a friend’s connection. Testing from the same LAN can give a misleading result.

Port forwarding cannot overcome an upstream network that does not provide you with an inbound-reachable public address. If your ISP uses carrier-grade NAT (CGNAT), or if an ISP gateway sits in front of your own router, you may need to change the upstream configuration or use a managed hosting option.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Step 1: Confirm the FXServer endpoint

Inspect server.cfg

Open the configuration file used by the server instance and find the endpoint declarations. Official examples bind both endpoints to all local interfaces on port 30120:

endpoint_add_udp "0.0.0.0:30120"
endpoint_add_tcp "0.0.0.0:30120"

Your file may use another port. The UDP and TCP values determine what the router and firewall must permit. Keep them aligned unless you have a specific reason to separate them.

Check the primary port setting

The netPort command also controls the primary server port. If it is present, reconcile it with the endpoint lines and use the effective value shown by FXServer when it starts. Never forward 30120 merely because it is common; forward the port the running instance is actually listening on.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Record the values

Write down the game port, the host computer’s current private IP address, and the router’s public IP address. You will use all three while creating and testing the rule. The panel port is a separate administration setting and should not replace the game endpoint in a player’s connection command.

Step 2: Give the server computer a stable private IP

A forwarding rule targets a private address such as 192.168.x.x or 10.x.x.x. If the router later gives the server computer a different address, the rule continues pointing at the old machine and remote players fail to connect.

Use a DHCP reservation when possible

  1. Sign in to the router.
  2. Open the LAN, DHCP, Connected Devices or Address Reservation page (the label varies by firmware).
  3. Identify the FXServer computer by its hostname or network adapter address.
  4. Create a reservation for its current private IP, then save the change.
  5. Reconnect the computer or renew its DHCP lease and verify that it still has the reserved address.

If your router cannot reserve addresses, configure a static private address on the computer instead. Choose an address inside the LAN’s correct subnet and outside the router’s automatic DHCP pool, and copy the proper gateway and DNS values from your network configuration. An incorrect static configuration can disconnect the host even before forwarding is attempted.

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Step 3: Create TCP and UDP forwarding rules

  1. Open the router’s Port Forwarding, NAT, Virtual Server or similarly named page.
  2. Create a rule for the game port. Set the external or public port to the value in server.cfg, set the internal or private port to the same value, and select TCP.
  3. Set the destination or server IP to the reserved private address of the FXServer computer.
  4. Create a second rule with the same external port, internal port and destination, but select UDP.
  5. If the firmware provides a combined TCP/UDP choice, one combined rule is acceptable; confirm that it really enables both protocols.
  6. Save or apply the configuration. Some routers require a reboot before the rule becomes active.

Use the same port externally and internally unless you intentionally need a translated port. If you do translate it, players must use the external value and the host firewall must allow the internal value; keeping them identical avoids that extra source of error.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Field Example for the default endpoint
Service name FiveM FXServer TCP (any descriptive label)
External port 30120
Internal port 30120
Destination IP The reserved private IP of the FXServer computer
Protocol TCP; create a second UDP rule unless combined forwarding is supported

Step 4: Allow the game port through the host firewall

The router can deliver packets to the computer, but the operating-system firewall can still discard them. Add inbound permissions for the configured game port on both TCP and UDP, restricted to the network profiles and executable you actually use where your firewall supports those controls.

Windows hosts

Create inbound rules in Windows Defender Firewall with Advanced Security for the FXServer program or for the specific TCP and UDP local port. Apply the rule to the appropriate private or public profile instead of disabling the firewall entirely. If FXServer runs under a service account, make sure the rule covers that program and profile.

Linux hosts

Permit the configured TCP and UDP port in the firewall framework enabled on the system, such as the distribution’s uncomplicated firewall or firewalld configuration. Check that a broader cloud, hypervisor or container firewall is not filtering the same traffic. The exact command depends on your distribution and firewall manager; the required result is an inbound allowance for both protocols on the FXServer port.

Do not open txAdmin’s TCP 40120 to the whole internet simply because the panel loads locally. Keep administration on the private LAN or expose it only through an intentionally protected access path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Step 5: Start FXServer and verify what it is listening on

  1. Start FXServer through your normal FXServer or txAdmin launch method.
  2. Read the startup output and confirm that the endpoint values match the entries you inspected in server.cfg.
  3. Confirm that no other application is already using the selected port.
  4. Leave the server running while you test; a forwarding rule cannot succeed when the destination process is stopped.

A working txAdmin page only proves that the panel’s web service is available on its own port. It does not prove that the game endpoint is listening or reachable through the router.

Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Step 6: Test from outside your LAN

Use a different internet connection, not another device connected to the same home router. In FiveM, press F8 to open the client console and run:

connect PUBLIC_IP:30120

Replace PUBLIC_IP with the current public address of your router and replace 30120 if your server uses a different endpoint port. A local test such as localhost or the host’s private address only demonstrates local binding; it does not test NAT, the router rule, the public address or the ISP path.

Have a friend try the same direct-connect address, or disconnect a test laptop from Wi-Fi and use a mobile hotspot. Test after the server is running and after the router has applied its changes. If the direct connection succeeds, players can reach the game endpoint even if the server has not yet appeared in the public list.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why direct connection and server-list visibility are different

Diagnose direct connection first. A successful connect PUBLIC_IP:PORT test establishes that the selected game port can reach your server. Listing involves additional server configuration and discovery behavior, so a server can accept direct connections while remaining absent from the list.

Cfx.re’s server-issues guidance warns that NAT or gateway behavior that masks UDP source ports can prevent a server from appearing in the listing. If direct connection works but listing does not, inspect the server’s listing-related configuration and the gateway topology rather than repeatedly changing the game-port rule.

Troubleshooting a failed remote connection

Friends cannot connect, and direct connect fails

  • Compare the forwarding destination with the server computer’s current private IP. A changed DHCP address is a common cause.
  • Verify that both TCP and UDP rules exist for the exact endpoint port shown in server.cfg.
  • Check the host firewall for inbound allowances on the same port and protocols.
  • Confirm that FXServer is running and listening on the expected interfaces and port.
  • Check that you are using the current public IP, not the server’s private LAN address.
  • Look for a second router or ISP gateway upstream. The first device receiving the public address must either forward the port to your router or operate in a mode that removes the extra NAT layer.

Cfx.re’s server-issues documentation summarizes this symptom directly: when a direct connection fails, incorrect port forwarding or a firewall blocking connections is likely.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

It works on the host or inside the house but not remotely

That result confirms only that FXServer is locally reachable. Repeat the test from a separate internet connection, then work outward from the host: confirm the listening port, firewall, router destination, router WAN address and upstream NAT. Do not use a successful localhost test as evidence that the public route is open.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

txAdmin opens, but FiveM cannot join

Check that you are not forwarding or testing TCP 40120 as though it were the game endpoint. txAdmin’s default panel port is 40120, while the typical player endpoint is TCP and UDP 30120. Keep the panel’s access limited independently of the game-port rules.

Direct connect works, but the server is not listed

Leave the forwarding rule in place and investigate listing-related settings and gateway behavior. In particular, check whether an upstream NAT or gateway is masking UDP source ports. The listing symptom does not by itself prove that the game port is closed.

The server stopped working after a restart

Check whether the host received a new private address. If so, restore the DHCP reservation or static configuration, update the router target if necessary, and retest externally. Also verify that the server did not revert to a different server.cfg or endpoint port.

Only one protocol appears to work

Recheck the router’s protocol selector and the host firewall separately. A TCP-only rule or UDP-only rule is insufficient for the normal FiveM endpoint. Ensure that a combined rule really covers both protocols rather than choosing one by default.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How CGNAT and double NAT change the solution

Double NAT

Double NAT occurs when an ISP gateway and your own router both perform address translation. If the public address is assigned to the ISP gateway, a rule on your second router may never receive unsolicited inbound traffic. Forward the game port through both devices, place the downstream router in the gateway’s supported bridge or passthrough mode, or ask the ISP to provide a directly reachable arrangement.

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Carrier-grade NAT

With CGNAT, the ISP shares one public address among multiple customers and does not give your router a directly reachable inbound address. You generally cannot solve that by adding more rules to your home router. Ask the ISP whether a public IPv4 option is available, or move the server to a managed hosting service that supplies inbound connectivity.

How to recognize an upstream restriction

  • The router’s reported WAN address differs from the public address shown by an external address-checking service.
  • You have no control over the ISP gateway, or forwarding changes on your router never affect the result.
  • Direct connection fails despite a stable host IP, matching TCP and UDP rules, an open host firewall and a running FXServer.

These signs do not identify one specific ISP policy, but they justify checking the upstream device before spending more time editing the local rule.

Security practices for an internet-facing server

  • Forward only the game endpoint port you actually use; do not place the server computer in a router-wide DMZ as a shortcut.
  • Keep txAdmin’s TCP 40120 reachable only from the private network or another deliberately secured administrative path.
  • Use the host firewall even when the router has a forwarding rule. The two controls protect different points in the path.
  • Review the rules after changing the endpoint port or moving FXServer to another computer.
  • Apply operating-system, FXServer and resource updates through your normal maintenance process, and remove obsolete forwarding entries.
  • Share the public connection address with players, but do not publish administrative credentials or expose the txAdmin panel unnecessarily.

Self-hosting versus managed hosting

Port forwarding is appropriate when you control the router and can obtain an inbound-reachable public address. Managed hosting is worth considering when the ISP uses CGNAT, the gateway cannot be configured, or you do not want to maintain the home network and host firewall.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a managed FiveM deployment, Godlike.Host provides FiveM game-server hosting through its own game panel. It is not on Cfx.re’s list of authorized FiveM hosts (fivem.net, 10 Oct 2026).

Decision factor Self-hosted FXServer Managed hosting
Router and firewall control You configure and maintain both. The provider supplies the network path; your home router is not the game endpoint.
Inbound connectivity Depends on public addressing, NAT and ISP policy. Normally included as part of the hosting environment; verify the provider’s exact network offer.
Recurring cost Uses your existing connection and hardware, but consumes power and maintenance time. Requires a recurring hosting fee.
Setup complexity Requires endpoint configuration, fixed LAN addressing, forwarding and firewall rules. Usually reduces local networking work, but still requires server configuration.
Port changes You can change the endpoint and update the router and firewall yourself. Port choices depend on the provider’s controls and restrictions.
Security updates You are responsible for the operating system, FXServer, resources and network exposure. The provider maintains the underlying platform; you remain responsible for your server configuration and resources.

The official Cfx setup documentation treats game-server hosting providers as another deployment path. Choose based on control, connectivity and maintenance responsibility—not on whether txAdmin happens to load in a browser.

Quick verification checklist

  • server.cfg shows the endpoint port you intend to publish.
  • TCP and UDP forwarding target the current fixed private IP of the FXServer computer.
  • The host firewall permits both protocols on that same game port.
  • FXServer is running and reports the expected endpoint at startup.
  • You are testing with connect PUBLIC_IP:PORT from outside the LAN.
  • The public IP is current and the router is not behind an unconfigured second NAT device or CGNAT.
  • You test direct connection before treating server-list visibility as a separate configuration problem.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.