FiveM: Open Ports on Windows

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).

02

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.

03

Method 1: Windows Firewall (GUI)

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

Method 2: PowerShell (recommended)

Much faster. Run PowerShell as Administrator:

powershell
# 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:

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

Method 3: netsh (alternative)

cmd
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
06

Verify Ports Are Open

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

powershell
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
07

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):

bash
# 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
08

Port Already in Use or Conflicts

If port 30120 is already in use:

powershell
# 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
09

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.

DeluxHost, fondata nel 2023, offre soluzioni di hosting di alta qualità per diverse esigenze digitali. Forniamo hosting condiviso, VPS e server dedicati con sicurezza avanzata e datacenter globali.

© DeluxHost, Tutti i diritti riservati. | Partita IVA: IT17734661006
Tutti i sistemi operativi