机场推荐
LXLinux 代理客户端手册TERMINAL · 版本 2026-10-18
$5 · 服务器与内核

sing-box 在 Linux 上如何安装

Linux 代理客户端手册编辑部 · 更新于 2026-10-18

sing-box 在 Linux 上可用官方 APT、DNF 软件源或安装脚本装,带 systemd 的系统里包通常已含服务,用 systemctl 管理、journalctl 看日志。桌面另有 sing-box for Desktop。

sing-box 内核在 Linux 上有三种官方装法:APT 软件源、DNF 软件源、安装脚本。官方文档说,带 systemd 的 Linux 系统里,安装后「usually」已经带有 sing-box 服务,可以直接用 systemctl 管理。有桌面的机器还可以用图形版 sing-box for Desktop。写这一页时(2026-10-18),最新正式版是 v1.14.3(2026-10-09)。

APT(Debian 系)

1要点 · 第 1 节

官方文档的命令原样如下:

展开详细说明

官方文档的命令原样如下:

sudo mkdir -p /etc/apt/keyrings &&
   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 '
Types: deb
URIs: https://deb.sagernet.org/
Suites: *
Components: *
Enabled: yes
Signed-By: /etc/apt/keyrings/sagernet.asc
' | sudo tee /etc/apt/sources.list.d/sagernet.sources &&
   sudo apt-get update &&
   sudo apt-get install sing-box # or sing-box-beta

DNF(Fedora / Redhat 系)

2要点 · 第 2 节

DNF 5 与 DNF 4 的写法不同,不要混用。

展开详细说明

DNF 5 与 DNF 4 的写法不同,不要混用。DNF 5:

sudo dnf config-manager addrepo --from-repofile=https://sing-box.app/sing-box.repo && sudo dnf install sing-box # or sing-box-beta

DNF 4:

sudo dnf config-manager --add-repo https://sing-box.app/sing-box.repo && sudo dnf -y install dnf-plugins-core && sudo dnf install sing-box # or sing-box-beta

安装脚本

3要点 · 第 3 节

官方说明这个脚本会从 GitHub 发布页下载并安装最新的包,适用于 deb、rpm 系发行版、ArchLinux 和 OpenWrt:

  • 装 beta 版把末尾换成 sh -s -- --beta…
  • 软件包分 sing-box(正式)、sing-box-beta…
  • 其它渠道:Arch Linux 走 AUR(文档写作 ? -S sing-box…
sh -s -- --beta
sing-box
sing-box-beta
sing-box-testing
? -S sing-box
展开详细说明

官方说明这个脚本会从 GitHub 发布页下载并安装最新的包,适用于 deb、rpm 系发行版、ArchLinux 和 OpenWrt:

curl -fsSL https://sing-box.app/install.sh | sh

装 beta 版把末尾换成 sh -s -- --beta,装指定版本换成 sh -s -- --version <version>。软件包分 sing-box(正式)、sing-box-beta、sing-box-testing、sing-box-oldstable 几条轨道。

其它渠道:Arch Linux 走 AUR(文档写作 ? -S sing-box,没有点名 AUR 助手),NixOS 用 nix-env -iA nixos.sing-box,Alpine 用 apk add sing-box。官方把 AOSC 的 DEB 包、Homebrew 列为「Problematic Sources」。

服务管理与日志

4要点 · 第 4 节

最后两条分别看日志和跟随新日志。

  • 包里 systemd 单元的原文,官方没有贴出。
  • 另一种服务器运行方式见mihomo 的 systemd 方案。
展开详细说明
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

最后两条分别看日志和跟随新日志。包里 systemd 单元的原文,官方没有贴出。另一种服务器运行方式见mihomo 的 systemd 方案。

sing-box for Desktop(SFL)

5要点 · 第 5 节

官方说它可以管理并运行本地或远程的 sing-box 配置文件,并提供 TUN 透明代理等平台功能,Linux 支持 x64 / arm64 / armv7l。

  • v1.14.3 的 Linux 资产是 SFL-1.14.3-* 开头的 deb、rpm…
  • 桌面版的安装命令、TUN 权限和系统代理设置,官方没有说明。
展开详细说明

官方说它可以管理并运行本地或远程的 sing-box 配置文件,并提供 TUN 透明代理等平台功能,Linux 支持 x64 / arm64 / armv7l。v1.14.3 的 Linux 资产是 SFL-1.14.3-* 开头的 deb、rpm、pkg.tar.zst 各三个架构,没有 AppImage,文件名写法见架构名对照表。桌面版的安装命令、TUN 权限和系统代理设置,官方没有说明。

常见问题

Linux 包里通常有 systemd 服务吗?

官方原话是带 systemd 的系统「usually」已含 sing-box 服务,并列出 systemctl 命令;服务单元原文没有贴出。TUN 权限另见TUN 权限一页。

SFL 是什么?

SFL 是 sing-box 桌面版 Linux 资产的文件名前缀,文件架构与 sing-box for Desktop 页列的 Linux 架构吻合。官方没有一句写明这个缩写的含义。