Clash Setup Guide
No networking background required. This guide walks through subscription import, mode selection, system proxy, and verification step by step, with platform-specific instructions and troubleshooting for each — just follow along to get set up.
Detailed Setup Instructions
Every step explains the reasoning, the exact actions, and common pitfalls — not just a one-line summary.
Import Your Subscription LinkSUBSCRIBE
A subscription link is really just a URL provided by your service provider — when the client requests it, it gets back a configuration containing the node list and routing rules. Open the client's "Profiles" page, paste the subscription URL, and click download; nodes and rules write to your local config automatically, with no manual YAML editing required. If you were given a config.yaml file instead of a link, choosing "Import from File" on the same page works exactly the same way — it just won't auto-update.
Clients usually offer an "auto-update interval" setting (e.g., refreshing every 24 hours) that automatically pulls the latest nodes when it's due — or you can hit "Update" anytime to refresh immediately without re-pasting the link.
Understand & Choose an Operating ModeMODE
The client offers three traffic-handling modes: Rule mode matches traffic against the rules in config.yaml one by one to auto-route it — mainland China direct, everything else via proxy, ads blocked, all decided automatically — and it's the recommended mode for everyday use; Global mode ignores all rules and forces every connection through the same proxy node, mainly useful for briefly testing whether a specific node actually works; Direct mode turns the proxy off entirely, equivalent to the network state before Clash was installed, useful for A/B testing or saving data temporarily.
One concept that's easy to confuse is TUN mode — it's not another option in the list above, but a separate choice about "how traffic gets intercepted." The system proxy only works for apps that respect system proxy settings (browsers, most regular software), but some command-line tools, games, and background services ignore it entirely. That's when you need TUN mode: the client creates a virtual network adapter that intercepts all traffic at the network layer. It's more thorough, but the first time you enable it requires extra authorization (see the platform-specific instructions in "Turn On the System Proxy" below). Beginners should stick with the system proxy first and only consider enabling TUN if a specific app just won't route through the proxy.
Turn On the System ProxyCONNECT
The core logic of the system proxy is the same on every platform — it forwards network requests from the system or apps to the local port Clash listens on (default 127.0.0.1:7890). What differs is where the toggle lives and where the config file is stored, covered platform by platform below.
Windows Right-click the tray icon and check "System Proxy" in the menu to turn it on; uncheck it to turn it off. If you want TUN mode, the first time you enable it you'll be prompted to run as administrator once to register the virtual adapter driver — after that, it works automatically on normal startup. The config file lives at %USERPROFILE%\.config\clash\config.yaml by default, and you can open or back it up with any text editor.
macOS Click the menu bar icon and choose "Set as System Proxy" to turn it on. For TUN mode, go to System Settings → Privacy & Security → VPN & Network Extensions, find the corresponding extension, and allow it — then restart the client for TUN to take effect. This is a macOS-level security restriction, and not finding this setting the first time is the most common sticking point. The config file lives at ~/.config/clash/config.yaml.
Android Open the app, import your subscription link on the "Profiles" page, then go back to the home screen and tap the floating "Connect" button. Android's standard VPN permission dialog will pop up — tap "OK" to establish a local VPN tunnel and start forwarding traffic. Some Android skins (especially MIUI, ColorOS, and Funtouch OS) aggressively kill background VPN processes to save power, so add Clash to your battery optimization whitelist in system settings — otherwise it may disconnect on its own after a while.
iOS Due to App Store review policies, there's no official native Clash app for iOS — most people use a third-party client compatible with Clash's rule format (like Stash or Shadowrocket). Add your subscription link on the app's "Profile" page and turn the connection on; you can then check status or disconnect manually under Settings → General → VPN & Device Management. Wording varies slightly between apps, but the flow for importing a subscription and toggling the connection is basically the same.
Linux GUI versions (like clash-verge) work the same way as on Windows/macOS — right-click the tray icon to turn on the system proxy. For headless setups (like a cloud server), there's no tray icon to click, so you'll need to edit the config file manually and run it as a systemd service, then set proxy environment variables in your shell so command-line tools route through it too:
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890
config.yaml, run systemctl enable --now clash to make it start automatically on boot, so you don't have to start it manually every time. If your browser keeps showing no proxy, check whether another VPN or proxy tool is running and conflicting.Verify It's WorkingVERIFY
After the three steps above, take a minute to confirm the proxy is actually working — don't just assume it is:
Method 1 · IP lookup: Visit any IP lookup site in your browser. If the exit IP's location matches the node you're connected to (e.g., you connect to a Hong Kong node and see a Hong Kong IP), the system proxy is working.
Method 2 · Connections panel: Open the client's "Connections" panel to see in real time which rule and node each connection is using — the most direct way to verify routing is working as expected.
Method 3 · Connected but a specific site won't load: This is the most common case that looks broken but usually isn't — the domain is just being matched to DIRECT by a rule (common with newer or niche domains not yet covered by a rule set). Check the Connections panel to see which rule matched. If it's a misclassification, add a DOMAIN-SUFFIX rule in your custom rules to force it through the proxy (see the rule syntax below). If it already matched a proxy rule but still won't load, the node itself is probably down or too slow — switch to Global mode and test other nodes to rule that out.
How Routing Rules Work: A Syntax Guide
What makes Rule mode "smart" is the rules list in the config file. Understanding how matching works means you'll know exactly what to change when routing doesn't behave as expected. Not familiar with terms like proxy group or GEOIP? Check the glossary first.
The rules list is evaluated top to bottom, with each line roughly in the form TYPE,MATCH,POLICY. When the client receives a request, it checks each rule in order, and the moment one matches, that policy is applied and matching stops — any rules further down, even if they'd also match, are never reached. The policy can be DIRECT, REJECT (block and drop), or the name of a proxy group (subscription rule sets usually write this as PROXY, referring to a proxy group). Most subscription providers already ship a complete rule set that works out of the box with no editing needed; the table below covers the six syntax patterns advanced users add most often.
DOMAIN,ad.example.com,REJECT
Exact match for a single full domain, not including subdomains
REJECTDOMAIN-SUFFIX,google.com,PROXY
Matches the domain and all its subdomains — the most commonly used form
PROXYDOMAIN-KEYWORD,facebook,PROXY
Matches any domain containing the given keyword, covering multiple variants at once
PROXYIP-CIDR,192.168.0.0/16,DIRECT,no-resolve
Matches by IP range — local network addresses connect direct without going through the proxy; no-resolve means the domain isn't pre-resolved
DIRECTGEOIP,CN,DIRECT
Routes based on which country/region the destination IP belongs to — mainland China IPs connect direct
DIRECTMATCH,PROXY
The catch-all rule, matching any traffic that didn't hit a rule above — must be the last line in the list
PROXYAdvanced tip: besides writing rules directly in rules, Clash also supports rule-providers — referencing a remotely hosted collection of rules maintained by the community or a provider (like "all mainland China domains" or "all ad domains") with a single line, and its content updates automatically from the remote source with no manual upkeep. You don't need to worry about this layer for everyday use — only dig in if you want to customize routing behavior and the default rule set doesn't cover it. If you do, remember to place your custom rules before the rule-provider reference, since earlier rules take priority.