From Beginner to Advanced / Configuration Guide

Clash Setup Guide: From First Steps to Advanced Configuration

Setting up a client for the first time? Follow the quick-start guide to import a configuration, connect, and verify it works. Come back to this guide when you need to understand why a setting works, move a configuration, or troubleshoot a particular step.

  • Installation & Authorization
  • Subscriptions & Rules
  • Network Diagnostics

Core Concepts: How a Connection Is Routed

Clients, Cores, and Configurations Have Different Roles

The client is the app you open. It imports files, displays settings, requests system permissions, and shows connection logs. The core handles proxy connections, reads rules and policy groups from the configuration, and creates outbound connections using the selected protocol. The configuration specifies which servers to use, how to evaluate traffic, and where to send matching connections. These layers depend on one another, but they are not interchangeable: an app opening successfully does not mean it accepted the configuration, and a configuration loading successfully does not mean its remote servers are reachable.

The Clash ecosystem includes multiple clients and different core implementations. This guide uses mihomo syntax to explain traffic routing, but that does not mean every Apple-platform app includes the same core or supports the same fields. To check compatibility, start with the app’s core information, help page, or import error, then check the format specified by the configuration provider. If an app supports only some fields, a file may import successfully but behave differently than it does on another device.

From System Capture to a Rule Match

When you open a webpage, the request first needs to reach the client. On a Mac, apps that honor the system proxy can send requests to the local proxy; enhanced mode can also capture traffic on selected routes. On iPhone, the app typically creates a system VPN configuration. Once traffic reaches the core, rule mode evaluates the destination against the rules in order and sends the connection to a direct, reject, or policy-group outbound. The policy group then determines the specific outbound based on the current selection. Traffic that never reaches the client will not be captured just because the configuration contains rules.

Keep policy groups and proxy nodes distinct. A node is a specific proxy outbound, usually defined by a server address, port, and protocol settings. A policy group references nodes, other groups, or built-in policies, separating rules from specific outbounds. Rules can keep pointing to the same group while you change the actual outbound by selecting a different group member. Even a group named “Proxy” might include a direct option. When troubleshooting, check the group’s current selection—not just the name shown in the rule.

Use A/B Tests to Pinpoint the Fault

First disable traffic capture in this client. On the same network, open a site that normally works and make sure the device is not stuck on a public Wi-Fi login page. Then enable the client, make the same request again, and check the connection log. If the app logs this type of connection, you can usually see the destination, matched rule, and actual outbound. You do not need to test every app at once; a request you can repeat reliably is enough to make a useful comparison.

If there is no log entry, check how traffic enters the client and whether the log is filtered—for example, whether the app uses the system proxy, the tunnel is connected, or the request reused an existing connection. If there is an entry but it took the wrong route, check the mode, rule order, and group selection. If the outbound is correct but the request still fails, investigate DNS, protocol settings, or server reachability. After each change, retry one destination at a time to avoid mixing background requests from multiple apps into the same log.

Choose a Client: Check Your Device and Configuration Format

Start with One Device and One Configuration

For Apple devices, start with Clash Plus. On iPhone and iPad, use the iOS section of the download page to open the App Store, and check the store listing for compatibility before installing. On Mac, download from the macOS section based on your processor. Open About This Mac from the Apple menu: choose Apple Silicon if it lists an Apple chip, or Intel if it lists an Intel processor. The system information and download listing are more reliable than the device’s appearance, purchase year, or “Universal” in an installer’s name.

Before downloading, find out what format your configuration uses. Being able to download a text file does not guarantee the app can load it. The same provider may offer a full configuration, a list of nodes, or an import link intended for a particular app. If you already have custom rules, check whether the app can export a local copy, switch between multiple configurations, and update a remote subscription without overwriting local edits. If you need to troubleshoot connections, also check whether the app can show the destination, matched rule, and outbound.

DeviceSuggested Starting PointWhat to Check Before Installing
iPhone / iPadClash PlusApp Store compatibility, configuration import format, VPN authorization
MacClash Plus; or Clash Verge Rev or FlClashOS version, processor architecture, logs, and required traffic-capture method
Windows / AndroidStart with Clash Plus for the platformProcessor architecture, configuration compatibility, and traffic-capture method
LinuxClash Verge Rev; or FlClashDistribution, package type, and desktop network settings

Narrow Down Your Options by Use Case

If you mainly need to import a subscription, choose an outbound in a policy group, and pause the connection when needed, start with one client as a baseline instead of installing several to compare. If you regularly edit local rules, compare how easy each app makes it to switch configurations, catch syntax errors, and filter logs. On Mac, compare Clash Verge Rev and FlClash. ClashX Meta is no longer maintained; its archived releases are useful for legacy setups, but it is not a good default for a new installation. See the client comparison for feature differences.

If you also need clients for other devices, Windows options include Clash Verge Rev, FlClash, and Clash Nyanpasu; Clash for Windows is archived and no longer maintained. On Android, compare Clash Meta for Android, FlClash, and Surfboard—but similar-looking interfaces do not guarantee identical configuration behavior. On Linux, first identify the package format used by your distribution. If you just want to open a desktop app and import a configuration, there is no need to download a standalone core or set up a server yourself.

Move to a New Client Without Disrupting Your Setup

Before switching clients, export any local configuration you are allowed to keep, and note the currently selected policy-group member, traffic-capture method, and usual test destinations. Before launching the new app, turn off the old app’s system proxy or tunnel normally, then quit it. If both apps try to listen on the same port, the new one may fail to start. If both apps restore the system proxy, the system may keep pointing to the app you already quit. Disable automatic startup in both apps while testing so it is easier to reproduce and restore the original setup.

After importing into the new client, confirm that the active configuration is the one you just imported and that the group selection matches the old device. A configuration can sync rule definitions, but selected nodes, auto-connect conditions, and system permissions are often stored locally. Test at least one connection expected to go direct and one expected to use a proxy. If either behaves differently, keep logs from both clients for comparison. Avoid changing rules during migration so you can identify which layer caused the difference.

Installation & Authorization: Set Up a Recoverable Baseline

Mac: Launch the App Before Enabling Traffic Capture

Download the installer for your processor from the macOS download section. If you downloaded a disk image, open it and follow the instructions to move the app to Applications. If you downloaded an archive, extract it and then move the app. Launch it from Applications rather than from a mounted disk image or the Downloads folder. If macOS displays a security warning on first launch, check the source, app name, and download listing, then read the specific warning. If the source is unknown or does not match what you expected, stop the installation; do not disable system security to proceed.

When you first open Settings, leave the system proxy, enhanced mode, and launch-at-login options off. Confirm that the configuration and log pages open normally. Once you have imported a working configuration, enable the system proxy on its own. If the app requests authorization for a helper or network extension, verify that the request comes from the app you just opened and grant permission in the system settings location specified by the prompt. On a managed computer that requires administrator access, follow your organization’s process; do not install an unknown helper to get around permissions.

If the app’s toggle is on but your browser immediately reports that the proxy is unreachable, open the current network service’s proxy settings in System Settings. The enabled proxy address and port should match the local entry provided by the client. If you switch from Ethernet to Wi-Fi, the active network service changes too; settings for another service are not a reliable comparison. When disabling the feature, turn it off in the client before quitting. If webpages still fail afterward, check whether the system proxy still points to a local address.

iPhone and iPad: Authorize the First Connection

After installing Clash Plus, open the app, import a configuration, and select it. Then tap the app’s connect button. The first time you connect, iOS may ask to allow a VPN configuration and require your passcode or biometric authentication. This prompt is part of setting up the system tunnel, not a request for subscription credentials. Check the connection status in both the app and iOS settings; seeing a VPN entry that was created earlier does not prove the current connection is active.

If you previously installed another VPN, check which configuration is active in system settings. Some apps automatically reconnect on demand after disconnection, making it seem as though the new connection was immediately taken over. For testing, pause the old configuration’s on-demand connection and connect the new one manually. Devices managed by a workplace or school may not allow personal VPNs. If iOS does not offer an option to allow one, ask the administrator instead of repeatedly reinstalling the app.

Keep a Baseline Before Adding Automation

Use a repeatable sequence to verify the installation: disconnect the client and open a familiar webpage; connect, make a fresh request, and check whether it appears on the connection page; then disconnect and confirm that normal networking resumes. On desktop, also make sure that two apps are not both changing the system proxy. On mobile, if Wi-Fi and cellular behave differently, note which network you were on and what had just changed before the failure. Do not rush to replace the configuration.

Subscriptions & Configuration: Import, Activate, and Update

Know the Difference Between Remote Subscriptions and Local Files

A subscription URL is an entry point for retrieving configuration content, not a proxy address for your browser. A client usually saves the URL for a remote subscription and fetches the file from it again when you update. A local configuration stores the current content and does not know where to get updates. Some remote URLs return a complete Clash configuration; others return only a list of nodes or a format intended for another client. Find the format provided for your app, then use its “Import from URL” option or equivalent.

For a local file, choose “Import from file” and select the actual YAML file. Seeing a configuration name after importing only means it was added to the list; you still need to activate it and, if prompted, reload it. Then open the proxy or policy-group page and check that the groups from the imported configuration appear. If multiple configurations have the same name, label them by source and purpose—such as daily use or testing—so you do not select an old copy and mistake it for a failed update.

Distinguish Download Errors from Parse Errors

If the app cannot fetch a subscription, check that the URL was copied in full, the current network login is complete, and the subscription is still valid. Watch for extra spaces or line breaks at the end. If the URL contains access credentials, do not share it or paste it into online conversion, speed-test, or text-checking services. If the provider needs to issue a new URL, use its account portal; remove query parameters from screenshots before sharing them.

If the file downloads but the app cannot parse it, check the reported line and the one above it—especially indentation, colons, and list hyphens. The server might return a webpage error that the app then tries to read as configuration text, resulting in a format error; changing indentation repeatedly will not help. Confirm that the response is a configuration for your client, then check group names, rule targets, and node references. Names must match their definitions, including capitalization and actual spaces; do not rely on how similar they look in the interface.

Keep Updates Separate from Local Changes

Test a manual update first. Before updating, note the active configuration and selected group member. Afterward, confirm that the client reports a successful download, that the new content has loaded, and that the selected member still exists. If the subscription renames a group or removes a node, the client may switch to a default option. To keep your own domain-direct rules, use the client’s supported override feature or save a copy as a local configuration. Do not edit a temporary file generated from a subscription and expect the changes to persist.

Check how overrides are merged. Some clients append rules, some let you put rules first, and others replace an entire section with a local list. A custom rule appended after the catch-all rule usually will not match; replacing the whole section may remove exceptions from the upstream configuration. Test the position with one verifiable rule before adding another. If the app has no override feature, keep the remote original and a local copy, then compare sections when updating instead of experimenting on the imported subscription.

Proxy Modes: Rule, Global, and Direct

Modes Only Affect Routing After Traffic Reaches the Core

Rule mode evaluates destinations against the configuration’s rules in order, then sends each connection to the matched policy. It is a good everyday baseline because local resources, services that need a proxy, and requests that should be rejected can be handled separately. Global mode sends traffic that reaches the core to the selected global outbound, making it useful for temporarily testing a specific node. Even in global mode, check what the global group actually selects—it may still be Direct. Direct mode usually sends connections handled by the core without a remote proxy, but it does not quit the app or disable system traffic capture.

To understand these three modes, also check the separate settings for the system proxy, VPN, or enhanced mode. Those settings determine how traffic reaches the core; Rule, Global, and Direct determine where it goes afterward. Switching to Global will not capture an app’s connections if that app does not use the system proxy. Likewise, switching to Direct does not necessarily remove the local tunnel, proxy settings, or DNS path used by the client. To test the system’s normal network path, actually disconnect traffic capture instead of only changing the outbound mode.

ModeWhat to TestCommon Misconception
RuleCheck whether the matched rule and actual outbound are what you expectChanging a group member does not change rule order
GlobalRetry the same destination using a specified outboundDoes not mean traffic from every app is captured
DirectKeep the current capture method and compare the remote outboundDoes not turn off the VPN or system proxy

Compare Three Attempts to the Same Destination

Choose a familiar page you can access repeatedly, then note the current mode, destination domain, and group member. In Rule mode, make the request again and check which rule matched. Without changing the network or capture method, switch temporarily to Global, select the same or a specified outbound, and retry. Finally, return to Rule mode and test a resource expected to go direct. Do not switch Wi-Fi, change nodes, and edit rules at the same time; even if the issue disappears, you will not know which change fixed it.

If Rule mode fails but Global works, compare the actual outbounds before concluding that the rules have invalid syntax. The two modes may simply select different nodes, or a group used in Rule mode may be set to Direct. If both modes fail and the logs show the same outbound, investigate the node connection, protocol, and DNS results. If the destination never appears in the logs, first check that the request was actually sent again and that the client can log this type of traffic.

Start a Fresh Connection Before Judging the Result

Changing modes usually affects newly established connections. A browser may reuse an existing connection, and background sync can keep a session open for a long time. A webpage reacting after you switch modes does not prove that the test request took the new route. If it will not disrupt ongoing work, quit and reopen the test app; you can also compare with a separate command-line request. There is no need to disconnect every device from the network—recreate only the connection you need to test.

For everyday use, keep a stable record of your active configuration, usual policy-group member, traffic-capture method, and backup outbound. Use Global briefly for troubleshooting, then return to Rule mode and check local resources again. If you rely on services on a work, school, or home network, do not leave a diagnostic Global selection enabled. For more common questions, see 10 Common Clash Questions for Beginners.

Split Tunneling Rules: Match Order and Policy References

Read Rules Top to Bottom and Put Specific Conditions First

In Rule mode, the core checks rules from top to bottom. The first match determines which policy handles the connection. Use exact domain rules for a small number of exceptions, domain-suffix rules for a main domain and its subdomains, and IP-range rules for known destination ranges. The target on the right can be a built-in policy or a policy group that actually exists in the configuration. A catch-all rule typically goes last to define the route for anything that did not match earlier conditions.

The example below is a minimal configuration that mihomo can load. It has no remote nodes; use it to observe rule order and test the local proxy entry. Save it as a separate file rather than replacing your regular subscription. If the port is already in use, stop the test instance using it or change the port in both the configuration and test command to an unused value. A GUI client may override the listening port in its own settings, so use the actual entry shown by the app.

mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
rules:
  - DOMAIN,www.apple.com,DIRECT
  - DOMAIN-SUFFIX,apple.com,DIRECT
  - IP-CIDR,192.168.0.0/16,DIRECT,no-resolve
  - MATCH,DIRECT

In this example, a destination matched by domain name that is exactly the specified Apple host hits the exact-domain rule first. Other hosts matching the suffix condition are handled by the next rule. Both rules go Direct, so use the connection log to see which one matched; whether the page opens will not tell them apart. If you want ordinary traffic to go through a group, first make sure the corresponding policy group exists, then change the catch-all target. Do not put an undefined group name on the right and expect it to work.

Domain, IP Address, and DNS Matching

Entering a URL does not guarantee the core will see the original domain. Some apps resolve the name themselves and then connect using only the IP address. If the connection log shows only an address, a domain rule may not have the information it needs to match. IP rules may also require DNS resolution to evaluate. In the example, no-resolve means not to actively resolve the address for this rule; it does not mean the system will never resolve it or that later rules will not need the address.

GeoIP databases are useful for rough classification, but they are not a substitute for matching service domains. A service may use multiple domains, and different entry points may share an IP address. Check the logs to find out whether the failure is with login, static assets, or an API request before adding an exception. Do not move a broad IP range or domain suffix to the top of the list just because one request hit the catch-all rule; that could change the route for many unrelated services.

Test Changes in the Smallest Steps Possible

Copy the configuration before adding a rule. Change one condition or one target at a time, keep the catch-all rule at the end, and check indentation and list formatting. After a successful reload, close old connections from the test app and visit one destination that should match the new rule and another that should not. The first checks that the exception works; the second checks that it is not too broad. If the results are reversed, find the earlier matching rule in the logs before changing the order.

TUN Mode: Traffic Capture, Routing, and DNS

When to Use Enhanced Mode

Consider enabling enhanced mode on Mac only if a desktop app ignores the system proxy while a browser using it works normally. TUN uses a virtual network interface to receive traffic routed to that interface, allowing the client to observe and handle more connections. It does not guarantee that every packet goes through a remote server; actual coverage depends on system routes, exclusions, and the client’s implementation. Traffic that reaches the core is still subject to outbound rules.

Before you start, make sure a configuration works with the system proxy and note the test app, network, and log results. Pause other VPNs or network tools that change routes, then enable enhanced mode as directed by the client and grant any required system permissions. If the client lets you use enhanced mode on its own, temporarily disable the system proxy and reconnect the same app for comparison. Whether the two options can be controlled separately depends on the app’s current interface and documentation.

Check Routing First, Then DNS

After enabling enhanced mode, test a regular webpage, then the app that previously ignored the system proxy, and finally a device on the same network, such as a home server or printer. If enhanced mode adds routes automatically, a change in routing may make a previously reachable local device inaccessible. Adding a Direct rule may not be enough: Direct is a decision made after the core receives a connection. Some problems happen before traffic reaches the core or in the system’s route selection for traffic sent to a local interface.

If a domain fails to open but a known local IP address is reachable, check the DNS path first rather than replacing the entire network stack. The client’s DNS settings, an app’s built-in encrypted DNS, and the resolver used by the current system network may all follow different paths. Fake-IP mode returns synthetic addresses for some domains so the core can map them back. If DNS follows that path but the connection bypasses the core, the app may try to use a synthetic address without finding the right destination.

Some configurations use an exclusion list to prevent specific domains from receiving synthetic addresses. Before adding an exception, identify the domain involved—especially names resolved only on a home or office network—and avoid copying someone else’s entire list. After changing configurations, old DNS results and existing connections may persist temporarily. Restart the affected test app before judging the new DNS and routing behavior. Keep the original configuration so you can restore it quickly if a meeting or file transfer is affected.

On iPhone and iPad, Troubleshoot the System Tunnel

On iPhone and iPad, the system VPN status, configuration permissions, and on-demand connections are more relevant than Mac’s enhanced-mode toggle. First verify a manual connection, then check whether the app offers on-demand conditions. Some trigger based on the network; others are managed by the app itself. If the connection returns soon after you disconnect, turn off on-demand in the app first, then check whether another configuration is still active in system settings. Do not mistake automatic reconnection for a broken button.

Routine Maintenance: Updates, Logs, and Rollbacks

Verify Each Type of Update Separately

A client update may change the interface, launch permissions, or system integration. A core update may change supported configuration fields or default behavior. A subscription update changes the current configuration’s nodes, rules, or policy groups. Some clients bundle the core with the app, so it cannot be rolled back separately. Knowing which type of update preceded a problem is more useful than simply noting that “it stopped working after an update.” If possible, do not update the app, refresh the subscription, and edit local rules in the same test cycle.

Before updating, export any local configuration you are allowed to keep, and note the active configuration, selected outbound, and traffic-capture settings. Afterward, there is no need to test every node. Verify three paths first: an expected Direct connection, an expected proxied connection, and normal system networking after disconnecting. If the first update attempt fails, keep the error message rather than repeatedly refreshing. A network failure, upstream error, parse failure, and core reload failure each call for different troubleshooting steps.

Read Connection Logs and Runtime Logs Separately

Connection logs show where a request came from, what it matched, and where it went. Runtime logs are better for checking listening ports, configuration loading, permission errors, DNS failures, and protocol handshakes. Before reproducing an issue, note the local time and destination; afterward, capture only the entries around that request. Start with the normal log level and raise it temporarily only if you need more detail. Restore it afterward to avoid keeping extensive records of private browsing activity.

To check the local proxy on Mac, use Terminal to send a short request through a confirmed HTTP or mixed port. The example uses the port from the rules section; if the client shows another port, replace it with the actual value. This tests only that explicit proxy path. It does not prove that your browser uses the proxy automatically or that every app can connect. If the site returns a redirect, first check whether the request reached the local entry; that alone does not mean the site itself is broken.

curl --max-time 10 --head --proxy http://127.0.0.1:7890 https://www.apple.com/

If the request cannot connect to the local port, check that the client is running, the address and port match the current entry, and the port provides an HTTP proxy. If the local entry receives the request but the core reports a DNS or upstream failure, move your checks to the actual outbound. A speed test usually checks one destination with one short connection; a successful result does not guarantee longer downloads, every domain, or another transport will work.

Restore the Last Verified Working Setup

First make sure you will not interrupt work in progress, then disable any on-demand connection, system proxy, or enhanced mode you added. Once normal network access is restored, select the old configuration, enable one traffic-capture method manually, and retest a destination that used to work. If quitting the client does not restore connectivity, check for a leftover system proxy, another VPN, or a network login page before changing rules. Before uninstalling, turn off traffic capture and automatic startup in the app so it has a chance to clean up its system settings.

Advanced Topics: Policy Groups, Rule Providers, and Standalone Cores

Establish a Verifiable Baseline with a Manual Group

Once you have a stable configuration, you can move frequently changed outbound choices out of your rules. Start with a manual-selection group and point a few related rules to it. During testing, change only the group member and check that the same rule still points to the group. This lets you change nodes later without rewriting every domain. The group’s purpose matters more than its name: name it for a use case such as “Work” or “Downloads,” and keep server names as members. That makes broken references easier to spot after a subscription update.

Consider automatic latency testing or failover next. Automatic testing selects based on probes to a specified destination, which does not directly reflect real-world service performance. Failover generally checks members in order for an available option; it is not load balancing. Very short test intervals generate more probes, and overly strict conditions can cause frequent selection changes. Observe how often your usual networks actually fail before adding automation. For apps sensitive to long-lived connections, a manually selected outbound is often easier to test consistently.

Treat Rule Providers as Independently Maintained Resources

Consider a rule provider when you need to maintain a category of domains over time. Before referencing one, confirm that your current core supports its format and behavior type. Domain lists, IP-range lists, and general rule lists are not interchangeable just by changing a file extension. On first load, make sure the provider resource can be fetched. After an update, verify that the new content is active rather than an old cached copy. Start with a small list and test one destination that should match and another that should not.

A rule provider still occupies one match position in the overall rule list. A broad provider placed too early may bypass later local exceptions; placed after the catch-all rule, it will never take effect. When updating the upstream list, check whether its coverage has changed. Keep a short note about each local exception: why it exists, which services it affects, and how to retest it. That way, you will not have to guess its original purpose after every subscription update.

Use a Standalone Core Only When You Need a Managed Service

A standalone mihomo setup is suited to servers or routers where you need to manage the process, launch options, and logs yourself. It is not a prerequisite for learning how rules work. To try it, start with a minimal configuration and a local listener on a machine you manage. Verify the port, working directory, and configuration path before handing it over to a system service manager. Keep LAN access disabled unless other devices need to connect and you have planned the access scope; never expose the control interface to the internet.

Finish with regression tests for common scenarios: one Direct destination, one proxied destination, one local resource, and a check that the network recovers after disconnecting. Keep your stable configuration separate from experimental ones, and start each change with one rule, one group, or one DNS exception. If an experiment causes trouble, return to a known-working state and check the entry point, DNS, rules, and actual outbound one by one. That makes it easier to identify the cause than piling patches onto a broken configuration.