NPS 提供多种安装方式,推荐使用 Docker 部署,也支持 二进制发布包安装 及 源码编译。
docker-compose.yaml
services:
nps_duan2001:
image: docker.1ms.run/duan2001/nps:latest
restart: always
network_mode: host # 服务端根据情况配置网络情况,默认端口8081,可以修改配置文件更改
container_name: npsduan2001
volumes:
- /www/dk_project/dk_app/duan2001nps/nps_duan2001/conf:/confdocker pull duan2001/npc
docker run -d --restart=always --name npc --net=host duan2001/npc -server=xxx:123,yyy:456 -vkey=xxx,yyy -type=tls,tcp -log=offdocker-compose.yaml 无配置文件安装
version: '3.8'
services:
npc:
image: duan2001/npc
container_name: npchk64901419
# 保持与 docker run --net=host 一致,直接使用宿主机网络
network_mode: host
# 保持与 docker run --restart=always 一致
restart: always
# 将 run 命令后面的参数放入 command 字段
volumes:
- /opt/npchk64901419/conf:/conf
command:
- -server=XXX.XX.XXX.XXX:8024
- -vkey=XXXXXX
- -type=tcpdocker pull ghcr.io/djylb/npc
docker run -d --restart=always --name npc --net=host ghcr.io/djylb/npc -server=xxx:123,yyy:456 -vkey=xxx,yyy -type=tls,tcp -log=off此方式不支持 Windows 安装。
# Install (default configuration path: /etc/nps/; binary file path: /usr/bin/)
wget -qO- https://fastly.jsdelivr.net/gh/djylb/nps@master/install.sh | sudo sh -s nps
nps install
nps start|stop|restart|uninstall
# Update
nps update && nps restart# Install
wget -qO- https://fastly.jsdelivr.net/gh/djylb/nps@master/install.sh | sudo sh -s npc
/usr/bin/npc install -server=xxx:123,yyy:456 -vkey=xxx,yyy -type=tls -log=off
npc start|stop|restart|uninstall
# Update
npc update && npc restart-
不传任何参数时,脚本默认安装最新版本的
nps和npc,二进制文件会安装到系统路径(/usr/bin或/usr/local/bin),配置文件位于/etc/nps。 -
脚本支持通过参数指定:
- 模式:
nps|npc|all(默认all) - 版本:例如
v0.29.0,默认latest - 安装目录:指定路径时,压缩包将直接解压到该目录,而不会安装到系统路径。
- 模式:
-
同样支持以下环境变量:
NPS_INSTALL_MODE:等同于第一个参数NPS_INSTALL_VERSION:等同于第二个参数NPS_INSTALL_DIR:等同于第三个参数
NPS 提供官方二进制安装包,适用于 Windows、Linux、macOS、FreeBSD 等多种平台。
📌 下载地址:🔗 最新发布页面
Windows 10/11 用户(推荐):
Windows 7 用户(使用 old 结尾版本):
📌 安装方式(解压后进入文件夹)
# NPC 客户端
.\npc.exe install -server="xxx:123,yyy:456" -vkey="xxx,yyy" -type="tcp,tls" -log="off"
.\npc.exe start|stop|restart|uninstall
# 更新
.\npc.exe stop
.\npc-update.exe update
.\npc.exe start📌 推荐使用 Docker 运行。
- ARM64(Server)
- ARM64(Client)
- ARMv5(Server)
- ARMv5(Client)
- ARMv6(Server)
- ARMv6(Client)
- ARMv7(Server)
- ARMv7(Client)
📌 安装方式(解压后进入文件夹)
# NPS 服务器
./nps install
nps start|stop|restart|uninstall
# 支持指定配置文件路径
./nps -conf_path="/app/nps"
./nps install -conf_path="/app/nps"
# 更新
nps update && nps restart
# NPC 客户端
./npc install
/usr/bin/npc install -server=xxx:123,yyy:456 -vkey=xxx,yyy -type=tcp,tls -log=off
npc start|stop|restart|uninstall
# 更新
npc update && npc restart📌 安装方式(解压后进入文件夹)
# NPS 服务器
./nps install
nps start|stop|restart|uninstall
# 支持指定配置文件路径
./nps -conf_path="/app/nps"
./nps install -conf_path="/app/nps"
# 更新
nps update && nps restart
# NPC 客户端
./npc install
/usr/bin/npc install -server=xxx:123,yyy:123 -vkey=xxx,yyy -type=tcp,tls -log=off
npc start|stop|restart|uninstall
# 更新
npc update && npc restartgo get -u github.com/djylb/npsgo build -o nps cmd/nps/nps.gogo build -o npc cmd/npc/npc.go编译完成后,即可使用 ./nps 或 ./npc 启动。
- 最新发布版本:GitHub Releases
- Android:djylb/npsclient
- OpenWrt:djylb/nps-openwrt
- DockerHub 镜像
- GHCR 镜像