EN · $ USD
Security, DDoS and Backups

How to Hide Your FiveM Server IP with a Proxy

7 min read Updated: OyunBulut technical team

In short

Hiding a FiveM server IP takes two layers: setting sv_forceIndirectListing true in server.cfg so the server list does not publish your real IP, and routing player traffic (30120 TCP/UDP) through a proxy in front of the real server. The real server's firewall should only allow the proxy's IP. Because the proxy itself can be attacked, IP hiding should complement DDoS-protected infrastructure, not replace it.

In this guide
  1. Why hide your server IP?
  2. Where does the real IP leak from?
  3. Layer 1: keep the real IP out of the server list
  4. Layer 2: route player traffic through a proxy
  5. Layer 3: open the real server only to the proxy
  6. Trade-offs of a proxy setup
  7. DDoS-protected infrastructure: the foundation of IP hiding
  8. Verifying the setup
  9. Checklist
  10. Next step

Hiding your FiveM IP means keeping your server's real IP address from showing up in the server list, during connection and in side services. No single setting hides it completely: sv_forceIndirectListing removes it from the listing, but to hide player traffic as well, you need to put a proxy in front of your server and open the real server only to that proxy. This guide walks through where your IP leaks from, the two-layer setup and how it works alongside DDoS protection, step by step.

Why hide your server IP?

In the highly competitive roleplay community, the most common attack is a DDoS aimed at the server's IP address. Once an attacker finds the IP, they send traffic straight to it. The goal of IP hiding is to make the attack's target invisible and move the visible point (the proxy) somewhere that can withstand attacks.

An important distinction: IP hiding does not stop attacks; it only changes where they go. DDoS protection is what absorbs them. That is why the two measures are used together. We explain how protection works in detail in the game server DDoS protection guide.

Where does the real IP leak from?

  • Server list: With default settings, the server info in the list points to the real IP.
  • Direct connect: If players connect with connect IP:30120, everyone already has the IP.
  • txAdmin: If port 40120 is open to the world and its link has been shared, the IP has been shared too.
  • Services on the same IP: If your website, application panel, FTP or database runs on the same server, your domain's DNS record reveals the real IP.
  • Old DNS records: An IP you once published with an A record can linger in DNS history services.
  • Human error: Screenshots, console logs and error reports shared within the team.

If your IP has already spread through one of these routes, setting up a proxy alone is not enough; the real server's IP address must also change. In that case, discuss IP change options with your provider.

Layer 1: keep the real IP out of the server list

sv_forceIndirectListing makes your server appear in the list indirectly (through a host you specify) instead of by its real IP. On its own, it stops the listing card from showing the IP directly, but the address players connect to is still the real server. Together with a proxy, the server.cfg settings look like this:

set sv_forceIndirectListing true
set sv_listingHostOverride "fivem.alanadiniz.com"
set sv_listingIpOverride "PROXY_IP"
set sv_proxyIPRanges "PROXY_IP/32"
set sv_endpointPrivacy true
  • sv_listingHostOverride: The domain the list server uses to fetch info. This domain must point to the proxy.
  • sv_listingIpOverride: The IP used in the listing; put the proxy IP here.
  • sv_proxyIPRanges: The IP ranges FXServer trusts as proxies. This lets it honor the real client IP header in HTTP requests coming from the proxy.
  • sv_endpointPrivacy: Keeps player IP addresses out of the server's public info output.

For the official description of these settings and current details, see the FiveM proxy setup documentation.

Layer 2: route player traffic through a proxy

A reverse proxy is an intermediate server that players connect to and that forwards traffic to the real server behind it. Players only ever see the proxy's IP. Because FiveM uses both TCP and UDP, you need two kinds of forwarding: a stream proxy for game traffic and an HTTP proxy for HTTP requests such as listing info and file downloads.

nginx configuration on the proxy server

The example below uses nginx on Linux. The stream module must be installed. Replace GERCEK_IP (the placeholder for your real IP) with your FiveM server's IP.

# In /etc/nginx/nginx.conf, outside the http block
stream {
    upstream fivem_game {
        server GERCEK_IP:30120;
    }
    server {
        listen 30120;
        proxy_pass fivem_game;
    }
    server {
        listen 30120 udp reuseport;
        proxy_pass fivem_game;
    }
}
# /etc/nginx/conf.d/fivem.conf (loaded inside the http block)
upstream fivem_http {
    server GERCEK_IP:30120;
}
server {
    listen 443 ssl;
    server_name fivem.alanadiniz.com;
    ssl_certificate     /etc/letsencrypt/live/fivem.alanadiniz.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/fivem.alanadiniz.com/privkey.pem;

    location / {
        proxy_pass http://fivem_http;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Test the configuration and reload:

nginx -t
systemctl reload nginx

Your domain's DNS A record (fivem.alanadiniz.com, replaced with your own domain) must point to the proxy IP; the real IP must not appear in any DNS record. For all options of the nginx stream module, see the nginx stream proxy documentation.

Optional: route file downloads through the proxy

Players download resource files when they connect. To route these downloads through a proxy or cache server too, you can use FXServer's fileserver_add command. On servers with large asset packs, this step also eases bandwidth; set it up following the caching example in the official proxy documentation.

Layer 3: open the real server only to the proxy

If the real server is still open to everyone after the proxy is in place, anyone who finds the IP can bypass the proxy and attack directly. So open port 30120 only to the proxy IP.

On Linux (ufw), add the SSH rule first so you do not lose SSH access:

ufw allow 22/tcp
ufw default deny incoming
ufw allow from PROXY_IP to any port 30120 proto tcp
ufw allow from PROXY_IP to any port 30120 proto udp
ufw enable

On a Windows server, with PowerShell:

New-NetFirewallRule -DisplayName "FiveM TCP proxy" -Direction Inbound -Protocol TCP -LocalPort 30120 -RemoteAddress PROXY_IP -Action Allow
New-NetFirewallRule -DisplayName "FiveM UDP proxy" -Direction Inbound -Protocol UDP -LocalPort 30120 -RemoteAddress PROXY_IP -Action Allow

On Windows, remember to disable any existing allow-all rules for 30120; otherwise the new rule will not restrict anything by itself. Also open txAdmin's port 40120 only to your own IP address. For general hardening, see the VDS security guide: SSH, RDP and firewall.

Trade-offs of a proxy setup

  • An extra hop: Because traffic passes through the proxy, keeping the proxy and the real server in nearby locations keeps latency low.
  • Player IPs: With UDP traffic, the server may see players as the proxy IP. Base your ban systems on identifiers such as license, Discord and Steam instead of IP.
  • The proxy is a target too: Attackers will now hit the proxy. If the proxy's infrastructure is not DDoS-protected, you have only moved the problem.
  • Maintenance: It means two servers, an SSL certificate and DNS management.

If you run into connection problems after setting up the proxy (players get stuck, listing info does not load), work through the checks in the FiveM connection errors guide.

DDoS-protected infrastructure: the foundation of IP hiding

For most small and mid-sized servers, hosting the server directly on DDoS-protected infrastructure is a more practical starting point than managing a separate proxy chain. In that case, you limit IP exposure with basic measures such as sv_forceIndirectListing, a closed txAdmin port and not hosting your website on the same IP, while potential attacks are absorbed at the infrastructure layer. You can add the proxy setup later as a second line of defense for a growing server.

OyunBulut's OB-FIVEM-4 FiveM server with 8 GB DDR5 RAM comes with DDoS protection and automatic setup, a balanced option for launching a mid-sized roleplay server on protected infrastructure.

Verifying the setup

After configuring everything, check that the IP is actually hidden:

  1. Open your server from the server list in the FiveM client and connect. If the connection works, the proxy is carrying the traffic.
  2. Watch the nginx access and error logs on the proxy server; requests should show up there while you connect.
  3. From a machine other than the proxy, try connecting to the real server with connect GERCEK_IP:30120. If the firewall is set up correctly, the connection will fail.
  4. Check your domain's DNS records; none of them should show the real IP.

Repeat these checks after every major change. A new web service, another subdomain or a DNS record added by a team member can expose in one go the IP you carefully hid for months. The safest approach is for only the one or two people who manage the server to know the real IP.

Checklist

  1. Add sv_forceIndirectListing true and the listing override lines.
  2. Share a domain or cfx.re link with players instead of an IP.
  3. Host your website and application panel on a different IP than the FiveM server.
  4. Close the txAdmin and database ports to the outside world.
  5. If you use a proxy, open 30120 on the real server only to the proxy IP.
  6. If your IP has already leaked, open a support ticket to request an IP change.

Next step

Before configuring IP hiding, make sure your server runs on DDoS-protected infrastructure. You can browse the DDoS-protected FiveM server plans and pick the one that fits your player target, or start a mid-sized server directly with OB-FIVEM-4. If you get stuck during setup, you can reach the support team (which works in Turkish) through a ticket.

Frequently asked questions

Does sv_forceIndirectListing hide my IP on its own?

No. It only stops the server list from publishing your real IP directly. If player traffic still goes to the real server, the IP can be discovered during connection; full privacy requires a proxy and a firewall restriction.

Which ports do I need to route through the proxy for FiveM?

Route ports 30120 TCP and 30120 UDP through the proxy for game connections. Do not add txAdmin's port 40120 to the proxy; keep it open only to your own IP address.

Does using a proxy increase ping?

Because traffic passes through an extra hop, it can add some latency. Keeping the proxy and the real server in nearby locations keeps that difference small.

My IP has already leaked. Is setting up a proxy enough?

No, because an attacker can hit the real IP they already know directly. Along with the proxy setup, you need to change the real server's IP address and open the firewall only to the proxy.

Does hiding my IP replace DDoS protection?

No. IP hiding changes the attack's target, while DDoS protection is what absorbs the attack. Both the proxy and the server should be on DDoS-protected infrastructure.

For this guide

Recommended plans

OB-FIVEM-4 offers mid-sized roleplay servers a balanced start for building IP-hiding measures on top of DDoS-protected infrastructure, with 8 GB DDR5 RAM and automatic setup.

OB-FIVEM-4

Recommended

8 GB DDR5 RAM

$21.62/mo

+VAT

  • Processor4 CPU
  • Disk70 GB NVMe
  • LocationIstanbul
  • DDoS
  • Automatic Setup

2 GB DDR5 RAM

$7.86/mo

+VAT

  • Processor2 CPU
  • Disk40 GB NVMe
  • LocationIstanbul
  • DDoS
  • Automatic Setup

4 GB DDR5 RAM

$11.01/mo

+VAT

  • Processor2 CPU
  • Disk50 GB NVMe
  • LocationIstanbul
  • DDoS
  • Automatic Setup

FiveM — tüm paketler

Need help with setup?

Send questions about your service in a support ticket, and our technical team will walk you through it step by step.