使用 Docker 部署 FRP

Undefined443發表於2024-04-22

服務端

編寫配置檔案

vim ~/.config/frp/frps.toml
bindPort = 7000

# Web Dashboard
[webServer]
addr = "0.0.0.0"
port = 7500
user = "xxx"
password = "xxx"

啟動 Docker 容器

docker run -d --restart always --network host --name frps -v ~/.config/frp/frps.toml:/etc/frp/frps.toml snowdreamtech/frps

客戶端

編寫配置檔案

vim ~/.config/frp/frpc.toml
serverAddr = "x.x.x.x"
serverPort = 7000

# 認證
[auth]
method = "token"
token = "xxx"

# Web Dashboard
[webServer]
addr = "0.0.0.0"
port = 7400
user = "xxx"
password = "xxx"
pprofEnable = false

# 內網穿透配置
[[proxies]]
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 6000

啟動 Docker 容器

docker run -d --restart always --network host --name frpc -v ~/.config/frp/frpc.toml:/etc/frp/frpc.toml snowdreamtech/frps

檢視日誌:

docker logs frpc

相關文章