包管理器
仓库安装
sudo curl -fsSL https://sing-box.app/gpg.key -o /etc/apt/keyrings/sagernet.asc
sudo chmod a+r /etc/apt/keyrings/sagernet.asc
echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/sagernet.asc] https://deb.sagernet.org/ * *" | \
sudo tee /etc/apt/sources.list.d/sagernet.list > /dev/null
sudo apt-get update
sudo apt-get install sing-box # or sing-box-beta
手动安装
托管安装
类型 | 平台 | 链接 | 命令 | 活跃维护 |
---|---|---|---|---|
Alpine | Alpine | sing-box | apk add sing-box |
|
AUR | Arch Linux | sing-box ᴬᵁᴿ | ? -S sing-box |
|
nixpkgs | NixOS | sing-box | nix-env -iA nixos.sing-box |
|
Homebrew | Linux | sing-box | brew install sing-box |
类型 | 平台 | 链接 | 命令 | 活跃维护 |
---|---|---|---|---|
Homebrew | macOS | sing-box | brew install sing-box |
类型 | 平台 | 链接 | 命令 | 活跃维护 |
---|---|---|---|---|
Scoop | Windows | sing-box | scoop install sing-box |
|
Chocolatey | Windows | sing-box | choco install sing-box |
|
winget | Windows | sing-box | winget install sing-box |
类型 | 平台 | 链接 | 命令 | 活跃维护 |
---|---|---|---|---|
Termux | Android | sing-box | pkg add sing-box |
类型 | 平台 | 链接 | 命令 | 活跃维护 |
---|---|---|---|---|
FreshPorts | FreeBSD | sing-box | pkg install sing-box |
服务管理
对于带有 systemd 的 Linux 系统,通常安装已经包含 sing-box 服务, 您可以使用以下命令管理服务:
行动 | 命令 |
---|---|
启用 | sudo systemctl enable sing-box |
禁用 | sudo systemctl disable sing-box |
启动 | sudo systemctl start sing-box |
停止 | sudo systemctl stop sing-box |
强行停止 | sudo systemctl kill sing-box |
重新启动 | sudo systemctl restart sing-box |
查看日志 | sudo journalctl -u sing-box --output cat -e |
实时日志 | sudo journalctl -u sing-box --output cat -f |