Ports and Firewall
The ports FiveM Stats, players and browsers connect to, and how to open them.
The script never changes your firewall. Open the ports below yourself, in the system firewall and in your host's panel.
Ports
Game port (endpoint_add_tcp, 30120 by default)
TCP and UDP
Players, FiveM Stats
Joining the server. The panel's statistics API at /tgiann-fivem-stats-script/
Media port (tgiann_media_port, 6174 by default)
TCP
Players' games, browsers with the panel open, FiveM Stats
80
TCP
Let's Encrypt
Only when tgiann_media_https is auto (the default), and only while a certificate is checked, about every 4 days
Windows
Open PowerShell as administrator:
New-NetFirewallRule -DisplayName "FiveM Stats media" -Direction Inbound -Protocol TCP -LocalPort 6174 -Action Allow
New-NetFirewallRule -DisplayName "FiveM Stats HTTPS check" -Direction Inbound -Protocol TCP -LocalPort 80 -Action AllowLinux
With ufw:
sudo ufw allow 6174/tcp
sudo ufw allow 80/tcpYour host's firewall
Many VPS and dedicated server hosts have a second firewall or a DDoS filter in their control panel. Open the same ports there too, otherwise the rules above have no effect. Hosts with a FiveM DDoS profile on the game port also need a change there: DDoS-Protected Hosts.
Changing the media port
If another program already uses 6174, pick another free port. Set it before the script starts and restart the server:
Check from outside
From another network (a phone on mobile data is enough) open:
A working service answers with "status":"ok", its public address and the HTTPS state. No answer means the media port is still closed somewhere.