Securing Your FiveM Server with Cloudflare Tunnel
If you operate a FiveM server, safeguarding it from potential threats is of utmost importance. One effective way to achieve this is by implementing a zero-trust security model, where server access is only allowed through a secure channel. I am sharing this with other communities as we all need to come together againts the attackers in helping mitigate downtime.
Note: This guide assumes you are familiar with operating a FiveM server and have both a Cloudflare account and access to Cloudflare ZTNA (Zero Trust Network Access). If you do not know what you are doing, you will face challenges. Do your research and always configure this in a development environment first.
What is Cloudflared Tunnel?
Cloudflared Tunnel establishes a secure, encrypted connection between your server and Cloudflare’s network. By utilizing this tunnel, you can access your server securely from anywhere without exposing it directly to the internet. Cloudflared Tunnel is a part of the Cloudflare Workers family, leveraging the same robust security and privacy features.
Setting Up Cloudflared Tunnel
To set up Cloudflared Tunnel, you will require a Cloudflare account and access to the server you wish to secure. Follow these steps:
Install Cloudflared on your server. Instructions for installing Cloudflared can be found on the ZTNA Dashboard or here.
Create a new Tunnel in the Cloudflare ZTNA dashboard.
Give the Tunnel a descriptive name and select the server you want to secure.
Integrating with FiveM
To integrate your FiveM server with Cloudflared Tunnel, we will use a reverse proxy. Follow these steps:
Create a route for your FiveM server using the HTTP protocol in the Cloudflare ZTNA dashboard. The route should resolve to: http://localhost:30120 or what ever port you use for your server.
Tip: Sometimes adjustments are necessary in the Cloudflared tunnel settings to ensure SSL works with the cre.fx server listing ping/API. It’s recommended to change the proxy type to socks5.
Set up a reverse proxy for your FiveM server. The reverse proxy should listen on port 443 and forward requests to the connecting endpoint specified in the route.
// prevents the server list from advertising your server using its actual IP
set sv_forceIndirectListing true
// makes the server list backend request `https://server1.example.com/` instead of the default
set sv_listingHostOverride "server1.example.com"
// a space-separated list of IPv4 networks in CIDR notation to allow 'X-Real-IP'
// from, as well as bypass the rate limiter. The below IP Spaces are Cloudlfare addresses.
set sv_proxyIPRanges "173.245.48.0/20, 103.21.244.0/22, 103.22.200.0/22, 103.31.4.0/22, 141.101.64.0/18, 108.162.192.0/18, 190.93.240.0/20, 188.114.96.0/20, 197.234.240.0/22, 198.41.128.0/17, 162.158.0.0/15, 104.16.0.0/13, 104.24.0.0/14, 172.64.0.0/13, 131.0.72.0/22"
// the actual endpoint your server is hosted on, or one
// or multiple server endpoint proxies, as noted below
set sv_endpoints "100.64.1.2:30120"
// Some guides also mention `sv_listingIpOverride.` This value is only needed
// if the server list backend can't guess the IP to query itself and is not provided to any front-end connection.
// This is usually the case for systems with multiple IPs or if the server is firewalled off for all hosts except
// a server proxy.
Ensure your reverse proxy is configured to use SSL encryption. You can obtain an SSL certificate from Cloudflare or a trusted certificate authority.
Testing Your Connection
It’s essential to test your connection after setting up the Cloudflared Tunnel. Keep in mind that some regions might experience slightly higher ping due to Cloudflared Tunnel being primarily designed for secure exposure of websites and networks, rather than low-latency game servers.
Conclusion
By leveraging Cloudflared Tunnel, you can establish a secure and encrypted connection between your FiveM server and Cloudflare’s network. This significantly enhances your server’s protection against potential threats, offering you peace of mind. If you encounter any questions or need assistance in setting up Cloudflared Tunnel, do not hesitate to reach out to the Cloudflare support team for help.
Configure a Cloudflare Proxy For Your FiveM Server
Tutoriale, ghiduri de optimizare si suport pentru crearea serverelor.
- greenie
- Full Member

- Posts: 2948
- Joined: Sun Nov 21, 2021 4:55 pm
- Jucator SA:MP ?: Nu
- Nick:: greenie
- Jucator CS ?: Da
Configure a Cloudflare Proxy For Your FiveM Server
𝑴𝒂𝒚𝒃𝒆 𝒕𝒉𝒆 𝑬𝒂𝒓𝒕𝒉 𝒊𝒔 𝒕𝒉𝒆 𝑯𝒆𝒍𝒍 𝒐𝒇 𝑨𝒏𝒐𝒕𝒉𝒆𝒓 𝑷𝒍𝒂𝒏𝒆𝒕... 
GAZDUIRE JOCURI / VPS / GAZDUIRE WEB / SERVERE DEDICATE - Stock NELIMITAT / Valabil comandati pe https://www.zonek.ro/
Return to “Server Development”
Jump to
- Inregistreaza-te pe Zonek Telecom ca sa vezi toate Subiectele
- Regulile Forumului & Descriere
- ↳ Regulament Forum
- ↳ Prezentare
- ↳ Cereri Parteneriate
- ↳ Intri si tu in reteaua zonek??
- ↳ Sugestiile voastre
- ↳ Raportare bug-uri/probleme forum
- Mica Publicitate & Reclama
- ↳ Reclama diverse siteuri & servere de Counter-Strike
- ↳ Vand
- ↳ Cumpar
- ↳ SCAMMER ALERT
- Servere Comunitare NON-STOP
- ↳ Discord Server Zonek Telecom
- ↳ GO.ZONEK.RO
- ↳ ARENA.ZONEK.RO
- ↳ AWP.ZONEK.RO
- ↳ Bucuresti Create Server
- ↳ Evidenta redirect
- ↳ Clan TAG
- Counter-Strike 2
- ↳ Tutoriale CS2
- ↳ Counter-Strike Sharp CS2
- ↳ Scripting CS2
- ↳ Addons-uri si Moduri CS2
- ↳ Discutii CS2
- ↳ Harti / Maps CS2
- zonek.ro - Counter Strike Global Offensive
- ↳ SourceMod Plugins
- ↳ Admin Commands
- ↳ Fun Stuff
- ↳ Gameplay
- ↳ General Purpose
- ↳ Server Management
- ↳ Statistical
- ↳ Technical/Development
- ↳ Tutoriale
- ↳ Probleme la servere si Jocul Counter-Strike: Global Offensive
- Jocuri & Resurse Counter Strike
- ↳ Tutoriale cs 1.6- Server
- ↳ Tutoriale Moduri Counter - Strike [NOU]
- ↳ Tutoriale cs - Install Counter-Strike & HLDS
- ↳ Scripting
- ↳ Mapping / Harti
- ↳ Cereri Tutoriale
- ↳ Download pluginuri
- ↳ Discutii legate de plugin-uri - Cereri Plugin-uri
- ↳ Download zone
- ↳ AdminMod
- ↳ AmxModX
- ↳ Admin Commands
- ↳ General Purpose
- ↳ Statistical
- ↳ Gameplay
- ↳ Event Related
- ↳ Server Management
- ↳ Fun Stuff
- ↳ Technical/Development
- ↳ AmxMod
- ↳ Addons-uri Counter Strike
- ↳ Addonsuri AmxModX
- ↳ Addonsuri AdminMod
- ↳ Addonsuri AmxMod
- ↳ Cereri addonsuri
- ↳ Probleme tehnice
- ↳ HLDS
- ↳ Client 1.6
- ↳ Alte jocuri
- FiveM Romania
- ↳ Server Development
- ↳ Server Plugins
- ↳ Server Resources
- ↳ Mods
- ↳ Paint Jobs
- ↳ Vehicles
- ↳ Weapons
- ↳ Scripts
- ↳ Player
- ↳ Maps
- ↳ Misc
- San Andreas Multi Player
- ↳ Discutii Scripting
- ↳ Probleme GodFather
- ↳ Tutoriale
- ↳ Cerere Tutoriale
- ↳ Salonul Scripturilor
- ↳ Plugins
- ↳ Maps
- ↳ Gamemode
- ↳ FilterScript
- ↳ News Development
- ↳ Ajutor Servere
- Diverse
- ↳ Discutii diverse
- ↳ Realitatea Baptista Castellon
- ↳ Arta
- ↳ Studentie
- ↳ Auto / Moto
- ↳ Fashion
- ↳ Sanatate
- Photoshop
- ↳ Photoshop
- ↳ Creatii
- ↳ Gifts
- ↳ Graphic Battle
- ↳ Tutoriale
- ↳ Competitii: - SOTW
- ↳ Resurse
- ↳ Ripperi
- ↳ Cereri Photoshop
- ↳ Da LIKE pe FaceBook si castigi 10 euro saptamanal!!
- Filme & Muzica
- ↳ Filme
- ↳ Muzica
- Minunile Lumii Antince
- ↳ Cele 7 Minuni ale Lumii
- ↳ Minuni uitate ale Lumii Antice
- LOVE & SEX
- ↳ Love & Sex
- ↳ Contraceptia
- ↳ Dragostea
- Hubul dc.zonek.ro al serverelor de Counter-Strike
- ↳ Totul despre hubul dc.zonek.ro
- Culturi si Mistere
- ↳ Culturi ascunse, mistere si fapte inexplicabile
- ↳ Magie
- ↳ Lumea Viselor
- |Messenger| & Curiozitatii
- ↳ <|Mesaje tampite care se dau pe mess|>
- ↳ Intrebari fara raspuns
- ↳ Stiati ca ?
- ↳ Pentru cei nemultumiti
- Manage Holidays/Sarbatori si Zile Onomastice
- ↳ Manage Holidays / Sarbatori si Zile Onomastice
- Recycle Bin
- ↳ Recycle Bin
- ↳ HaoS.ZoneK.Ro [ Public Server ]
- ↳ Regulament
- ↳ Anunturi
- ↳ Cafenea Admini
- ↳ Staff
- ↳ Cerere Admin
- ↳ Cerere Slot
- ↳ Cerere UnBan
- ↳ Reclamatie Admini
- ↳ Lista Banuri
- ↳ Redirecte
- ↳ djs.zonek.ro
- ↳ Regulament
- ↳ Cereri admin / slot pe djs.zonek.ro
- ↳ Cerere UnBan
- ↳ Reclamatii admini / playeri
- ↳ Campionat 2 vs 2
- ↳ Discutii Libere
- ↳ Clanu Dj's
- ↳ Ballas
- ↳ Nortenos
- ↳ Surenos
- ↳ Taxele serverului
- ↳ Vanzari - Cumparari
- ↳ Afaceri
- ↳ Servicii
- ↳ Case
- ↳ Politia Romana
- ↳ Discutii generale despre factiuni
- ↳ Pompieri si Medici
- ↳ Serviciul Roman de informatii
- ↳ Armata Romana
- ↳ Clanul Frusin
- ↳ Clanul Racean
- ↳ Guvernator San Andreas
- ↳ Asasini Platiti
- ↳ Reporteri ProTV
- ↳ Transport Company
- ↳ Instructori
- ↳ Clanul Camataru
- ↳ Job-uri secundare
- ↳ Tow Car Company
- ↳ Tutoriale GTA SA:MP
- ↳ freerunners.zonek.ro
- ↳ Admins only
- ↳ Regulament
- ↳ Anunturi
- ↳ Donatii
- ↳ Echipa nord
- ↳ Cereri admin/slot
- ↳ Cereri unban
- ↳ De ce am dat ban
- ↳ Cine face abuz de admin
- ↳ Discutii libere
- ↳ Evidenta redirecte
- ↳ Ghenaaaaaa.....!!!
- ↳ Grove Street
- ↳ Ballas Family
- ↳ Mayor
- ↳ The Triads
- ↳ The Mafia
- ↳ Varios Los Aztecas
- ↳ License Faction
- ↳ Los Santos Vagos
- ↳ News Reporter
- ↳ Taxi Company
- ↳ National Guard
- ↳ Police Departament
- ↳ Federal Bureau of Investigaton
- ↳ Medics
- ↳ Hitman Agency
- ↳ furien.zonek.ro
- ↳ Regulament Server
- ↳ Anunturi
- ↳ Cerere Admin / Slot
- ↳ Cerere UnBan
- ↳ Cerere Ban
- ↳ Reclamatii
- ↳ Echipa furien.zonek.ro
- ↳ Mariri / degradari
- ↳ Redirecte
- ↳ Discutii Generale
- ↳ Download Redirecte
- ↳ FAN.ZONEK.RO # Fan Curier Server
- ↳ intrudersWOW - www.zonek.ro
- ↳ Announcements / Server info
- ↳ International Zone
- ↳ Romanian
- ↳ German
- ↳ English
- ↳ Requests
- ↳ Ban \ Mute Request
- ↳ Unban / Unmute requests
- ↳ Bug Report
- ↳ Items
- ↳ Other
- ↳ Fixed bugs
- ↳ General Discussion
- ↳ Ze.Zonek.Ro # Intruders Zombie
- ↳ Stream name: ...::: CooLFM :::... - Cel mai tare Radio
- ↳ I'm in love!
- ↳ Request
- ↳ Events - Radio CooLFM
- ↳ Cautam Dj`eitze si DJ-eii
- ↳ Personal Top Ten (?)
- ↳ Zonek SA:MP Official Server
- ↳ Informatii
- ↳ Sugestii
- ↳ Update's
- ↳ Factiuni
- ↳ Police Depatament
- ↳ Federal Bureau of Investigations
- ↳ National Guard
- ↳ Fireman/Paramedics
- ↳ The Mafia
- ↳ The Triads
- ↳ The Mayor
- ↳ Hitman Agency
- ↳ News Reporter
- ↳ Taxi Company
- ↳ License Faction
- ↳ Los Santos Vagos
- ↳ Varios Los Aztecas
- ↳ Ballas
- ↳ Grove Street
- ↳ NFS Club
- ↳ NRG Club
- ↳ Plangeri
- ↳ Admin's Zone
- ↳ Diverse
- ↳ Buguri
- ↳ Statistici WEB
- ↳ LIGHT.ZONEK.RO | Anti-Cheat | Skins |
- ↳ DM.ZONEK.RO
- ↳ WAR3.ZONEK.RO
- ↳ ELITE.ZONEK.RO
- ↳ Tools
