Windows Server

FiveM: Open Ports on Windows

How to manually open the necessary ports for a FiveM server on Windows Server

To run a FiveM server on Windows you need to open some ports in Windows Firewall and optionally on the VPS firewall (VirtFusion panel / UFW / iptables if using a Linux gateway).


Ports Required by FiveM

PortProtocolUse
30120TCP + UDPMain server port (client connection)
30110TCPServer HTTP port (txAdmin, HTTP resources)
40120TCPtxAdmin web interface (if enabled)
22 or customTCPSSH/RDP administrative access

Port 30120 is mandatory. Others depend on configuration.


Method 1: Windows Firewall (GUI)

  1. Open Windows Defender Firewall with Advanced Security (wf.msc)
  2. Click Inbound Rules → New Rule
  3. Choose Port
  4. Select TCP, enter 30120, 30110, 40120
  5. Select Allow connection
  6. Apply to all profiles (Domain, Private, Public)
  7. Name: FiveM TCP
  8. Repeat process choosing UDP for port 30120

Much faster. Run PowerShell as Administrator:

# FiveM main port TCP
New-NetFirewallRule -DisplayName "FiveM 30120 TCP" `
  -Direction Inbound -Protocol TCP -LocalPort 30120 `
  -Action Allow -Profile Any

# FiveM main port UDP
New-NetFirewallRule -DisplayName "FiveM 30120 UDP" `
  -Direction Inbound -Protocol UDP -LocalPort 30120 `
  -Action Allow -Profile Any

# FiveM HTTP server
New-NetFirewallRule -DisplayName "FiveM 30110 TCP" `
  -Direction Inbound -Protocol TCP -LocalPort 30110 `
  -Action Allow -Profile Any

# txAdmin
New-NetFirewallRule -DisplayName "FiveM txAdmin 40120 TCP" `
  -Direction Inbound -Protocol TCP -LocalPort 40120 `
  -Action Allow -Profile Any

Verify rules were created:

Get-NetFirewallRule -DisplayName "FiveM*" | Select-Object DisplayName, Enabled, Direction

Method 3: netsh (alternative)

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

Verify Ports Are Open

After starting the FiveM server, verify it's listening:

netstat -ano | findstr ":30120"
netstat -ano | findstr ":30110"

Expected output:

TCP    0.0.0.0:30120    0.0.0.0:0    LISTENING    1234
UDP    0.0.0.0:30120    *:*                        1234

VPS Firewall (panel / UFW)

If your VPS has network-level firewall (e.g. managed by VirtFusion panel or cloud firewall), you must open the same ports there.

To check from Linux (if you have access):

# UFW
ufw allow 30120/tcp
ufw allow 30120/udp
ufw allow 30110/tcp
ufw allow 40120/tcp

# iptables
iptables -A INPUT -p tcp --dport 30120 -j ACCEPT
iptables -A INPUT -p udp --dport 30120 -j ACCEPT

Port Already in Use or Conflicts

If port 30120 is already in use:

# Find process using port
netstat -ano | findstr ":30120"
# Note the PID (last number)
Get-Process -Id <PID>
# To terminate it (only if sure)
Stop-Process -Id <PID> -Force

Custom Port in server.cfg

If you want to use a port different from 30120, modify server.cfg:

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

Replace 30120 with desired port and open that port in firewall instead of 30120.

On this page