Deploy FRP with Docker: Intranet Penetration Made Simple
This guide explains the fundamentals of FRP, a reverse‑proxy tool for intranet penetration, and provides step‑by‑step instructions to deploy the FRPS server and FRPC client with Docker, configure ports, view logs, access the dashboard, expose local services, and troubleshoot common issues.
What is FRP and why use it?
FRP (Fast Reverse Proxy) is a lightweight reverse‑proxy software that enables intranet penetration : exposing services inside a private LAN to the public Internet. Normally devices in different LANs cannot reach each other, but FRP creates a persistent tunnel so that any external device can access a designated internal service.
Typical use cases include remote desktop access, game server hosting, file‑printer sharing, and exposing local development environments (e.g., GitHub webhooks) to the outside world.
FRP architecture
FRP consists of two components: frps – the server side, deployed on a public machine. frpc – the client side, installed on a machine inside the private network.
The client establishes a long‑living connection to the server; the server then forwards incoming requests to the client, which can further proxy them to the target internal service.
Deploying the FRPS server with Docker
Create a configuration file frps.toml (example path /home/moyuanjun/frp/frps.toml) with the following content:
bindPort = 7000
log.to = "console"
vhostHTTPPort = 7100
vhostHTTPSPort = 7200
auth.method = "token"
auth.token = "password"
webServer.port = 7300
webServer.addr = "0.0.0.0"
webServer.user = "admin"
webServer.password = "admin"Pull the Docker image and run the container, mounting the configuration file:
sudo docker pull snowdreamtech/frps sudo docker run -d \
--network host \
-v /home/moyuanjun/frp/frps.toml:/etc/frp/frps.toml \
--name frps \
snowdreamtech/frpsLogs can be inspected with docker logs frps or docker logs -f frps. The built‑in dashboard is reachable at http://<em>your_public_ip</em>:7300 (default credentials are the values set in frps.toml).
Deploying the FRPC client with Docker
Create a client configuration file frpc.toml (example path /Users/qianyin/frp/frpc.toml) such as:
serverPort = 7000
serverAddr = "www.kunlunxu.cc"
log.to = "console"
auth.token = "password"
[[proxies]]
name = "web"
type = "tcp"
localIP = "192.168.0.108"
localPort = 5500
remotePort = 7001Pull and run the client container:
docker pull snowdreamtech/frpc docker run -d \
--network host \
-v /Users/qianyin/frp/frpc.toml:/etc/frp/frpc.toml \
--name frpc \
snowdreamtech/frpcVerify the client is running with docker logs frpc. The FRPS dashboard will show the client’s connection count.
Exposing a local HTTP service (TCP version)
Start a local static site (e.g., via VS Code Live Server) on 192.168.0.108:5500. Add a TCP proxy in frpc.toml as shown above, then restart the client container:
docker stop frpc
docker start frpcAccess the service at http://www.kunlunxu.cc:7001.
Exposing a local HTTP service (HTTP version)
When vhostHTTPPort = 7100 is set on the server, add an HTTP proxy:
[[proxies]]
name = "web - http"
type = "http"
localIP = "192.168.0.108"
localPort = 5500
customDomains = ["www.kunlunxu.cc"]Restart the client and visit http://www.kunlunxu.cc:7100 to see the internal site.
Troubleshooting
Version mismatch : Newer FRP releases use .toml files; older tutorials may reference .ini. Always consult the official FRP documentation for the version you installed.
Identifying the container’s config file : Use docker inspect frps or docker inspect frpc to view mounted volumes.
Viewing logs : Ensure log.to = "console" is set, then run docker logs frps or docker logs frpc. Use -f for live streaming.
Docker Hub acceleration issues : If a mirror prevents pulling the latest image, remove the custom daemon configuration ( /etc/docker/daemon.json) and restart Docker to connect directly to Docker Hub.
By following these steps you can securely expose internal services, monitor connections via the FRPS dashboard, and resolve common deployment problems.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
