一、下载内核与配置文件

从 Mihomo 官方 Release 获取对应架构(如 linux-amd64)的二进制文件,解压重命名为 /usr/local/bin/mihomo 并赋予可执行权限(chmod +x)。将机场 Clash 订阅 YAML 保存至 /etc/mihomo/config.yaml。

二、配置 systemd 服务

创建 /etc/systemd/system/mihomo.service,指定 ExecStart=/usr/local/bin/mihomo -d /etc/mihomo,然后执行 sudo systemctl enable --now mihomo 即可开机自启。配合终端 export https_proxy=http://127.0.0.1:7890 即可测试代理生效。