Share a Clash Config Across Desktop and Mobile: Subscription Links, Remote Overrides, and Sync Options
Compare ways to share Clash settings across devices, from subscription links and remote rule sets to local overrides and private repos, with trade-offs and pitfalls.
What to sync: share proxies and rules, keep device settings separate
If you only need two devices to share proxy nodes, import the same subscription URL on each. To apply the same routing rules to a set of domains on both, share a remote rule set as well. Set ports, system proxy, TUN, and DNS handling per device; there’s no need to copy the entire active config just to “sync” settings.
A subscription provides configuration content, not runtime state. Selecting a proxy in a manual policy group on your computer won’t switch the proxy on your phone. Even with identical policy group names, subscription versions, and latency-test URLs, a latency-based group may choose different proxies because one device is on Wi-Fi and the other on mobile data. To verify a sync, first check that both devices received the same config, then see which rule matched a specific connection.
| Method | What’s shared | Maintenance and common issues |
|---|---|---|
| Same subscription URL | Nodes provided by the service; a full config may also include policy groups and rules | Lowest effort; refresh each device separately, and update the URL on both if it changes |
| Remote rule set | Match entries that can be updated independently | Maintain one list; both devices still need to reference the rule set and place it correctly in the rules |
| Client override | Share a base subscription, then add or replace fields per device | Check how the client merges overrides; the same patch can produce different configs in different clients |
| Private repo | Config templates, rule files, and revision history | Requires handling releases, access control, and rollbacks; a repo URL may not be directly importable |
How to import the same subscription on desktop and mobile
- First, confirm that the provider offers a Clash or mihomo config subscription your client can parse. A list of proxy nodes alone isn’t a complete YAML config. Whether policy groups and rules are generated automatically depends on the format supported by the importing client. If a mobile client only supports its own config format, using the same URL doesn’t guarantee compatibility.
- On desktop, open the “Subscriptions” page, add the URL, and select the config. On mobile, open “Profiles” or “Subscriptions,” add a remote config, and enable it. Follow the available options in each client; button names vary. After importing, check which config is active so you don’t mistake a newly updated profile for the one currently running.
- Manually update both devices, then compare policy group names, candidate proxies, and the current mode. If the service returns different content based on client request details, the same URL can produce different configs. If group names don’t match, check the service’s output format and whether the client has applied an override.
Remote rule sets vs. remote overrides
A remote rule set determines which requests match. The client’s final config, specifically rules, determines which proxy is used after a match. A remote override reapplies your config changes after the base subscription updates. Overrides are a client-side feature, not a universal YAML field supported by every Clash client. If your client can’t load overrides from a URL, keep them locally or generate a complete config before publishing it.
Share the rule list across devices and set routing outcomes separately
Here’s a mihomo YAML rule set example. It assumes the client supports rule sets provided by the core and can access them at an HTTPS URL. The example domain is for illustration; replace it with your actual hosting URL. These are two separate file contents.
Remote file contents, using match entries in classical format without an outbound target at the end of each entry:
payload:
- DOMAIN-SUFFIX,example.net
Corresponding snippet in the client’s active config:
rule-providers:
shared-direct:
type: http
behavior: classical
format: yaml
url: https://rules.example.org/clash/shared-direct.yaml
path: ./ruleset/shared-direct.yaml
interval: 86400
rules:
- RULE-SET,shared-direct,DIRECT
interval: 86400sets the rule set refresh interval to 24 hours. It is not the subscription update interval, and it doesn’t guarantee that both devices update at the same time. If the mobile app is in the background or the core isn’t running, check whether the cache refreshes after the app resumes.- Insert the
RULE-SETline into the existingruleslist, before the fallbackMATCHrule and after any rules that should take precedence for the same domain. Preserve the existing rules and fallback when merging. Don’t treat this snippet as a complete file or add a secondruleskey at the same level. pathis a cache path relative to the core’s working directory; you don’t need to sync the actual cache files between devices. If the rule set won’t download, check config parsing, URL access permissions, and connectivity, then review the runtime logs. A rule set name in the config alone doesn’t confirm that its contents have loaded.
Use override files to preserve device-specific settings
If your client has an option like “Subscriptions” → current config → “Edit Override,” use it to change device-specific fields instead of editing the subscription source, which may be overwritten on the next refresh. Before adding rules, check whether the client prepends, appends, or replaces the list. Appending after MATCH often means the new rule won’t match; replacing the whole list may remove upstream routing rules. After updating, inspect the active config rather than just the text in the override editor.
For example, you can keep mixed-port: 7890 on desktop and check the address and port in Windows 11 under “Settings” → “Network & internet” → “Proxy.” When using the local proxy on your computer, the address is usually 127.0.0.1. A phone routing traffic through its own VPN doesn’t need the computer’s port. On each device, 127.0.0.1 points to that device itself; entering the same address and port on your phone won’t connect it to your computer’s proxy.
Private repo hosting: track revisions, don’t distribute credentials
Consider a private repo when you need to review changes, restore an earlier version, or manage differences across more than two devices. Version common rules and config templates without credentials, and keep desktop and mobile settings in separate files. Tag usable releases or record commit IDs. Before publishing, check that referenced policy groups exist, rule set URLs are accessible, and the fallback rule remains last.
- Repo: Commit rules and templates, but store subscription tokens, proxy passwords, and controller API keys separately. Credentials can remain in old commits even after a file is deleted. If you commit one by mistake, replace it.
- Publishing: Provide client-readable config files or rule sets through a controlled channel. A repo’s web page URL serves a webpage, not raw YAML. Don’t assume clients can access raw file URLs that require a browser login. If the client can’t meet the authentication requirements, use controlled file transfer and import the file locally.
- Devices: Import the candidate version on one device first and confirm that rule set updates and traffic handling both work before switching the other device. Keep the previous working config so you can roll back. If the old config still points to the same mutable rule set URL, restoring it won’t restore the old rules. For a full rollback, publish the rule set at a versioned URL.
Troubleshooting different routing results or a phone that loses connectivity after syncing
- Check config versions and cores first. Confirm the latest subscription update on each device, then check the actual core version in the client’s “About” section or core settings. The client version isn’t the core version. For example, if one device shows mihomo v1.19.0 and the other uses an older Clash core, don’t assume both can parse every extended field. Start by testing a basic config that both support.
- Then check the mode and rules. Switch both devices to Rule mode, start a new connection to the same destination, and check the matched rule and proxy under “Connections” or “Logs.” With the example rule, if the connection log retains the domain and no earlier rule matches,
example.netshould matchshared-directand useDIRECT. If it hits the fallback, check whether the list loaded, the rule order is correct, and whether the core sees only an IP address. - Finally, check traffic handling. If desktop shows connection logs but the phone doesn’t, check whether the phone’s VPN is running, whether the target app is excluded, and whether another VPN is already using the system VPN slot. If the phone can reach IP addresses but domain lookups fail, check the client’s DNS config and the system’s Private DNS settings before switching proxies. Test on the same network and change one setting at a time.
For routine maintenance, choose the option with the smallest impact: refresh the subscription when proxies change, update the rule set when domain lists change, and handle device-specific traffic issues locally. Add a repo and release workflow only if you need change reviews and version rollbacks.