Skip to content

安装脚本

此 shell 脚本仅适用于 Linux 系统。如果您使用的是其他操作系统,请参考 快速入门 指南进行手动安装或使用 Docker。

安装或升级

install.sh install

安装或更新 Nginx UI。

用法

shell
install.sh install [OPTIONS]

选项

选项
-l, --local <file>从本地文件安装 Nginx UI (string)
-p, --proxy <url>通过代理服务器下载 (string)
例如:-p http://127.0.0.1:8118-p socks5://127.0.0.1:1080
-r, --reverse-proxy通过反向代理服务器下载 (string)
例如:-r https://cloud.nginxui.com/
-c, --channel <channel>指定版本通道 (string)
可用通道:stable(默认)、prereleasedev

版本通道

通道描述
stable最新稳定版本(默认) - 推荐用于生产环境
prerelease最新预发布版本 - 包含正在测试的新功能,将在稳定版本发布前进行验证
dev来自 dev 分支的最新开发构建 - 包含最新功能但可能不稳定

快速使用

shell
# 安装最新稳定版本
bash -c "$(curl -L https://cloud.nginxui.com/install.sh)" @ install -r https://cloud.nginxui.com/
shell
# 安装最新预发布版本
bash -c "$(curl -L https://cloud.nginxui.com/install.sh)" @ install --channel prerelease -r https://cloud.nginxui.com/
shell
# 安装最新开发构建
bash -c "$(curl -L https://cloud.nginxui.com/install.sh)" @ install --channel dev

一键安装脚本默认设置的监听端口为 9000,HTTP Challenge 端口默认为 9180。如果有端口冲突,请手动修改 /usr/local/etc/nginx-ui/app.ini, 并使用 systemctl restart nginx-ui 重启 Nginx UI 服务。更多有关信息,请查看 配置参考

卸载

install.sh remove

卸载 Nginx UI。

用法

shell
install.sh remove [OPTIONS]

选项

选项
--purge删除所有 Nginx UI 文件,包括日志、配置等 (boolean)

快速使用

shell
# 删除 Nginx UI,但不包括配置和数据库文件
bash -c "$(curl -L https://cloud.nginxui.com/install.sh)" @ remove
shell
# 删除所有 Nginx UI 文件,包括配置和数据库文件
bash -c "$(curl -L https://cloud.nginxui.com/install.sh)" @ remove --purge

帮助

install.sh help

显示可用选项。

用法

shell
install.sh help

快速使用

shell
bash -c "$(curl -L -s https://cloud.nginxui.com/install.sh)" @ help

控制服务

通过此脚本,Nginx UI 将作为服务安装。安装脚本会检测您系统的服务管理器并设置相应的服务控制机制。

Systemd

如果您的系统使用 systemd,请使用以下 systemctl 命令对其进行控制:

shell
systemctl start nginx-ui
shell
systemctl stop nginx-ui
shell
systemctl restart nginx-ui
shell
systemctl status nginx-ui
shell
systemctl enable nginx-ui

OpenRC

如果您的系统使用 OpenRC,请使用以下 rc-service 命令对其进行控制:

shell
rc-service nginx-ui start
shell
rc-service nginx-ui stop
shell
rc-service nginx-ui restart
shell
rc-service nginx-ui status
shell
rc-update add nginx-ui default

Init.d

如果您的系统使用传统的 init.d 脚本,请使用以下命令对其进行控制:

shell
/etc/init.d/nginx-ui start
shell
/etc/init.d/nginx-ui stop
shell
/etc/init.d/nginx-ui restart
shell
/etc/init.d/nginx-ui status

Released under the AGPL-3.0 License. (e4dd1301)