Linux / CLI

Linux 服务器/命令行部署 sing-box 客户端与 Systemd 托管教程

对于无图形界面的开发机、远程测试机或 WSL2 环境,使用 sing-box 命令行客户端配合 systemd 服务是最轻量稳定的方案。

发布日期:2026-12-03最后核验:2026-12-03

一、安装 sing-box 二进制程序

从 SagerNet/sing-box Releases 下载对应架构(如 linux-amd64.tar.gz),解压后将 sing-box 可执行文件复制到 /usr/local/bin/ 并赋予执行权限(chmod +x)。

二、校验配置文件语法

将机场生成的 sing-box JSON 配置文件保存至 /etc/sing-box/config.json,先运行 sing-box check -c /etc/sing-box/config.json 确认无语法或字段错误。

三、配置 systemd 开机常驻

编写 /etc/systemd/system/sing-box.service,通过 ExecStart=/usr/local/bin/sing-box run -c /etc/sing-box/config.json 启动并运行 systemctl enable --now sing-box。

相关推荐与下一步

配置好客户端后,可前往 14 家机场综合排行榜 或 横向对比工具 挑选匹配您协议与预算的订阅方案。