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

Cloudflare Tunnel

The easiest way to serve screenshots and videos from your own domain with HTTPS. Free, no ports to open.

Cloudflare Tunnel is the easiest way to put the media service on your own domain, for example https://media.yourserver.com. A small program (cloudflared) runs on your server and connects out to Cloudflare, so:

  • HTTPS comes from Cloudflare, no certificate to manage.

  • No inbound port has to be open, not even the media port or port 80.

  • Your server's IP is not in the file links.

Menu names below are from the Cloudflare dashboard on 24 October 2026. Cloudflare moves menus now and then; if a name is different, find it with the dashboard search (Ctrl K).

What you need

  • A domain, bought anywhere (or in Cloudflare: Domains > Buy domain).

  • Administrator access to the machine FXServer runs on.

1. Add your domain to Cloudflare

Skip this step if the domain already shows Active under Domains.

  1. In the Cloudflare dashboard open Domains > Overview in the left menu and click Add domain.

  2. Choose Connect a domain.

  3. Enter your domain without www (yourserver.com) and continue.

  4. Pick the Free plan.

  5. Cloudflare lists the DNS records it found. Check them (your website, email) and continue.

  6. Cloudflare shows two nameservers. Log in where you bought the domain and replace its nameservers with these two. If DNSSEC is on there, turn it off first; you can turn it on again in Cloudflare later.

  7. Wait until the domain shows Active on the Domains page. It usually takes minutes, at most 24 hours, and Cloudflare sends an email when it is done.

2. Create the tunnel

  1. Open Networking > Tunnels in the left menu and click Create Tunnel.

  2. Enter a name, for example fivem-server, and click Create Tunnel.

  3. Under Operating System choose Windows, under Architecture choose 64-bit.

  4. Click the cloudflared-windows-amd64.msi link on the page and run the installer.

  5. Open Command Prompt as Administrator: press Start, type cmd, right click Command Prompt > Run as administrator.

  6. Copy the command on the page with its copy button and run it. It looks like this, with your own long token:

  1. Connection Status changes from "No connection detected yet" to connected. Click Continue.

cloudflared is now a Windows service: it starts with Windows, you do not need to keep a window open.

On a Linux server choose Debian or Red Hat instead and run the commands the page shows.

3. Send a subdomain to the media service

  1. Open Networking > Tunnels and click your tunnel's name.

  2. Open the Routes tab, click Add route and choose Published application.

  3. Fill in:

Field
Value

Subdomain

media

Domain

yourserver.com

Path

Leave empty

Service URL

http://localhost:6174

  1. Click Add route.

6174 is the media port; use your own if you changed tgiann_media_port. Cloudflare creates the DNS record by itself: under the domain's DNS > Records you now see media.yourserver.com with type Tunnel and Proxied.

4. server.cfg

  • off: Cloudflare already adds HTTPS, so the service does not need its own certificate or port 80.

  • 127.0.0.1: the service only answers this machine. You can then close the media port in your firewall. Links handed out earlier with your IP stop working; leave this line out if old links (a phone gallery, MDT photos) must keep working.

Restart the resource: ensure tgiann-fivem-stats-script.

5. Enter the address in the panel

In the panel open Settings > Media storage > Public address, enter https://media.yourserver.com (no / at the end) and click Save changes. New links use it at once. See Settings > Media storage.

6. Check it

  1. Open https://media.yourserver.com/health in a browser. It answers "status":"ok" and publicUrl is your domain.

  2. Run /mediatest in game. The link it prints starts with https://media.yourserver.com.

  3. The Media page shows the thumbnails.

Limits and problems

Problem
Fix

The tunnel shows Down under Networking > Tunnels

The cloudflared service is not running. Open Services in Windows, find Cloudflared agent and start it

The tunnel is up but the domain shows a Cloudflare error page

The Service URL port does not match tgiann_media_port, or the resource is stopped

The tunnel never connects

The server must reach Cloudflare outbound on port 7844. Most hosts allow it; ask yours if not

Links still show the IP

Public address is empty or not saved, see step 5

Other ways to get HTTPS (an automatic certificate for the IP, your own certificate, nginx): HTTPS.