用于快速安装、更新、查看和卸载 sing-box 服务端。
- 一键安装 sing-box(自动生成 UUID、Reality 密钥、配置文件)
- 一键更新 sing-box
- 一键更新配置(保留 UUID / 端口 / 私钥)
- 查看当前配置和服务状态
- 一键卸载
- 支持 systemd / OpenRC
- 发行版:Debian/Ubuntu、RHEL/Fedora/CentOS 8+、Alpine
- 架构:x86_64、i386/i686、ARM(v5/v6/v7/v8)、ARM64、LoongArch64、MIPS、PPC64LE、RISC-V64、s390x
需要 root 权限:
bash <(curl -fsSL "https://raw.githubusercontent.com/imengying/sing-box/main/sing-box.sh")直接运行主脚本将进入交互式菜单:
- 安装 sing-box
- 更新 sing-box
- 更新配置文件
- 查看配置信息
- 查看服务状态
- 卸载 sing-box
除了交互式菜单,脚本也支持直接通过命令行参数执行对应功能,适合自动化部署(需要 root 权限):
install或i:安装 sing-boxupdate或u:更新 sing-boxconfig或c:更新配置文件info:查看配置信息status或s:查看服务状态uninstall:卸载 sing-box-y或--auto:自动模式(跳过确认;非交互环境推荐)
默认模式下会进行必要交互(例如安装时端口输入、IPv4/IPv6 选择,IP 版本默认 v6)。
例如直接更新:
curl -fsSL "https://raw.githubusercontent.com/imengying/sing-box/main/sing-box.sh" | bash -s -- update推荐直接运行主脚本:
bash <(curl -fsSL "https://raw.githubusercontent.com/imengying/sing-box/main/sing-box.sh")然后在菜单中选择 2,或使用命令行参数 update 直接更新。
systemd:
systemctl status sing-box
systemctl restart sing-box
journalctl -u sing-box -fOpenRC:
rc-service sing-box status
rc-service sing-box restart- 配置文件:
/etc/sing-box/config.json - 执行文件:
/etc/sing-box/sing-box - 公钥文件:
/etc/sing-box/public.key
vless://<UUID>@<IP>:<PORT>?encryption=none&flow=xtls-rprx-vision&security=reality&sni=updates.cdn-apple.com&fp=firefox&pbk=<PublicKey>#VLESS-REALITY
IPv6 地址请使用 [] 包裹,例如:[2211:db8::1]。