config.yaml / First-Time Setup

Clash Setup Guide

Go from importing a subscription to checking your first connection. Start with a test request in rule mode, then adjust ports or enable TUN if needed.

01 / profiles

Import a Subscription and Activate the Configuration

Start with a subscription link provided by your service provider or administrator that works with your client. This is the address the client uses to fetch its configuration—not a server address to enter in your browser’s proxy settings. Subscription links may contain account credentials, so copy the full link and never share it in public screenshots or support posts. If you received a local YAML file, choose “Import from file” instead; there’s no need to upload it elsewhere to create a link.

Add the Configuration and Wait for It to Download

Open the client’s “Subscriptions” or “Configurations” page and add a remote configuration. Some clients ask you to choose a source type before showing a URL field; others offer “Import from URL” directly. Paste the link into the URL field, check for any accidental spaces or punctuation at the end, and save. Give it a recognizable name if you like. Once it appears in the list, wait for the download to finish. If there’s an “Update” button, use it once and check for a success message or updated timestamp.

If you get a format error after saving, make sure you copied the subscription endpoint—not an account sign-in or help page. A URL opening in your browser doesn’t mean it returns a configuration the client can parse. For an authorization error, check with the provider that the link is still valid. For a timeout, make sure your current network can reach the subscription source. There’s no need to keep switching proxy modes while the import is failing; the mode doesn’t download the configuration.

Make Sure the New Configuration Is Active

A successful import only confirms that the file was retrieved. Return to the configuration list and select the entry you just imported, or choose “Set as current” from its menu. Make sure it’s checked or marked “In use” before leaving. Then open the “Proxy” page and look for the groups and selectable nodes from that configuration. If you still see the old list, check which configuration is active before changing nodes. Once the client has loaded the right configuration, choose how it should route connections.

02 / mode

Choose a Proxy Mode and Select an Exit in the Policy Group

Find “Rule,” “Global,” or “Direct” in the mode menu on the “Proxy” page or home screen. For your first setup, start with “Rule”: the client checks rules in order and uses the action specified by the first match. That action might connect directly, reject the request, or pass it to a policy group. After switching modes, make sure “Rule” is highlighted. A checkmark next to a node in the list doesn’t mean the mode has changed.

Check Which Policy Group a Rule Uses

If your client has a rule list, find a domain rule you understand, note which group it points to, then open that group on the Proxy page. If the rule points to “Select,” check which node is selected in that group—not a different one. If the selected option is another group, follow it one level further. Auto-select groups usually choose an exit based on their own tests and may show only the current result. You don’t need to change one to manual selection just to verify your first connection.

If a rule’s target is DIRECT, that request connects directly according to the configuration. Available proxy nodes won’t handle it. A target of REJECT means the rule blocks the request. For a test, choose a domain with a known destination. To check the proxy exit, don’t use a domain that should go direct. If you’re unsure about rule order or the final fallback, see the Configuration Reference before editing the subscription file.

Use Global and Direct Modes for Comparison

Global mode sends traffic that has already entered the client through the global policy, which can help you compare results with rule-based routing. Check which exit the global policy selects after switching. Direct mode sends captured traffic straight out; it’s not the same as turning off the system proxy or disconnecting the VPN. None of the three modes captures apps whose traffic never reaches the client. Once you’ve chosen Rule mode and an exit, set up the system or app to send requests through the client.

03 / mixed-port

Enable the System Proxy or Connect in the Client

Start with the System Proxy on Desktop

Keep the client running, then find “System Proxy” on the home screen, in the tray menu, or in settings. Turn it on and make sure the switch stays on. This setting directs apps that follow system proxy settings to the local proxy. For your first test, use a compatible browser; leave terminals, games, and apps with their own proxy settings for later. If your browser has an extension that changes proxy settings, check whether it overrides the system settings. The client switch can be on while the browser uses a different route.

If your desktop client has no system proxy switch, or your system won’t let it configure one automatically, enter the address and port in a test app that supports manual proxy settings. Check the client’s actual listening address, port, and protocol first. For a local-only setup listening on the loopback address, use 127.0.0.1. Enter 7890 only if you’ve confirmed that’s the mixed port. A mixed port accepts HTTP and SOCKS connections; if the client uses separate ports, enter the one that matches the proxy type selected in the app. See General Fields for what each field does.

Approve the VPN Connection on Mobile

Tap “Connect” or the start button on the client’s home screen. The first time you connect, your system may ask permission to establish a VPN connection. Make sure the prompt is from the client you just opened, then approve it as instructed. Return to the client and check that its status shows connected. Your system may also show a VPN indicator in the status bar or VPN settings. Approval only allows the connection; if the client still shows disconnected, check that a configuration is active, no other VPN is using the connection, and the system hasn’t blocked the attempt.

You don’t need to enable both the system proxy and TUN for your first test. Some apps don’t follow system proxy settings. If the browser works but those apps have no connection records, check whether the client supports TUN and what system permissions it needs. Change one thing at a time: keep the current configuration and mode, then check the result after changing the traffic-capture method. This helps separate capture issues from problems with rules, ports, or nodes.

04 / DIRECT

Verify That Requests Are Routed as Expected

Match a Web Request to Its Connection Record

Keep the client’s “Connections” or “Logs” page open, then use a test browser to visit a domain with a known matching rule. Start the request in a new tab. If you see a cached page or no new record, close that tab and try again, or use a similar test domain. Find the record by domain and time rather than relying on the total request count. A page may load images, fonts, and API calls from other domains, each with its own matched rule; none of those alone represents the main page.

Once you find the matching record, check the target first, then the matched rule and actual exit. For a request expected to use a proxy, the record should show it going to the specified policy group and then through the intended node. For a request expected to connect directly, DIRECT matches the configuration. Clients show different details; if the connections list has no rule column, check the logs instead. A page loading successfully doesn’t prove routing is correct, and a successful node speed test doesn’t prove your browser is using that exit.

Use the Connection Record to Find What to Check Next

If the client shows no record for the request, first check whether the app’s traffic is reaching the proxy: on desktop, check system proxy settings, the browser’s own proxy settings, and the listening port; on mobile, check VPN status and which apps are covered. If there is a record but it uses the wrong target, check the mode on the “Proxy” page, then review the matched rule and selected group. If the rule and exit are correct but the site won’t load, note whether the logs show a DNS failure, connection timeout, or refused connection, then follow the relevant steps in Troubleshooting. You don’t need to repeat all four steps.

After testing, restore any mode you changed temporarily to your usual setting. If you changed proxy settings in a test app, restore those as needed too. Before closing the client, turn off the system proxy it enabled or disconnect the VPN so the system doesn’t keep sending requests to a local port that’s no longer listening. After updating your subscription, you can test again with the same domain. If you need help, share the client name, current mode, test destination, and an error message with sensitive details removed. Don’t share your subscription link or full configuration.