How to Host a Game Server Behind CGNAT Using FRP (Fast Reverse Proxy)

Published on

If your ISP uses Carrier-Grade NAT, you cannot forward ports to host a game server at home. FRP lets you tunnel through this restriction using an external VPS as a relay. Here is exactly how to set it up.

Written by Jochem Wassenaar – CEO of Space-Node – 15+ years combined experience in game server hosting, VPS infrastructure, and 24/7 streaming solutions. Learn more

You want to host a Minecraft server from home. You forward port 25565 in your router. You test the connection. Players cannot reach it.

This happens because your internet service provider assigns your router a shared IP address using Carrier-Grade Network Address Translation (CGNAT). Your home router never receives a real public IP. It receives a private address from the provider's own NAT layer. Port forwarding from your router does nothing because no one outside your ISP's network can route directly to your machine.

This is increasingly common across Europe, university networks, and mobile broadband connections.

Fast Reverse Proxy (FRP) solves this without requiring any changes from your ISP.


How FRP Works

FRP has two components:

  • frps (server): Runs on an external machine with a real public IP address. Usually a VPS. This is the public-facing relay.
  • frpc (client): Runs on your home machine where the game server is. It creates an outbound connection to frps.

Because the client initiates the connection outbound from your home network to the VPS, CGNAT is not a problem. Outbound connections always work. The VPS then forwards incoming player connections through the established tunnel to your home machine.

Players connect to your VPS IP. The VPS relays the traffic to your home server. Your home server processes it and replies back through the same tunnel.


What This Requires

  1. A VPS with a public IP address. This is the relay server.
  2. The game server software running on your home machine.
  3. Both machines running Linux (or Windows, though this guide covers Linux).

For a VPS relay, you do not need much. Even a minimal 1 vCPU, 512 MB RAM VPS is sufficient since it is only relaying traffic, not processing the game. Space-Node VPS plans work well for this.


Understanding TCP vs UDP for Game Servers

Web traffic uses TCP exclusively. Game servers are different.

Minecraft Java Edition uses TCP on port 25565 for all game communication. FRP handles TCP tunneling well by default.

Some games and some Minecraft variants use UDP. Bedrock Edition uses UDP on port 19132. FiveM uses UDP for voice and game state. Satisfactory uses UDP.

FRP supports both protocols, but you must configure each explicitly. A common mistake is setting up only TCP forwarding and wondering why Bedrock Edition players cannot connect.


Installing FRP on the VPS (Server Side)

SSH into your VPS and run:

# Download the latest FRP release (check github.com/fatedier/frp for latest version)
wget https://github.com/fatedier/frp/releases/download/v0.61.0/frp_0.61.0_linux_amd64.tar.gz
tar -xzf frp_0.61.0_linux_amd64.tar.gz
cd frp_0.61.0_linux_amd64

Create the server configuration file /etc/frp/frps.toml:

bindPort = 7000

# Authentication token - change this to something secure
auth.method = "token"
auth.token = "your-secure-token-here"

# Optional: web dashboard to monitor connections
webServer.port = 7500
webServer.user = "admin"
webServer.password = "your-dashboard-password"

Start the server:

./frps -c /etc/frp/frps.toml

Open the required ports in your VPS firewall:

# FRP control port
ufw allow 7000/tcp

# The port players will connect to
ufw allow 25565/tcp

# If you need UDP as well
ufw allow 25565/udp

Installing FRP on the Home Machine (Client Side)

On your home machine running the game server:

wget https://github.com/fatedier/frp/releases/download/v0.61.0/frp_0.61.0_linux_amd64.tar.gz
tar -xzf frp_0.61.0_linux_amd64.tar.gz
cd frp_0.61.0_linux_amd64

Create the client configuration file /etc/frp/frpc.toml:

serverAddr = "your-vps-ip"
serverPort = 7000

auth.method = "token"
auth.token = "your-secure-token-here"

# TCP tunnel for Minecraft Java Edition
[[proxies]]
name = "minecraft-tcp"
type = "tcp"
localIP = "127.0.0.1"
localPort = 25565
remotePort = 25565

# If you also need UDP (e.g., Bedrock Edition on 19132)
[[proxies]]
name = "minecraft-udp"
type = "udp"
localIP = "127.0.0.1"
localPort = 19132
remotePort = 19132

Start the client:

./frpc -c /etc/frp/frpc.toml

Testing the Connection

From another machine on a completely different network (not the same home network or VPS), test the connection:

# For Minecraft Java Edition
nc -vz your-vps-ip 25565

# Or simply add the server in the Minecraft client using your VPS IP address

If the connection succeeds, players connect using your VPS IP address. The FRP tunnel relays everything transparently.


Running FRP as a Service

Running FRP in a terminal session means it stops when you close the terminal. Set it up as a systemd service to run persistently.

On the VPS, create /etc/systemd/system/frps.service:

[Unit]
Description=FRP Server
After=network.target

[Service]
Type=simple
ExecStart=/root/frp_0.61.0_linux_amd64/frps -c /etc/frp/frps.toml
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

Enable and start:

systemctl enable frps
systemctl start frps

Do the same for frpc on your home machine using the same pattern, substituting frpc for frps.


Performance Considerations

FRP adds one network hop between the player and your game server. Latency from the player to your VPS plus latency from your VPS to your home machine determines total ping for your players.

Example: A player in Amsterdam connects to your VPS in Amsterdam (2ms), then the VPS tunnels to your home in Germany (15ms). Total: approximately 17ms perceived latency. Without FRP, a direct home server in Germany would give that player about 15ms. The difference is small.

Bandwidth is the other consideration. Your game server traffic flows through your VPS's network interface. Make sure your VPS plan includes enough bandwidth. A Minecraft server with 10 players uses roughly 2 to 5 Mbps. Most VPS plans are more than adequate.


When You Should Just Use Proper Hosting

FRP is a workaround for CGNAT. Your home server still has the limitations of residential internet:

  • Uptime depends on your home power and ISP reliability
  • Your home IP changes when your router restarts (use dynamic DNS to handle this)
  • Upload bandwidth is often limited on residential connections
  • Your home machine uses power 24/7

For a long-term server used by more than a handful of friends, a dedicated game server or VPS often makes more sense economically and technically than a home + VPS relay setup.

FRP is excellent for: testing, short-term projects, university dorm setups where you genuinely have no other option, or home lab environments where you want the learning experience.

For a production server, Space-Node offers Minecraft hosting from €0.90/month with proper public IP allocation, DDoS protection, and NVMe storage, without needing any proxy workarounds.

Jochem Wassenaar

About the Author

Jochem Wassenaar – CEO of Space-Node – Experts in game server hosting, VPS infrastructure, and 24/7 streaming solutions with 15+ years combined experience.

Since 2023
500+ servers hosted
4.8/5 avg rating

Our team specializes in Minecraft, FiveM, Rust, and 24/7 streaming infrastructure, operating enterprise-grade AMD Ryzen 9 hardware in Netherlands datacenters. We maintain GDPR compliance and ISO 27001-aligned security standards.

Read full author bio and credentials →

Launch Your VPS Today

Get started with professional VPS hosting powered by enterprise hardware. Instant deployment and 24/7 support included.

How to Host a Game Server Behind CGNAT Using FRP (Fast Reverse Proxy)