FiveM Updated April 27, 2026

Port Configuration and Firewall Setup

Which ports FiveM requires, how to open them in your firewall, and how to configure endpoints in server.cfg.

FiveMPortsFirewallNetworkingUFW

Overview

FiveM requires two ports to be open and routable to the public internet. Misconfigured firewall rules are one of the most common causes of "server not connecting" issues. This guide covers the required ports, how to configure them in server.cfg, and how to open them in common firewall tools.

Required Ports

Port Protocol Purpose
30120 TCP FiveM game traffic (client connections, resource sync)
30120 UDP FiveM game traffic (real-time state updates)
40120 TCP txAdmin web panel (internal/management use only)

Both TCP and UDP on 30120 must be open. FiveM uses the same port number for both protocols — do not use separate ports for TCP and UDP.

40120 is for the txAdmin panel. Do not expose this port to the public internet unless you have a reverse proxy with authentication in front of it. Limit access to trusted IPs or access it via an SSH tunnel.

Configuring Endpoints in server.cfg

The bind address and port are set in server.cfg:

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

0.0.0.0 binds to all network interfaces. To bind to a specific IP only:

endpoint_add_tcp "203.0.113.42:30120"
endpoint_add_udp "203.0.113.42:30120"

Both lines are required. Omitting either one will break either TCP or UDP connectivity.

Opening Ports with UFW (Linux)

sudo ufw allow 30120/tcp
sudo ufw allow 30120/udp
sudo ufw reload
sudo ufw status

Verify both rules appear in ufw status output.

Opening Ports with firewalld (RHEL/CentOS/Rocky)

sudo firewall-cmd --permanent --add-port=30120/tcp
sudo firewall-cmd --permanent --add-port=30120/udp
sudo firewall-cmd --reload
sudo firewall-cmd --list-ports

Opening Ports on Windows Server (Windows Firewall)

netsh advfirewall firewall add rule name="FiveM TCP" protocol=TCP dir=in localport=30120 action=allow
netsh advfirewall firewall add rule name="FiveM UDP" protocol=UDP dir=in localport=30120 action=allow

Pterodactyl / WISP Panel Port Allocation

When using a panel, port allocation is managed at the node level, not by the OS firewall directly. To configure ports:

  1. Open your server in the panel.
  2. Go to Network (or Ports).
  3. Verify 30120 is allocated to the server. If not, add it through the panel's port assignment interface.
  4. The panel injects the allocated port into the startup environment. If your egg sets GAME_PORT, check that it matches 30120 in server.cfg.

Panel-managed servers usually have the host firewall handled by the panel infrastructure. If you still cannot connect after allocating the port, contact your hosting provider to confirm the host-level firewall allows 30120/tcp and 30120/udp.

Testing Connectivity

From an external machine, test TCP reachability:

nc -zv YOUR_SERVER_IP 30120

For UDP, use nmap:

nmap -sU -p 30120 YOUR_SERVER_IP

If either test fails while FXServer is running, the firewall is blocking the port.

Changing the Default Game Port

To run on a non-standard port (useful when multiple FiveM instances share a host):

endpoint_add_tcp "0.0.0.0:30121"
endpoint_add_udp "0.0.0.0:30121"

Open the new port in the firewall and update the panel's port allocation. Players must connect by IP:PORT in the FiveM client (F8: connect 203.0.113.42:30121).