Full documentation · Platform setup

Clash Setup Guide

For your first setup, follow the Getting Started Guide to import a configuration, connect, and verify it works. To check installers, traffic routing options, or platform limitations, find your operating system on this page.

Before setup · Getting started

Clients, subscriptions, and traffic routing

Choose an installer for your device

Check your operating system and processor architecture, then find the right installer in the Download Center. Clash Plus is the recommended desktop client for Windows and macOS, and a good place to start on Android and iOS. For Linux desktops, consider Clash Verge Rev. If you already have a configuration, first check whether your current client can export it and preserve overrides before switching. For basic connections and policy switching, a graphical client is usually all you need—there's no need to install the mihomo core separately.

An installer, a subscription link, and a configuration file are three different things. The installer adds the app to your system. A subscription link is a URL the client uses to fetch updates. A local configuration file is a snapshot; it won't keep syncing just because its filename stays the same. When moving from one computer to another, it's easy to copy the file but miss the update source or local overrides. If each device needs different rules, keep separate copies first, then decide which settings should be shared.

Check the subscription format and update source

Choose a subscription format that the provider explicitly says works with your client. An account sign-in page, plan page, or sharing page isn't necessarily a subscription URL. On mobile, after copying a link, make sure you haven't included any surrounding instructions. On desktop, check that you haven't copied multiple lines. If the provider gave you a file, import it locally—don't paste its file path into a remote URL field.

After importing, activate the configuration. Seeing it in the list only means the client received it; the previous configuration may still be active. Select the new one, then open the proxy or policy groups page and check for the expected group names. Some rules rely on remote rule sets: a working subscription URL doesn't guarantee those resources can be downloaded. If the configuration fails to apply, check whether the log points to the main config, a rule set, or a field the core doesn't support.

Understand traffic routing and rule matching

A system proxy advertises a proxy endpoint to apps; each app decides whether to use it. Browsers usually read the system settings, but terminal tools, games, and some built-in network components may not. TUN routes traffic at the operating system's network layer and usually covers more apps, but its reach still depends on routes, permissions, and the client implementation. On phones, the system VPN is the platform's way to route traffic through a client; desktop toggle names don't necessarily apply.

Choose an option based on the traffic you need to route
MethodWhat to checkBest for
System proxyWhether the app uses the system proxy settingsApps that follow system settings, such as browsers
App-specific proxyWhether the app points to the correct local address and portRouting a single app or command
TUN or system VPNWhether the virtual interface or VPN is running and the routes cover the targetDevices that need to route traffic from more apps

Rules, Global, and Direct determine how requests that reach the client are routed. Rule mode won't send an app to the client if that app never uses the proxy. TUN won't automatically send every request through the same node, either. For your first test, enable just one routing method, make a fresh request to a known destination, then check the connection list for the destination, matched rule, and exit. If the request isn't listed, check traffic routing; if it is listed but uses the wrong exit, check the rules and policy group.

Keep a way to undo each change

When taking over a device that's already configured, note the active config name, mixed port, system proxy setting, and current VPN status. If the device is managed by your company or school, record its required proxy and connection policies too—don't overwrite them. Enable startup or automatic updates only after everything works. If something breaks, undo one change at a time, reversing the order you made them: update the config, switch the policy, then enable traffic routing. This helps pinpoint whether the config changed or traffic is taking a different path.

Desktop · Windows

Windows installation and system proxy

Download the installer and launch the app for the first time

Open Windows Settings → System → About and check System type to see whether your device is x64-based or ARM-based. Then choose a client from the Windows downloads. Clash Plus is the recommended first choice. If you prefer another interface, consider Clash Verge Rev, FlClash, or Clash Nyanpasu. Clash for Windows is no longer maintained; use it to check an old configuration if needed, but avoid it for a new installation. If the download page doesn't list support for your architecture, don't assume compatibility from the filename alone.

Run the installer and follow the prompts. After the first launch, leave startup disabled for now and check the taskbar notification area for another proxy client still running. An older app may keep listening on a port, changing the system proxy, or restoring its previous routing settings even after you close its main window. Exit it properly first. Keep a backup of any configuration you plan to migrate; there's no need to delete the old app's data folder just to rule out a conflict.

Import a subscription, then check traffic routing

On Clash Plus's subscription page, add the URL from your provider, update it, and select it as the active configuration. To import a local file, use the configuration import menu. Open the proxy page and check that the policy groups look right; select an available exit in any group that requires a manual choice. If the old groups still appear, first confirm the new config is active, then check the config application log. Don't keep adding the same URL to fix an activation issue—you may end up with several entries with the same name.

Turn on System Proxy in the client, then check Windows Settings → Network & Internet → Proxy to confirm it's active. The client may set a manual proxy or use a script. Check that the Windows settings match the routing method shown in the client; don't enable both options just to be safe. Open a new browser window and visit a test destination, then check the matching connection entry in the client. If most websites stop loading after you quit the client, check whether the system still points to a local address that is no longer listening, then restore the previous proxy settings.

Handle exceptions in terminals and apps

If your browser works but a PowerShell command doesn't, try an explicit proxy as a comparison. This command assumes the mixed port is 7890 and uses an HTTP proxy for this request only; it doesn't change system settings. Using curl.exe avoids older versions of Windows PowerShell interpreting curl as an alias. A response confirms that this explicit route may work; check the connection list to make sure the request used the expected exit.

curl.exe --proxy http://127.0.0.1:7890 --head https://example.com/

If you need to route apps that don't use the system proxy, try TUN. Follow the client prompts to install or enable any required service, grant system permissions, and check the logs for virtual interface creation failures or route conflicts. For the first test, turn off the system proxy and use TUN alone so you can tell which route handled the request. Some apps are also affected by loopback restrictions; see Windows app loopback troubleshooting. You don't need to change network settings for every app to work around one restricted app.

Find port conflicts and leftover settings after exit

If the client can't listen on a port, use the command below to find the process ID associated with it. Results may also include remote ports or closed connections. Check that the Local Address column ends with the target port, confirm the state is Listening, then look up the process ID under Details in Task Manager. If the conflict is with a service you still need, changing Clash's mixed port is usually better than stopping an unfamiliar process. Update any apps where you entered the proxy manually, too. For the difference between a mixed port and a controller port, see troubleshooting a port conflict.

netstat -ano -p tcp | findstr ":7890"

Desktop · macOS

macOS installation and network permissions

Choose the right build and launch it from Applications

Open the Apple menu and choose About This Mac. If it shows Chip and lists an Apple chip, choose the Apple Silicon build; if it shows an Intel processor, choose the Intel build. In the macOS downloads, Clash Plus is the recommended first choice. You can also choose Clash Verge Rev or FlClash based on how you use your Mac. ClashX Meta is no longer maintained. If you're migrating, use the old configuration as a reference, but don't assume every setting maps directly to the new client.

If you downloaded a disk image, open it and drag the app into Applications, eject the image, then launch the app from Applications. If you downloaded an installer, follow the system prompts. Don't keep running the app from a mounted image: ejecting it will break the app path, and it can be confusing if you've also copied a separate copy. If macOS blocks the app, check its download source, system requirements, and the diagnostic message. Only follow system prompts for apps from a source you've verified; don't disable system-wide security checks.

Move your subscription and system proxy settings

Add your subscription to the new client, wait for it to finish fetching, then select it as the active configuration. If you changed policy selections, rule order, or bypass addresses in the old client, note those settings first. Remote subscriptions can be fetched again, but locally edited settings aren't guaranteed to carry over. First get the provider's original configuration working in the new client, then add back only the overrides you need. This makes it easier to distinguish subscription incompatibility from conflicts with old rules.

After enabling the system proxy, open System Settings → Network, select the network service you're using, and check its Proxies page. Wi-Fi and Ethernet may have different proxy settings; checking the wrong service can make it look as though the toggle didn't work. The read-only command below shows the proxy dictionary reported by macOS. Compare it with the settings for your active network service. Seeing a proxy host and port only confirms that macOS reports those settings; check in the client that a test request actually arrives.

scutil --proxy

Enable TUN and handle network changes

Consider TUN if the target app doesn't follow the system proxy. Follow the client prompts to install or enable its helper service, then respond to any system permission requests. Authorization screens vary by client and macOS version, so follow the prompts on your device. Turn off the system proxy first and verify that TUN alone receives new requests. If the toggle turns itself off, check the startup log and authorization status before changing nodes; an enabled toggle doesn't mean the virtual interface and routes are working.

After waking your Mac from sleep, switching Wi-Fi networks, or connecting a dock, the active network may have changed while the client is still restoring its previous routing state. Turn off traffic routing first and confirm the network has an address and default route, then enable one routing method again. On public Wi-Fi that requires a sign-in page, complete the sign-in before testing. If the same issue keeps happening, note the exact trigger, such as “when switching from Wi-Fi to Ethernet,” instead of assuming the subscription expired.

Check for permission issues and local resource conflicts

If the system proxy works but TUN won't start, focus on the helper service, permissions, or other network software. Check whether a corporate VPN or another traffic-routing tool is running at the same time. On a managed device, ask your administrator whether alternate routing is allowed. If neither mode works, check that the configuration loaded and the local listener started. The command below only checks for processes listening on the mixed port; if it returns nothing, verify the actual port before concluding that the network is down.

lsof -nP -iTCP:7890 -sTCP:LISTEN

To undo the changes, turn off traffic routing in the client, quit it normally, then check the proxy settings for your active network service. If you enabled startup or a helper service and plan to uninstall the client, follow its cleanup instructions for background components. Closing a Dock window may not quit a menu bar app. Confirm that it has stopped listening before starting a replacement client to avoid the two apps overwriting each other's proxy settings.

Mobile · Android

Android installation and VPN routing

Choose a build for your architecture and authorize the installer

Start with Clash Plus from the Android downloads. You can also consider Clash Meta for Android, FlClash, or Surfboard based on your device and configuration format. Before switching clients, check that the new one can read your existing subscription—being able to install it doesn't guarantee it can import your config. Choose an installer for the architecture listed on the download page. Most recent devices can use an ARM64 build, but some still have architecture limits in their system userspace; don't rely on the chip specifications alone.

Open the installer from your browser or file manager. Android may ask you to allow that app to install unknown apps. Verify the download source, grant permission only to the app that started the installation, and revoke it afterward if you like. If the installer reports a conflict with an existing app, first check whether the old app and new package come from the same distribution channel. Don't uninstall the old version just to make an upgrade work: back up any configuration and in-app settings you need first, especially custom rules without a remote copy.

Import a configuration and start the system VPN

Add the URL on the client's subscription or configuration page, save it, then run an update. On mobile, the share sheet may pass a webpage title, a download page URL, or a plain-text file. Check whether the client received an updateable remote config or loaded a one-time copy from a file. Once the update finishes, activate the configuration and check its policy groups. Returning to the home screen after import is normal, but confirm activation using the active indicator and logs.

When you tap Connect, Android asks you to allow the app to set up a VPN. Check that the system dialog names the client you just installed, then approve it. A VPN icon may appear in the status bar; you can also check the provider in the system VPN settings. This is the usual way for a phone to route traffic through the client. Desktop-style System Proxy settings don't apply here, and a manual HTTP proxy in the Wi-Fi settings is a separate feature you usually don't need to change.

Usually, only one VPN can be active in the same user profile. If another VPN or VPN-based filtering app is running, or Always-on VPN is enabled in system settings, the new client may fail to start or be replaced as soon as it connects. Check the system VPN page to see which app is actually connected, and whether Always-on VPN or Block connections without VPN is enabled. VPN policies on work profiles and managed devices are controlled by the administrator; don't override them manually.

Troubleshoot background disconnections, network changes, and app coverage

If the connection drops as soon as you lock the screen, reproduce the issue and check the system VPN status. If the VPN icon disappears too, check battery optimization, background restrictions, and whether the client is allowed to keep running. Adjust the relevant setting for this client if you need a persistent connection. If the icon stays but requests time out, check whether the client log shows reconnects or DNS failures. An app running in the background doesn't guarantee a working connection; test these symptoms separately.

When switching from Wi-Fi to mobile data, existing connections may need to reconnect. Make a new request in the same app; don't use a page opened before the switch or a cached video as your test. If only mobile data fails, check whether Android restricts mobile data for the app or Data Saver is on. If only one Wi-Fi network fails, turn off traffic routing first, confirm that the network's sign-in page has been completed and the connection works, then compare the client logs.

If only one app is affected, check whether the client has per-app routing enabled. An include list routes only selected apps through the VPN; an exclude list does the opposite. An app in a work profile may be a different instance from an app with the same icon in your personal profile. Change only the target app for testing, then make a new request. If local device access is also affected, check LAN bypass settings and test local addresses separately from internet domains. Don't assume both issues have the same node as their cause.

Mobile · iOS

iOS installation and VPN configuration

Install from the App Store and distinguish the two configuration types

Open Clash Plus's App Store listing from the iOS downloads, check compatibility, then install it. The client website is clashplus.io. If an app with the same name is already installed, verify which app actually opens on your device and compare it with the App Store listing. Then check whether your existing configuration is still there. After a fresh install, test one connection and disconnection in the foreground before setting up automatic connections.

A subscription in the client provides nodes and rules. The VPN configuration in iOS Settings authorizes the system to route network traffic; the two aren't interchangeable. Seeing a VPN entry in Settings doesn't mean a subscription has been imported, and seeing policy groups in the client doesn't mean the system is connected. When troubleshooting, note both states separately: whether the right subscription is active and whether Clash Plus established the current connection. If the device has several VPN configurations, the status bar icon alone won't tell you which one is active.

Import a link or file and verify the active policies

Paste the full URL into the subscription section of the client and update it. If your provider sent a configuration file, save it to Files first, then use the client's local import option. When using the share sheet, make sure you're passing the configuration file itself, not a webpage URL. After importing, select the config and open the proxy or policy page to confirm its contents were updated. If parsing fails, check with the provider that you chose the right subscription format rather than submitting the same URL repeatedly.

If you're moving a custom desktop configuration to your phone, check local file paths one by one. A local rule-set file won't move with the configuration text, and a loopback address written on your desktop will point to that computer. On an iPhone, the same loopback address points back to the phone itself. First verify that the original subscription works, then migrate only the rules and resources you need. Keep a working copy on the original device until migration is complete, so troubleshooting doesn't leave both devices without a usable configuration.

Authorize traffic routing and confirm the request path

Start a connection in Clash Plus and approve the iOS prompt to add a VPN configuration. Authenticate on the device if asked. Return to the app and check that the connection stays active, then check the connected provider under Settings → General → VPN & Device Management → VPN. Use the system VPN for traffic routing; don't add an HTTP proxy in the Wi-Fi details as well. That setting applies only to a specific network and apps that follow it, adding another route to troubleshoot.

After connecting, test with a newly opened page rather than relying on content that was already loaded. If the client shows connection logs, check the test time, destination domain, and policy used. If the homepage loads but images or sign-in fail, inspect those requests separately: the page and its resources may come from different domains. Change one policy group and test again to see whether the exit makes a difference. If the VPN status disappears quickly, check authorization or routing conflicts before reimporting the subscription.

Troubleshoot automatic connections and cellular data

If the VPN reconnects after you disconnect it manually, check on-demand connection settings in both the client and iOS VPN configuration. Turn off automatic reconnection for a baseline test; this helps tell whether the app is reconnecting or iOS is starting it based on a rule. If the device has a work VPN, school configuration, or management profile, check its current status but don't remove organization-managed items. Follow your organization's process when switching between work environments.

If Wi-Fi works but cellular data doesn't, first check that iOS allows both the target app and the client to use cellular data, then compare logs for a new request. If local devices are unreachable on both networks, disconnect the VPN and check that the local device and Wi-Fi work, then check local network permissions and whether the client bypasses LAN traffic. System authorization, network reachability, and proxy rules are separate steps. Change one at a time and restore the original setting when you're done testing.

Desktop & servers · Linux

Linux clients and the mihomo core

Choose a package for your distribution, architecture, and use case

Run uname -m to check the processor architecture, then cat /etc/os-release to identify the distribution. In the Linux downloads, start with Clash Verge Rev or choose FlClash. Debian- and Ubuntu-based systems generally use a compatible deb package; for Fedora and other RPM-based systems, check whether a suitable rpm package is available. A matching package format doesn't guarantee a matching processor architecture, so check both before downloading.

On desktop Linux, use your distribution's graphical software installer or install the local package with its package manager so dependencies are handled correctly. If a dependency is missing, identify the specific system component; don't copy library files from another distribution into system directories. After installation, launch the app from the application menu and check that it opens and closes normally. If no menu entry appears, verify that the package installed successfully, or launch the installed app from a terminal to see any errors.

Import a subscription and configure the proxy in a graphical client

Add a remote URL on the subscription page, or import a local file from the configuration page. Once the update completes, activate the configuration and check the policy groups for the expected exit. On Linux, if the update downloads but can't be saved, check whether the log points to your user configuration directory or the installation directory. Keep normal settings in a directory the current user can write to. Don't run the graphical client as an administrator long-term to work around a permission error; its cache and configuration may end up in a different directory.

Whether a graphical client's system proxy toggle works depends on the desktop environment and whether apps read its settings. Check the proxy values in your desktop network settings, then make a new request in a browser that uses those settings. To test the local listener from a terminal, try an explicit proxy; use the port that's actually configured. Don't start by adding settings to a system-wide environment file: an already-running app won't pick up an environment variable changed in another terminal.

curl --proxy http://127.0.0.1:7890 --head https://example.com/

Enable TUN only if you need broader traffic routing and the client supports it. Your system must have a usable virtual network device and the permissions required to manage interfaces and routes. Containers and restricted sessions may not have access to the required device or capabilities, even if the client shows a toggle. Check logs for interface creation and routing issues. If you only need a few tools to use the proxy, keep the local listener and configure those tools individually; that's usually safer than changing routes for the whole host.

Test and restore a standalone core configuration

On a server or router without a desktop environment, choose a mihomo build for your system and architecture from the core downloads. Running the core on its own doesn't provide the subscription updates or startup features of a graphical client. Put the configuration in a clearly defined working directory and keep track of the working directory, main config, and referenced resource paths. The example assumes mihomo is in your command search path and a prepared config.yaml is in the current directory. Once the test configuration passes, run it in the foreground first so you can watch the logs.

mihomo -t -d "$PWD" -f "$PWD/config.yaml"
mihomo -d "$PWD" -f "$PWD/config.yaml"

After verifying in the foreground that listening and forwarding both work, consider running the core as a system service. The service account needs permission to read the configuration and resources, and to write to any working directory that needs updates. A service doesn't inherit the working directory of your interactive terminal. If it runs in the foreground but fails as a service, compare the service account, working directory, and logs rather than masking a path issue with elevated permissions. When testing on a remote host for the first time, keep your existing management connection and recovery path open; an unverified default route could disrupt them.

If a graphical client and a standalone core are both running, decide which one owns the listener and which one sets the proxy. Passing a config test only confirms that test worked; it doesn't guarantee the port you'll use later is still free. If two instances are listening on the same port, stop the one you don't need, compare the port settings in their config files, then decide whether they should run side by side. After switching back, make a fresh request and confirm the log comes from the expected process, not an old instance still running in the background.

Review · Troubleshooting

Configuration FAQ

How can a minimal configuration help pinpoint the problem?

First check three separate layers: whether the core starts, whether the local port accepts requests, and whether a subscription exit can forward traffic. The example below is a standalone config for testing mihomo locally: it listens on the loopback address and uses Direct rules only, with no remote nodes. Back up your active configuration and make sure the port is free before launching a copy. Use an explicit proxy to check whether a request reaches the core. This example doesn't test subscription exits and shouldn't replace your everyday configuration.

mixed-port: 7890
allow-lan: false
bind-address: "127.0.0.1"
mode: rule
log-level: info
tun:
  enable: false
rules:
  - MATCH,DIRECT
Key fields and what to check after changing them
FieldPurposeCheck after changing
mixed-portProvides HTTP and SOCKS proxy endpointsUpdate the port in apps configured manually
allow-lanControls whether LAN clients can connect to the proxyCheck the bind address and actual access permissions
modeSets how routed requests are matchedCheck the actual exit in the connection log
tun.enableControls whether a virtual network interface is used for routingCheck the required permissions and route status

Did the subscription update fail, or did the configuration fail to apply?

Note whether the failure happened when you clicked Update or when you switched configurations afterward. For an update failure, check the system clock, basic connectivity, whether the URL is valid, and what the provider returned. For an apply failure, check which field, policy group, or resource file the core reported. A webpage loading doesn't mean you received a configuration; a sign-in page or error page can also contain readable text. If the client can keep the previous copy, restore it to get connected, then troubleshoot the update separately.

When editing YAML, check indentation first, then field nesting and policy names. Make sure values after colons, list item indentation, and rule group references match the actual configuration. Don't define the same top-level field in two places or rename only part of a group. A remote subscription update may overwrite direct edits. If the client supports overrides, keep persistent changes there and inspect the merged configuration—not just the override fragment.

System proxy is on, so why is an app still connecting directly?

Make a new request and look for it in the client's connection log. If it's missing, check whether the app uses the system proxy, the address is on a bypass list, or the app is still using settings it read when it launched. If the request appears but uses Direct, check the matched rule and exit group. Browser extensions, proxy scripts, and terminal environment variables can all change the request path; check them separately. See proxy troubleshooting for browsers and terminals.

When rules are evaluated in order, put more specific domain rules before broader rules that would match them. A catch-all MATCH rule generally belongs at the end. Check the rule and policy group together: even a matching rule can point to a group set to Direct or to an unavailable exit. If only one destination fails, don't switch to Global right away. Note the rule and exit actually used, then test the same destination again. Browser cache and existing connections can skew the result, so make a fresh connection for comparison.

How should I retest after updating rule resources or changing the core?

GeoIP data, domain classification data, and remote rule sets are resources used by the configuration; they aren't the subscription itself. First check which resource type the active configuration references, then check the logs for its update or load result. If only one type of destination is affected, focus on the relevant resource and rule order. If every request fails, go back and test the listener, traffic routing, and exit layers. Before changing cores, keep the current configuration and essential resources somewhere you can restore them from.

Cores don't all support the same rule types and fields. When migrating, test the original subscription first and confirm basic connectivity, then add DNS, TUN, and custom rules one at a time, recording the result after each change. For field differences, see the mihomo and original Clash configuration comparison. When asking for help, share your platform, client name, steps to reproduce, and the relevant redacted error line. That's easier to troubleshoot than a full configuration and avoids exposing your subscription URL.

Back to contents ↑ · Repeat the connection steps in the getting started guide →