Skip to content

Install FRP

The latest frp version at the time of publication of this article isv0.36.2. The server uses thex64architecture as an example, and the client uses thearmarchitecture as an example.## Config on Server### 1. Download FRPDownload the latest precompiled package for the corresponding platform from the [release] page of fatedier/frp. Download and unzip anywhere on the server``` wget https://github.com/fatedier/frp/releases/download/v0.36.2/frp_0.36.2_linux_amd64.tar.gz tar -zxvf frp*.tar.gz

### 2. Install FRPS```
cd frp*
mv frps /usr/bin/frps
mkdir /etc/frp
mv frps.ini /etc/frp/frps.ini

From Step2 to Step4 need ROOT authority, you need addsudobefore each command if NOT a ROOT user.

~~3a. Configuration of FRPS(before version 0.52.0)~~Edit the frp config filevim /etc/frps.iniand fill in the following format```

[common] bind_port = [your_port1] token = [your_token] vhost_http_port = [your_port2] bing_udp_port = [your_port3] vhost_https_port = [your_port4]

dashboard_port = [your_port5] dashboard_user = [User_name] dashboard_pwd = [your_Password]

>`bind_port`and`token`under`[common]`are required, the others are optional> 
> In newer versions,`bind_port`,`vhost_http_port`,`vhost_https_port`can be set to the same port
### 3b. Configuration of FRPS(newer then 0.52.0)Edit the frp config file`vim /etc/frps.toml`and fill in the following format```
bindAddr = "0.0.0.0"
bindPort = [bind_port]
transport.tcpMux = true
transport.tls.force = false
vhostHTTPPort = [http_port]
vhostHTTPSPort = [https_port]

webServer.addr = "127.0.0.1"
webServer.port = [web_port]
webServer.user = "web_user_name"
webServer.password = "web_user_password"

auth.method = "token"
auth.token = "auth_token"

4. Register Service and Start On boot```

mv systemd/frps.service /etc/systemd/system/frps.service systemctl daemon-reload systemctl start frps systemctl enable frps

## Config on Client> The client installation method is exactly the same as the server installation method. The only difference is in the configuration file. Therefore, only the differences from the server installation are explained.### 1. Download FRP for Client```
wget https://github.com/fatedier/frp/releases/download/v0.34.0/frp_0.34.0_linux_arm.tar.gz

2. Replace allfrpswithfrpc

~~3a. Configuration of FRPC(before 0.52.0)~~Edit the frp config filevim /etc/frpc.iniand fill in the following format```

[common] server_addr = [your_ip] server_port = [your_port] token = [your_token]

[Service] type = [tcp,http,https...] local_ip = 127.0.0.1 local_port = [your_local_service_port] remote_port = [your_remote_service_port]

- `server_addr`Fill in the ipv4 address of FRPS- `server_port`is the port corresponding to`bind_port`of the server- `token`is the`token`corresponding to the server
### 3b. Configuration of FRPC(newer then 0.52.0)Edit the frp config file`vim /etc/frpc.toml`and fill in the following format```
user = "user_name"
serverAddr = "srv_ip"
serverPort = [srv_bind_port]
loginFailExit = false

auth.method = "token"
auth.token = "auth_token"

transport.dialServerTimeout = 10
transport.tcpMux = true
transport.protocol = "tcp"
transport.connectServerLocalIP = "0.0.0.0"

transport.tls.enable = false

[[proxies]]
name = "proxy_name"
type = "tcp/http/https..."
localIP = "127.0.0.1"
localPort = [local_port]

Config HTTP Connection for Client

1. Set up domain name resolution on the domain name website- Resolve the A/AAAA record of a custom domain name to the public IP address of the FRP server

2. Add client settings```

[SERVICE_NAME] type = http local_ip = 127.0.0.1 local_port = 0000 custom_domains = CUSTOM_DOMAIN.com

- CUSTOM_DOMAIN fill in the domain name set in the previous step## One More Thing> FRP one-click installation script> - linux platform, amd64 architecture> - Default service port`7000`,> - The dashboard username and password are both admin> - Token is random
> ! Onekey script only working for version 0.36.2### 1. Download the one-click installation script```
wget https://gitlab.dashdreams.com:8443/Haoran.Qi/RaspberryPi/-/raw/main/Shell/FRP_OneKey/install_frp.sh

2. Run the script./install_frp.sh> ROOT authority needed, addsudobefore each command if NOT a ROOT user.

REF[1]. https://github.com/fatedier/frp

[2]. Build-Git-Server-Using-Gogs-with-Docker-and-Employ-Frp-with-Caddy-Reverse-Proxy