For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Serving media through your own proxy or a Cloudflare Tunnel with tgiann_media_host "127.0.0.1"? Then the media port and 80 stay closed; only the proxy's own port is open. See HTTPS.

Ports

Port
Protocol
Who connects
What for

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

Screenshot uploads, pictures and videos in the panel and in game, uploads and ZIP downloads from the Media page, downloads from the Backups page

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 Allow

Linux

With ufw:

sudo ufw allow 6174/tcp
sudo ufw allow 80/tcp

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