基于原版 frp 内网穿透服务端 frps 的一键安装卸载脚本和 docker 镜像.支持 Linux 服务器和 docker 等多种环境安装部署.
Go to file
Stille 1b6859bc22 update v0.56.0 2024-03-22 12:35:59 +08:00
.github/workflows Update v0.39.0 2022-02-08 23:59:15 +08:00
.gitignore Create .gitignore 2020-02-08 13:47:43 +08:00
Dockerfile update v0.56.0 2024-03-22 12:35:59 +08:00
README.md update v0.56.0 2024-03-22 12:35:59 +08:00
frps.service 更新到最新版本并支持toml 2024-02-24 01:06:02 +08:00
frps.toml update for v0.55.1 2024-03-19 18:16:57 +08:00
frps_linux_install.sh update v0.56.0 2024-03-22 12:35:59 +08:00
frps_linux_uninstall.sh update v0.56.0 2024-03-22 12:35:59 +08:00

README.md

frps

项目简介

基于 fatedier/frp 原版 frp 内网穿透服务端 frps 的一键安装卸载脚本和 docker 镜像.支持 Linux 服务器和 docker 等多种环境安装部署.

docker image support for X86 and ARM

更新

  • 2024-03-19 更新到最新版本0.56.0,全新版本配置文件已更新,请注意修改配置文件。
  • 2024-02-25 更新toml配置文件
  • 2021-05-31 更新国内镜像方便使用
  • 2021-05-31 更新 Linux 一键安装脚本同时支持 X86 和 ARM
  • 2021-05-29 更新从0.36.2版本起 docker 镜像同时支持 X86 和 ARM

使用

由于 frps 服务端需要配置参数,本脚本为原版 frps.toml ,安装完毕后请自行编辑 frps.toml 配置端口,密码等相关参数并重启服务.同时你也可以 fork 本仓库后自行修改 frps.toml ,在进行一键安装也非常方便.后期也可自行配置 frps.toml 和调整 frps 的版本.

一键脚本(先执行脚本,在自行修改 frps.toml 文件.)

安装

wget https://raw.githubusercontent.com/stilleshan/frps/master/frps_linux_install.sh && chmod +x frps_linux_install.sh && ./frps_linux_install.sh
# 以下为国内镜像
wget https://github.ioiox.com/stilleshan/frps/raw/branch/master/frps_linux_install.sh && chmod +x frps_linux_install.sh && ./frps_linux_install.sh

使用

vi /usr/local/frp/frps.toml
# 修改 frps.toml 配置
sudo systemctl restart frps
# 重启 frps 服务即可生效

卸载

wget https://raw.githubusercontent.com/stilleshan/frps/master/frps_linux_uninstall.sh && chmod +x frps_linux_uninstall.sh && ./frps_linux_uninstall.sh
# 以下为国内镜像
wget https://github.ioiox.com/stilleshan/frps/raw/branch/master/frps_linux_uninstall.sh && chmod +x frps_linux_uninstall.sh && ./frps_linux_uninstall.sh

自定义一键脚本(先 fork 本仓库,在自行修改 frps.toml 文件后执行脚本.)

  • 首先 fork 本仓库
  • 配置 frps.toml
  • 修改 frps_linux_install.sh 脚本
  • 修改脚本链接
  • Push 仓库到 GitHub

修改 frps_linux_install.sh 脚本

FRP_VERSION=0.56.0 可根据原版项目更新自行修改为最新版本.
REPO=stilleshan/frps 由于 fork 到你自己的仓库,需修改stilleshan为你的 GitHub 账号ID.

执行一键脚本

修改以下脚本链接中的stilleshan为你的 GitHub 账号 ID 后,执行即可.

wget https://raw.githubusercontent.com/stilleshan/frps/master/frps_linux_install.sh && chmod +x frps_linux_install.sh && ./frps_linux_install.sh

卸载脚本

frps_linux_uninstall.sh 卸载脚本为通用脚本,可直接执行,也可同上方式修改链接后执行.

wget https://raw.githubusercontent.com/stilleshan/frps/master/frps_linux_uninstall.sh && chmod +x frps_linux_uninstall.sh && ./frps_linux_uninstall.sh

frps相关命令

sudo systemctl start frps
# 启动服务 
sudo systemctl enable frps
# 开机自启
sudo systemctl status frps
# 状态查询
sudo systemctl restart frps
# 重启服务
sudo systemctl stop frps
# 停止服务

docker 部署

为避免因 frps.toml 文件的挂载,格式或者配置的错误导致容器无法正常运行并循环重启.请确保先配置好 frps.toml 后在执行启动.

git clone 本仓库,并正确配置 frps.toml 文件.

git clone https://github.com/stilleshan/frps
# git clone 本仓库
git clone https://github.ioiox.com/stilleshan/frps
# 国内镜像
vi /root/frps/frps.toml
# 配置 frps.toml 文件

启动容器

docker run -d --name=frps --restart=always \
    --network host \
    -v /root/frps/frps.toml:/frp/frps.toml  \
    stilleshan/frps

以上命令 -v 挂载的目录是以 git clone 本仓库为例,也可以在任意位置手动创建 frps.toml 文件,并修改命令中的挂载路径.

服务运行中修改 frps.toml 配置后需重启 frps 服务.

vi /root/frps/frps.toml
# 修改 frps.toml 配置
docker restart frps
# 重启 frps 容器即可生效

链接