First Connection · 4-Step Setup

Clash Setup Guide

Import a configuration, route app traffic through Clash, then check a new connection’s rule and outbound.

Before you begin, get a subscription URL compatible with your core or an existing config.yaml file. For the initial setup, keep the rules in the configuration and note your current system proxy setting so you can restore it after testing.

Import a Subscription and Enable the Configuration

Open the client’s “Profiles” or “Subscriptions” page and choose “New,” “Add,” or “Import from URL.” If prompted to select a source, choose remote subscription, then paste the complete Clash configuration URL provided by your service into the URL field. Give it a short, recognizable name if you like. Save and wait for the download and parsing to finish. If the client only adds an entry, open its menu and choose “Update” or “Download.” Subscription URLs may contain access credentials, so don’t share the full URL in a group chat or screenshot.

To import a local file, choose “Import from file” on the same page and select config.yaml. A file import usually uses the contents from the time of import; unlike a remote subscription, it won’t periodically fetch the entire configuration again. After editing the original file, check whether the client reads that file or an imported copy, and reimport it if needed. A fragment containing only rules is not a complete configuration: if its rules refer to proxy groups that aren’t defined, the core may refuse to load it. Get a complete configuration working first, then change individual rules.

A successful import doesn’t mean the configuration is active. Return to the profile list, select the entry, or open its menu and choose “Use.” Wait for the checkmark or active profile name to change, then check the Proxies page to see whether the groups match the imported configuration. If the entry appears but the Proxies page still shows the previous profile’s groups, check which entry is selected and look for a loading message; there’s no need to add the same URL again. If the group names are correct but the expected members haven’t appeared, don’t enable traffic routing yet. Configurations that use remote proxy providers may need time to fetch their members.

If importing fails, first check whether the client reports “Fetch failed” or “Parse failed.” For a fetch error, confirm that your current network can reach the subscription service and that the URL is complete. For a parse error, make sure you copied a Clash-format subscription URL, not an account webpage or a link meant for another client. Once the active configuration and its proxy groups are visible, continue to the next step.

Choose a Proxy Mode and Outbound

At the top of the Proxies page, look for “Outbound Mode” or “Proxy Mode.” For your first setup, choose “Rule” (that is, mode: rule). Rule mode checks the current configuration’s rules from top to bottom; the first match determines which outbound or proxy group handles the traffic. Broad rules near the top can match before more specific rules below them. Note the existing order before testing, and avoid changing rules while you verify. Changing the mode in the UI affects the active runtime mode and may not update the YAML file.

Open the proxy groups referenced by the rules. Group names are set by the configuration author and might be PROXY or a localized name. A manually selected group usually corresponds to type: select; choose a member and confirm the selection indicator moves to it. Automatic groups let the core choose a member according to the group’s settings; check the group details to see the current selection. If the selected member is another group, follow it until you reach the final outbound. A checkmark on a proxy group doesn’t mean every request will use it.

“Global” and “Direct” are useful for comparison, but neither is required to get connected. “Global” sends traffic that reaches the core through the global outbound selection, which may still require choosing a member in the global group. “Direct” sends traffic that reaches the core straight out, without routing it through the rules list. Neither mode determines whether app traffic reaches the core in the first place. You can have “Rule” selected while system proxy or VPN is still off; that’s what the next step covers.

Before leaving the Proxies page, note the rule and group expected to match a service you plan to test. Also pick a target that should use DIRECT under the current configuration. If the configuration ends with MATCH, it usually catches requests not matched earlier; the outbound it uses depends on what the rule points to. If you’re unsure how the rules and groups are connected, check the FAQ rather than rewriting the whole configuration just to test it.

Route App Traffic Through Clash

On desktop, first confirm the core is running, then enable “System Proxy” in the client and test with a browser that follows the system proxy settings. The system proxy sends requests from apps that honor those settings to the client’s local listening port. Seeing the switch enabled only confirms the setting changed; it doesn’t mean every app uses the system proxy. If your browser has a separate proxy setting, make sure it follows the system settings instead of using an old address.

If the browser immediately reports that it can’t connect to the proxy server, check that the client is running and that the address and port registered in the system proxy match the current configuration. Some configurations use mixed-port for both HTTP and SOCKS proxy traffic. Don’t copy a port from a tutorial example into your system settings; use the listening port shown by your client. This is especially important after switching configurations: the system or browser may still have the old port while the new core listens on a different one.

If the browser test works but the target app ignores the system proxy, consider switching to TUN. To keep the two routing methods separate, note the system proxy’s current status, turn it off, then enable “TUN Mode” and follow the client and operating system prompts to grant any required permissions. Once the client shows that TUN is enabled, make a new request from the target app. If it reports that a virtual adapter or system service hasn’t started, read the error before proceeding; don’t repeatedly change permissions, mode, and outbound all at once. If your network is managed by an organization, confirm that your device is allowed to change this setting first.

On mobile, tap “Start” or “Connect” on the home screen. When the system VPN prompt appears for the first time, confirm that it came from the client you just opened, then approve it. Return to the client and check that the home screen shows it’s running. If another VPN service is also in use, confirm which one is active so you don’t mistake its status for a Clash connection. The system status icon can show that traffic routing has started, but it won’t tell you which outbound is being used; check an actual request in the next step.

Verify the Rule and Actual Outbound

Open the client’s Connections page, then visit the service you selected in step two. Try to make the app open a new connection: an existing tab may reuse a connection from before the mode changed or load from cache. Close the app’s existing test session and reopen it if needed, and note the time of the request. A page may also load images, scripts, and other domains, so filter by the target host you’re checking rather than treating any new entry as the test result.

Open the request details and check the destination, matched rule, and outbound chain in that order. A matching destination confirms that this request reached the core. The rule field shows whether routing matched your expectations, and the outbound chain shows the proxy group’s final selection. If the connection closes too quickly to find in the list, filter the Logs page by the time and target you just tested. If the client lets you change the log level, use Info during the test and restore the previous setting afterward.

Repeat the test with a target expected to go direct, and confirm that the request completes via DIRECT. Direct requests can still appear on the Connections page: they reached the core, but the rule sent them out without a remote proxy. If no matching entry appears, check whether the app uses your selected routing method and whether a system proxy bypass list or TUN routing setting is avoiding the core. A webpage loading or a proxy group showing a latency result doesn’t, on its own, prove that the app’s actual request was routed as expected.

If a request appears but matches the wrong rule, check the rule order in the active configuration and confirm that outbound mode is still set to “Rule.” If the rule and outbound are correct but the request doesn’t complete, note when it failed and the first related error in the log. Then use the troubleshooting guide to investigate issues such as proxy timeouts, DNS, or traffic routing not taking effect. Change one setting at a time and make a new request to the same target after each change. Once both test requests complete with the expected outbounds, you can keep the current settings. When you’re done, turn off the routing method you enabled and restore the previous system proxy setting.