Choose a Deployment: GUI Client or systemd
mihomo is the kernel formerly known as the Clash Meta project. Clash Verge Rev is a GUI client for managing the kernel, subscriptions, and active configuration. When running mihomo on its own, you manage the configuration file, process, and logs yourself. The key difference is who starts the process, who updates the configuration, and whether the service keeps running after you log out of the desktop session.
| Check | Clash Verge Rev | mihomo system service |
|---|---|---|
| Best for | Desktop users importing subscriptions and switching proxy groups | Server-side tasks or applications configured to use an explicit proxy |
| Configuration source | The configuration currently enabled in the client and its overrides | /etc/mihomo/config.yaml |
| When it starts | Started by the client after desktop login | Started by systemd at boot, without waiting for a user to log in |
| Where to troubleshoot | The client's logs and connections pages | systemctl status and journalctl |
Both setups can run on the same machine, but they must not compete for the same listening port. The server example below uses 127.0.0.1:7890. If the desktop client already uses that port, stop one of the processes or change the port for one setup, then update the application's proxy address to match.
Linux Desktop: Install Clash Verge Rev
Check the Package and CPU Architecture
Run uname -m first. If it returns x86_64, choose an amd64 or x86_64 build; if it returns aarch64, choose an arm64 or aarch64 build. Then check your distribution: Debian 12 and Ubuntu 24.04 usually use the matching .deb package, while Fedora uses an .rpm when one is available for that release. Don't assume a package will install just because its filename says Linux. Even with the right architecture, check the release notes for supported OS versions and dependencies. If the package manager reports unmet dependencies, don't force the installation.
Activate the Subscription and Verify Traffic with an App
- Open the Subscription page in Clash Verge Rev, import a URL or local configuration, and select the imported profile. Seeing a subscription in the list doesn't mean it's active; check the Proxy page to confirm the proxy groups reflect the configuration. Subscription URLs may contain tokens, so don't share the full URL when troubleshooting.
- For your first test, use Rule mode and leave TUN off. In the client, go to Settings → System Proxy and enable the system proxy, then check which port the client is actually using. On Ubuntu 24.04 with GNOME, you can also check the desktop proxy settings under Settings → Network → Network Proxy. The toggle and its label may vary between client versions.
- In a browser configured to follow the system proxy, visit a test domain. On the Connections page, check the target domain, matched rule, and outbound route. Terminal programs, background services, and browsers with their own proxy settings may not use the desktop proxy. Test those separately using their own settings; a browser result isn't proof that they are using the proxy.
Headless Setup: Binary, Configuration, and State Directories
The commands below are for a systemd-based setup on Debian 12 or Ubuntu 24.04. Extract the mihomo executable that matches your CPU architecture, name it mihomo, and run the commands from the directory containing the file. Use mihomo -v to confirm the kernel runs and note its exact version. If you get Exec format error, check the architecture and extraction before changing the service configuration.
sudo install -o root -g root -m 0755 ./mihomo /usr/local/bin/mihomo
/usr/local/bin/mihomo -v
sudo useradd --system --user-group --no-create-home \
--home-dir /var/lib/mihomo --shell /usr/sbin/nologin mihomo
sudo install -d -o root -g mihomo -m 0750 /etc/mihomo
sudo install -d -o mihomo -g mihomo -m 0750 /var/lib/mihomo
Use useradd only to create the account for the first time. If an account with that name already exists, confirm that it's dedicated to this service. Keep the binary and YAML file managed by root, give the service account read-only access to the configuration, and store its cache and runtime data in its own state directory. This lets the service write its cache without making /etc/mihomo writable.
Start with a DIRECT Baseline Test
Save the following as config.yaml in the current directory. mixed-port accepts both HTTP and SOCKS proxy requests on the same port; allow-lan: false keeps it inaccessible from the local network. This example has no proxy nodes, and MATCH,DIRECT sends connections that reach the fallback rule directly through mihomo. Use it only to test the local proxy endpoint and service permissions, not to check whether subscription nodes work.
mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
tun:
enable: false
rules:
- MATCH,DIRECT
sudo install -o root -g mihomo -m 0640 ./config.yaml /etc/mihomo/config.yaml
sudo -u mihomo /usr/local/bin/mihomo -t \
-d /var/lib/mihomo -f /etc/mihomo/config.yaml
-d sets the kernel's working directory, and -f specifies the configuration file to use. Test as the service account to catch unreadable configuration files or unwritable state directories before starting the service. Repeat the test whenever you switch to a full configuration. A subscription URL isn't a local YAML file, and a list of proxy nodes may not be a complete mihomo configuration. When migrating, check that the names referenced by proxy-groups exist and that the policies used by rules are defined. For configurations with providers, also check file locations and confirm that resources can be fetched.
Run mihomo with systemd and Enable Startup at Boot
As an administrator, save the following unit file as /etc/systemd/system/mihomo.service. This example provides an explicit proxy for the local machine only. It doesn't enable the control interface or TUN, and it doesn't grant network administration privileges to the process. If the configuration you're migrating includes a control interface or other listening endpoints, review those settings before starting the service.
[Unit]
Description=mihomo local proxy
After=network.target
[Service]
Type=simple
User=mihomo
Group=mihomo
StateDirectory=mihomo
StateDirectoryMode=0750
WorkingDirectory=/var/lib/mihomo
ExecStart=/usr/local/bin/mihomo -d /var/lib/mihomo -f /etc/mihomo/config.yaml
Restart=on-failure
RestartSec=3s
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
[Install]
WantedBy=multi-user.target
ProtectSystem=strict restricts filesystem writes, while StateDirectory=mihomo provides a writable state directory for the service. ProtectHome=true isolates home directories, so don't leave service dependencies in ~/Downloads. After=network.target sets startup order; it doesn't guarantee that internet access or DNS is ready. If the full configuration needs to fetch remote providers at startup, check your system's network manager, any network-online wait service, and the startup logs.
sudo systemctl daemon-reload
sudo systemctl start mihomo.service
systemctl status mihomo.service --no-pager
sudo journalctl -u mihomo.service -b -n 50 --no-pager
Confirm that a local request works before running sudo systemctl enable mihomo.service. Use systemctl is-active mihomo.service to check whether the process is running now, and systemctl is-enabled mihomo.service to check whether it will start at the next boot; neither command replaces the other. If you changed only the YAML file, restart the service after testing it. If you changed the unit file, run daemon-reload before restarting. Restarting interrupts existing connections handled by the process.
Verify and Troubleshoot: Listener, Requests, and Rules
sudo ss -ltnp 'sport = :7890'
curl --noproxy '' --proxy http://127.0.0.1:7890 \
--connect-timeout 5 --max-time 15 -I https://example.com/
First, use ss to confirm that mihomo owns the listening socket and that it's bound to a loopback address, not 0.0.0.0 or [::]. Then use curl with the proxy specified explicitly: an empty --noproxy prevents an existing NO_PROXY setting from affecting this test. A successful HTTP CONNECT only means the proxy accepted the tunnel request; check whether the destination returns an HTTP response as well. This example uses DIRECT, so if the destination is unreachable, check the server's DNS and external connectivity first.
- Listener fails with
address already in usein the logs: Use thesscommand above to find what's using the port. Common causes include a desktop kernel that's still running or another mihomo process started manually on the same machine. - Service exits immediately after startup: Find the first error in the logs from the current boot. If configuration parsing fails, use the message to locate the YAML line. If it's a permissions issue, rerun
-tas themihomoaccount and check the configuration path and working directory in the unit file. - curl works, but the application isn't using the proxy: Check the application's own proxy settings or the service process's environment variables. The desktop system proxy isn't automatically passed to systemd services, and variables set in an SSH session aren't automatically available to system services. A successful test through the proxy port doesn't mean every app on the machine is using it.
- Traffic takes an unexpected route after replacing the configuration: Confirm that the kernel loaded the new file, then check the first matching rule and its associated policy group. If a broad rule or
MATCHappears earlier, later domain rules won't be reached. Fix the rule order first; don't enable TUN as a workaround.
Before upgrading, keep the previous working binary and YAML file, and record the output of mihomo -v. After replacing the binary, test the configuration with the new version as the service account before restarting. Then check the listener and rerun curl. This makes it possible to roll back to a verified kernel and configuration pairing instead of swapping back one file and guessing.