FRP (Fast Reverse Proxy)
Fast reverse proxy to expose local servers behind NAT or firewall to the internet
[i]Overview
FRP (Fast Reverse Proxy) is a high-performance reverse proxy application designed to expose local servers behind NAT or firewalls to the internet through secure tunnels. Originally developed by fatedier, FRP has become a popular open-source alternative to commercial solutions like ngrok, offering both HTTP/HTTPS and TCP/UDP tunneling capabilities with minimal latency overhead. The project consists of two core components: frps (server) and frpc (client), which work together to establish secure connections between private networks and public servers.
This Docker stack deploys the complete FRP infrastructure with frps running on a public server to accept incoming connections and route them through established tunnels to frpc clients running on private networks. The server component provides a web dashboard for monitoring active tunnels, connection statistics, and proxy configurations, while supporting multiple authentication methods and bandwidth limiting. The architecture enables bidirectional communication through NAT traversal without requiring port forwarding or firewall modifications on the client side.
Developers working from home offices, system administrators managing remote servers, and organizations running services on private networks will find this stack invaluable for secure remote access. The combination offers enterprise-grade tunneling capabilities with fine-grained access controls, custom domain support, and the ability to handle thousands of concurrent connections while maintaining low resource overhead compared to VPN solutions.
[*]Key Features
- [+]Multi-protocol tunnel support including HTTP, HTTPS, TCP, UDP, and STCP for diverse application requirements
- [+]Built-in web dashboard on port 7500 providing real-time monitoring of active proxies and bandwidth usage
- [+]Token-based authentication system preventing unauthorized tunnel establishment with configurable user permissions
- [+]Virtual host routing enabling multiple HTTP services to share port 80/443 through subdomain mapping
- [+]Bandwidth limiting and connection throttling to prevent abuse and manage resource consumption
- [+]Plugin system supporting authentication hooks, HTTPS certificate management, and custom request modification
- [+]Health check capabilities with automatic proxy restart on backend service failures
- [+]End-to-end encryption for all tunnel traffic with support for custom TLS certificates
[#]Common Use Cases
- [1]Home lab administrators exposing local web services and APIs to the internet without public IP addresses
- [2]Remote development teams accessing staging servers and databases located behind corporate firewalls
- [3]IoT device manufacturers providing secure remote management interfaces for deployed hardware
- [4]Small businesses running internal applications that need occasional external access without VPN complexity
- [5]Game server hosting where players need direct TCP connections to servers on residential networks
- [6]Security researchers creating temporary public endpoints for webhook testing and API development
- [7]Freelance developers demonstrating client projects hosted on local development environments
[!]Prerequisites
- [!]Public server with static IP address and minimum 512MB RAM for frps deployment
- [!]DNS records pointing to the public server for custom domain routing (A records for subdomains)
- [!]Open firewall ports 7000, 7500, 80, and 443 on the public server for tunnel and web traffic
- [!]Basic understanding of TOML configuration format for frps.toml and frpc.toml setup
- [!]Network connectivity between frpc clients and frps server on port 7000 for tunnel establishment
- [!]SSL certificates for HTTPS tunneling if using custom domains with encrypted traffic
[!]
WARNING: For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
[$]docker-compose.yml
[docker-compose.yml]
1# FRP Server (run on public server)2services: 3 frps: 4 image: snowdreamtech/frps:latest5 container_name: frps6 restart: unless-stopped7 ports: 8 - "${BIND_PORT:-7000}:7000"9 - "${DASHBOARD_PORT:-7500}:7500"10 - "${VHOST_HTTP_PORT:-80}:80"11 - "${VHOST_HTTPS_PORT:-443}:443"12 volumes: 13 - ./frps.toml:/etc/frp/frps.toml:ro14 command: ["-c", "/etc/frp/frps.toml"]1516---17# FRP Client (run on local machine) - separate docker-compose.yml18# services:19# frpc:20# image: snowdreamtech/frpc:latest21# container_name: frpc22# restart: unless-stopped23# volumes:24# - ./frpc.toml:/etc/frp/frpc.toml:ro25# command: ["-c", "/etc/frp/frpc.toml"]26# network_mode: host # To access local services[$].env Template
[.env]
1# FRP Server Configuration2BIND_PORT=70003DASHBOARD_PORT=75004VHOST_HTTP_PORT=805VHOST_HTTPS_PORT=44367# Create frps.toml:8# bindPort = 70009# vhostHTTPPort = 8010# vhostHTTPSPort = 44311#12# webServer.addr = "0.0.0.0"13# webServer.port = 750014# webServer.user = "admin"15# webServer.password = "admin"16#17# auth.method = "token"18# auth.token = "your-secret-token"1920# Create frpc.toml (on client):21# serverAddr = "your-server-ip"22# serverPort = 700023# auth.token = "your-secret-token"24#25# [[proxies]]26# name = "web"27# type = "http"28# localPort = 300029# customDomains = ["app.yourdomain.com"][i]Usage Notes
- [1]Server dashboard at http://server-ip:7500
- [2]Create frps.toml config before starting server
- [3]Create frpc.toml config for each client
- [4]Use same auth.token on server and clients
- [5]Supports HTTP, HTTPS, TCP, UDP, STCP tunnels
- [6]Alternative to ngrok for self-hosted tunneling
[>]Quick Start
[terminal]
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3# FRP Server (run on public server)4services:5 frps:6 image: snowdreamtech/frps:latest7 container_name: frps8 restart: unless-stopped9 ports:10 - "${BIND_PORT:-7000}:7000"11 - "${DASHBOARD_PORT:-7500}:7500"12 - "${VHOST_HTTP_PORT:-80}:80"13 - "${VHOST_HTTPS_PORT:-443}:443"14 volumes:15 - ./frps.toml:/etc/frp/frps.toml:ro16 command: ["-c", "/etc/frp/frps.toml"]1718---19# FRP Client (run on local machine) - separate docker-compose.yml20# services:21# frpc:22# image: snowdreamtech/frpc:latest23# container_name: frpc24# restart: unless-stopped25# volumes:26# - ./frpc.toml:/etc/frp/frpc.toml:ro27# command: ["-c", "/etc/frp/frpc.toml"]28# network_mode: host # To access local services29EOF3031# 2. Create the .env file32cat > .env << 'EOF'33# FRP Server Configuration34BIND_PORT=700035DASHBOARD_PORT=750036VHOST_HTTP_PORT=8037VHOST_HTTPS_PORT=4433839# Create frps.toml:40# bindPort = 700041# vhostHTTPPort = 8042# vhostHTTPSPort = 44343#44# webServer.addr = "0.0.0.0"45# webServer.port = 750046# webServer.user = "admin"47# webServer.password = "admin"48#49# auth.method = "token"50# auth.token = "your-secret-token"5152# Create frpc.toml (on client):53# serverAddr = "your-server-ip"54# serverPort = 700055# auth.token = "your-secret-token"56#57# [[proxies]]58# name = "web"59# type = "http"60# localPort = 300061# customDomains = ["app.yourdomain.com"]62EOF6364# 3. Start the services65docker compose up -d6667# 4. View logs68docker compose logs -f[>]One-Liner
Run this command to download and set up the recipe in one step:
[terminal]
1curl -fsSL https://docker.recipes/api/recipes/frp/run | bash[?]Troubleshooting
- [!]Connection refused on port 7000: Verify frps container is running and firewall allows incoming connections on the bind port
- [!]Dashboard not accessible on port 7500: Check if dashboard is enabled in frps.toml and DASHBOARD_PORT environment variable matches configuration
- [!]Tunnel established but HTTP requests fail: Ensure virtual host configuration matches the subdomain DNS records and backend service is accessible from frpc
- [!]Authentication failed errors: Verify auth.token matches exactly between frps.toml and frpc.toml configurations including any special characters
- [!]High memory usage on frps: Enable connection pooling and set max_connections limit in server configuration to prevent resource exhaustion
- [!]SSL certificate errors with HTTPS tunnels: Configure custom certificates in frps.toml or disable HTTPS verification for development environments
Community Notes
Loading...
Loading notes...
## Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
## Components
frpsfrpc
## Tags
#proxy#tunnel#nat#reverse-proxy#expose#ngrok-alternative
## Category
Security & NetworkingShortcuts: C CopyF FavoriteD Download