Official documentation:https://gofrp.org/en/docs

1705301050842

System Requirements

As it is written in Go language, the system requirements are consistent with the latest Go language requirements for systems and platforms. For details, please refer to Golang System requirements.

Download

You can download the latest version of the client and server binaries from the Release page on GitHub. All files are packaged in a zip file, which also includes a complete set of configuration parameter descriptions.

Deployment

  1. Unzip the downloaded package.
  2. Copy frpc to the machine where the internal network service is located.
  3. Copy frps to a machine with a public IP address and place them in any directory.

Getting Started

  1. Write the configuration file. Currently supported file formats include TOML/YAML/JSON. The old INI format is still supported but is no longer recommended.

  2. Start the server using the following command: ./frps -c ./frps.toml.

  3. Start the client using the following command: ./frpc -c ./frpc.toml.

  4. If you need to run it in the background for a long time, it is recommended to combine it with other tools such as systemd, nohup, and supervisor.

    1
    2
    3
    4
    5
    # 服务端
    nohup ./frps -c ./frps.toml &

    # 客户端
    nohup ./frpc -c ./frpc.toml &

For details on how to write a configuration file, see the content in the [Configuration File](#Configuration File) section.

For a complete explanation of the configuration options, see the content in the Official Documentation - Reference.

Configuration File

frps.toml

Deploying frps on a machine with a public IP

Deploy frps and edit the frps.toml file. Below is a simplified configuration, which sets the port for the frp server to receive client connections:

1
bindPort = 7000

frpc.toml

Deploying frpc on an internal network machine that needs to be accessed

Deploy frpc and edit the frpc.toml file, assuming the public IP address of the server where frps is located is x.x.x.x. Below is an example configuration:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
serverAddr = "x.x.x.x"
serverPort = 7000

[[proxies]]
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 6000

[[proxies]]
name = "nginx"
type = "http"
localIP = "127.0.0.1"
localPort = 80
remotePort = 8080
  • localIP and localPort are configured as the address and port of the internal network service that needs to be accessed from the public network.
  • remotePort indicates the port listened on by the frp server. Traffic to this port will be forwarded to the corresponding port of the local service.
  • type indicates the connection type, with common types including http and tcp:
    • Common Web services and Server services use http connections.
    • Services like ssh, mysql, redis, etc., use tcp connections.