### 使用 yum 安装 systemd（CentOS/RHEL）
```
yum install systemd
```



### 使用 apt 安装 systemd（Debian/Ubuntu）
```
apt install systemd
sudo vim /etc/systemd/system/frps.service
```



### 服务名称，可自定义
```
Description = frp server
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
```


### 启动frps的命令，需修改为您的frps的安装路径
```
ExecStart = /path/to/frps -c /path/to/frps.toml

[Install]
WantedBy = multi-user.target
```



### 启动frp
```
sudo systemctl start frps
```


### 停止frp
```
sudo systemctl stop frps
```


### 重启frp
```
sudo systemctl restart frps
```


### 查看frp状态
```
sudo systemctl status frps
sudo systemctl enable frps
```

