In the modern landscape of software development and remote infrastructure management, a common challenge emerges: how to access a local server tucked safely behind a NAT (Network Address Translation) or a restrictive firewall from the public internet. Whether you are hosting a private web server, a home automation system, or a remote desktop, the traditional method of port forwarding on a router is often cumbersome, insecure, or simply impossible in CGNAT (Carrier-Grade NAT) environments.
This is where FRP (Fast Reverse Proxy) comes into play. FRP is a high-performance reverse proxy application written in Go that allows you to expose local services to the internet with minimal latency and high security. By creating a secure tunnel between a local client and a public-facing server, FRP bypasses traditional networking hurdles. In this guide, we will explore the technical nuances of FRP, providing a deep-dive tutorial on its installation, configuration, and security optimization.

Understanding FRP and Why It’s Essential for Modern Networking
Before diving into the command line, it is crucial to understand the architecture of FRP. Unlike a standard proxy that sits in front of a server to manage incoming traffic, a reverse proxy like FRP acts as an intermediary that facilitates “hole punching” through firewalls.
What is Fast Reverse Proxy (FRP)?
FRP consists of two primary components: the server-side application (frps) and the client-side application (frpc). The server-side is typically installed on a machine with a public IP address (such as a VPS), while the client-side is installed on the local machine you wish to expose. The client initiates a connection to the server, establishing a persistent tunnel. When a user accesses the public IP of the server on a specific port, FRP forwards that traffic through the tunnel to the local client.
Use Cases for FRP in Development and Remote Access
The versatility of FRP makes it a favorite among DevOps engineers and hobbyists alike. Common use cases include:
- Web Development: Sharing a local development environment (like a React or Django app) with a client or teammate without deploying to a staging server.
- Remote Desktop Access: Tunneling SSH, VNC, or RDP connections to access your home workstation from anywhere in the world.
- IoT Management: Accessing the dashboard of a Raspberry Pi or a home automation hub (like Home Assistant) located inside a home network.
- Bypassing CGNAT: For users whose ISPs do not provide a public IPv4 address, FRP is one of the most reliable ways to make local services reachable.
Prerequisites and Preparation
To successfully install and run FRP, you need a specific set of tools and environmental conditions. Because FRP relies on a relay mechanism, you cannot run it effectively with a single machine if that machine is behind a NAT.
Choosing Your Server (VPS)
The “anchor” of your FRP setup is the server (frps). You will need a Virtual Private Server (VPS) with a dedicated public IP address. Since FRP is written in Go and is extremely lightweight, even the smallest entry-level VPS (e.g., 1 vCPU, 512MB RAM) from providers like AWS, DigitalOcean, or Linode is sufficient. Ensure the server is running a Linux distribution like Ubuntu, Debian, or CentOS for the best compatibility and ease of management.
Local Environment Setup
The client (frpc) can run on almost any operating system, including Linux, Windows, macOS, and FreeBSD. Before starting, ensure that the service you want to expose (e.g., a web server on port 80 or an SSH server on port 22) is already running and accessible locally. You should also have basic terminal/SSH skills to navigate directories and edit configuration files.
Step-by-Step Installation Guide
The installation of FRP is straightforward because the developers provide pre-compiled binaries for various architectures. In this section, we will walk through the deployment on a Linux-based VPS and a Linux-based local client.
Downloading and Extracting FRP
First, visit the official FRP GitHub releases page to find the latest version. You must download the same version for both the server and the client to ensure compatibility.
- On both the server and the client, use
wgetto download the package:
wget https://github.com/fatedier/frp/releases/download/v0.52.3/frp_0.52.3_linux_amd64.tar.gz - Extract the archive:
tar -zxvf frp_0.52.3_linux_amd64.tar.gz - Navigate into the extracted folder. You will see both
frps(server) andfrpc(client) files, along with their respective configuration files (.tomlor.inidepending on the version).
Configuring the Server Side (frps)
Move to your VPS. We will configure the frps.toml file. Modern versions of FRP have moved from INI to TOML format for better structure.
# frps.toml
bindPort = 7000
vhostHTTPPort = 8080
auth.token = "your_secure_token_here"
- bindPort: This is the port the FRP server listens on for incoming connections from the client.
- vhostHTTPPort: If you are proxying HTTP traffic, this is the port that will listen for web requests.
- auth.token: This is a crucial security layer. Only clients with this matching token can connect to your server.
To start the server, run: ./frps -c ./frps.toml.
Configuring the Client Side (frpc)
Now, move to your local machine to configure the frpc.toml file. This file tells the client where the server is and what services to tunnel.

# frpc.toml
serverAddr = "x.x.x.x" # Your VPS Public IP
serverPort = 7000
auth.token = "your_secure_token_here"
[[proxies]]
name = "ssh-tunnel"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 6000
[[proxies]]
name = "web-tunnel"
type = "http"
localPort = 80
customDomains = ["www.yourdomain.com"]
In this configuration, we are tunneling two services: SSH (accessible via the VPS IP on port 6000) and a web server. To start the client, run: ./frpc -c ./frpc.toml.
Advanced Configuration and Security Best Practices
An improperly secured FRP installation can expose your local network to significant risks. Once the basic tunnel is operational, you should implement advanced configurations to harden the system.
Implementing Authentication and Encryption
Beyond the basic auth.token, you should enable transport layer security (TLS) to encrypt the data moving through the tunnel. Without encryption, sensitive data like SSH credentials or web session cookies could be intercepted.
In your frpc.toml, add:
transport.tls.enable = true
This ensures that the communication between the client and server is encrypted using TLS. Furthermore, for HTTP services, always use a reverse proxy like Nginx on the VPS side to handle SSL termination (HTTPS) using Let’s Encrypt. This ensures that the traffic is encrypted from the user’s browser all the way to your VPS.
Automating FRP with Systemd
Running FRP manually in a terminal session is not sustainable for production or long-term use. If the terminal closes or the server reboots, the tunnel will collapse. On Linux, the best way to manage this is via systemd.
Create a service file for the server:
sudo nano /etc/systemd/system/frps.service
[Unit]
Description=FRP Server Service
After=network.target
[Service]
Type=simple
User=nobody
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/bin/frps -c /etc/frp/frps.toml
[Install]
WantedBy=multi-user.target
Repeat a similar process for the client (frpc.service). Once the files are created, enable and start them using systemctl enable --now frps. This ensures that FRP starts automatically on boot and restarts if it crashes.
Troubleshooting Common FRP Installation Issues
Even with a detailed guide, network configurations can be finicky. Troubleshooting requires a methodical approach to identifying whether the issue lies in the network, the configuration, or the application itself.
Firewall and Port Forwarding Hurdles
The most common cause of FRP failure is blocked ports. Your VPS likely has a firewall (like UFW or firewalld) and a cloud security group (on AWS/GCP/Azure).
- Server Side: You must open the
bindPort(7000) for the client to connect. You must also open anyremotePort(e.g., 6000) that you have defined in your proxies. - Client Side: Ensure the local service (port 22, 80, etc.) is actually listening on
127.0.0.1or the local network interface.

Connection Stability and Log Analysis
If the connection frequently drops, consider the underlying protocol. By default, FRP uses TCP. However, in high-latency environments or networks with packet loss, switching to KCP (a fast, reliable ARQ protocol) can improve stability.
To enable KCP, add transport.protocol = "kcp" to both the server and client configurations. Additionally, always check the logs if something goes wrong. FRP provides detailed logs that can be configured in the .toml file:
log.to = "./frps.log"
log.level = "info"
log.maxDays = 3
By analyzing these logs, you can identify “authorization timeout” errors (usually clock desync), “connection refused” errors (firewall issues), or “token mismatch” errors (configuration typos).
In conclusion, FRP is an incredibly potent tool for any tech professional’s arsenal. By decoupling a service from its physical network limitations, it enables a level of flexibility that traditional networking struggles to match. When installed with a focus on security—utilizing TLS, strong tokens, and proper firewall management—FRP provides a robust, professional-grade solution for remote access and service exposure.
aViewFromTheCave is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. Amazon, the Amazon logo, AmazonSupply, and the AmazonSupply logo are trademarks of Amazon.com, Inc. or its affiliates. As an Amazon Associate we earn affiliate commissions from qualifying purchases.