Five first steps · Six config patterns · Based on v2.5.10

Clash Verge tutorial

The tutorial has two halves. The first walks a newcomer through an entire first session. The second offers six configuration patterns to copy. Every step produces something you can see in the interface.

Reviewed on 5 December 2026 · Based on stable v2.5.10

Part one: your first session with Clash Verge

Screen names follow the English interface of v2.5.10. Allow about ten minutes.

Step 1: Install

On the download page, choose the file for your system and processor. Windows users run setup.exe, Mac users drag the icon to Applications, and Linux users install the local package with apt or dnf. Start the program afterwards. You will see a menu down the left side and the Home screen in the main area.

Step 2: Prepare and import a profile

Clash Verge includes no profile, so this step cannot be skipped. Beginners should start with the simplest possible local profile to learn the flow:

  1. Select Profiles on the left, then New at the top right.
  2. Set the type to Local and give it any name, such as Practice.
  3. Save, right-click the new card, choose Edit File, paste the text below and save.
  4. Click the card once. A highlighted card is the active profile.
mixed-port: 7897
mode: rule

rules:
  - DOMAIN-SUFFIX,example.org,REJECT
  - MATCH,DIRECT

In plain words: requests to example.org and its subdomains are refused, and everything else connects directly. Your normal browsing is unchanged. The profile simply gives you something whose effect you can observe.

If your IT department has already issued a profile address, paste it into the box at the top of Profiles and choose Import. No new profile is needed.

Step 3: Turn on the system proxy switch

Go to Settings and switch on System Proxy in the system section. The operating system now points at port 7897 on your own machine, and requests from the browser and most apps begin passing through Clash Verge.

Leave TUN mode off for now. You need it only once you have confirmed that some program’s requests are missing from Connections. On Windows, install Service Mode on the same screen before enabling it.

Step 4: Check that the rule works

  1. In a browser, open any site you use regularly, then open example.org.
  2. Back in Clash Verge, open Connections and type the domain you just visited into the search box.
  3. The regular site should show the rule MATCH with target DIRECT. example.org should fail to load and leave a rejected entry on Logs.

Those two results prove the whole chain from profile to rule to effect. What remains is swapping the practice rule for the rules you actually need.

Step 5: Auto launch and a first backup

  • Auto Launch and Silent Start: switch both on in Settings and the program will sit in the tray each time you sign in.
  • WebDAV backup: enter a WebDAV address, user name and password under backup settings and press backup. After a new computer or a reinstall, the same details bring everything back.
Three mistakes beginners make most: forgetting to click the card after importing so the profile never becomes active; indenting YAML with tabs when spaces are required; and placing MATCH above other rules, so the rules below it are never reached.

Part two: six config patterns you can copy

Once the basics work, start from whichever pattern is closest to what you need.

Pattern 1: Switch between home and office profiles

When it applies: at the office your laptop needs rules for internal systems. At home those rules are pointless and may even slow things down while the unreachable company gateway times out.

What to do: stop trying to serve both places with one profile. Keep two on the Profiles screen, one named Office and one named Home, and click whichever matches where you are. The home profile can be tiny:

mixed-port: 7897
mode: rule

rules:
  - DOMAIN-SUFFIX,telemetry.example.net,REJECT
  - MATCH,DIRECT

Confirm it: the Home screen shows the name of the active profile. You can also switch from the tray menu without opening the main window.

Tip from experience: give both profiles the same port number, so the port already entered in browsers and developer tools never has to change.

Pattern 2: Send chosen programs to an internal package source

When it applies: the company hosts its own package registry and wants downloads by tools such as npm and pip to pass through the company gateway, without affecting browsers or other software.

proxies:
  - name: corp-gateway
    type: http
    server: proxy.corp.example.com
    port: 3128

rules:
  - PROCESS-NAME,node.exe,corp-gateway
  - PROCESS-NAME,python.exe,corp-gateway
  - PROCESS-NAME,git.exe,corp-gateway
  - MATCH,DIRECT

Watch out: per-program routing is dependable only with TUN mode on. Process names on macOS and Linux have no .exe, so write node, python3 and git.

Confirm it: run npm install once. The process column on Connections should show node.exe going to corp-gateway.

Pattern 3: Debug a phone’s API calls through your computer

When it applies: while testing a mobile app you want the phone’s requests to pass through your computer, where rules decide which ones go to a traffic inspector.

mixed-port: 7897
allow-lan: true
bind-address: "*"

proxies:
  - name: inspector
    type: http
    server: 127.0.0.1
    port: 8888

rules:
  - DOMAIN-SUFFIX,test.example.com,inspector
  - MATCH,DIRECT

On the phone: join the same Wi-Fi as the computer. In the Wi-Fi advanced settings set the HTTP proxy to manual, with the computer’s LAN IP as server and 7897 as port.

In Clash Verge: the Allow LAN switch in Settings is the same thing as allow-lan. After turning it on, also allow the port through the system firewall.

Security reminder: with LAN access on, any device on the same network can use the port. Enable it only on a network you trust, such as home or office, switch it off when you finish debugging, and never use it on public Wi-Fi.

Pattern 4: Choose between two gateways automatically

When it applies: the company has a gateway in each of two data centres and wants the faster one used automatically, with no manual switch when one fails.

proxies:
  - name: gateway-a
    type: socks5
    server: gw-a.corp.example.com
    port: 1080
  - name: gateway-b
    type: socks5
    server: gw-b.corp.example.com
    port: 1080

proxy-groups:
  - name: Internal
    type: url-test
    proxies: [gateway-a, gateway-b]
    url: http://portal.corp.example.com/ping
    interval: 300
    tolerance: 50

rules:
  - DOMAIN-SUFFIX,corp.example.com,Internal
  - MATCH,DIRECT

The parameters: interval: 300 runs a test every 300 seconds. tolerance: 50 means a candidate must be more than 50 milliseconds faster than the current outbound before a switch happens, which prevents flapping when the two are close.

Compared with fallback: url-test picks the fastest, while fallback picks the first one that is available, in order. Use fallback when there is a clear primary and standby.

Pattern 5: Prepend rules to a subscription with Script

When it applies: someone else maintains the profile. You only want a few rules of your own at the top, and you do not want to redo them after each subscription update.

On the Profiles screen open the global Script and enter:

function main(config) {
  const mine = [
    "DOMAIN-SUFFIX,dev.example.org,DIRECT",
    "DOMAIN,metrics.example.org,REJECT",
  ];
  config.rules = [...mine, ...(config.rules || [])];
  return config;
}

How it works: each time a profile loads, Clash Verge passes the parsed configuration object to main and uses whatever the function returns. Placing your rules at the front of the array guarantees they are matched first.

Confirm it: on the Rules screen your entries should be at the very top of the list.

Pattern 6: Maintain long domain lists as rule sets

When it applies: you have hundreds or thousands of domains to handle, and writing them all into the main profile would make it unreadable.

rule-providers:
  internal-sites:
    type: http
    behavior: domain
    format: text
    url: https://git.corp.example.com/raw/net/internal-sites.txt
    path: ./ruleset/internal-sites.txt
    interval: 43200

rules:
  - RULE-SET,internal-sites,DIRECT
  - MATCH,DIRECT

With format: text the list file holds one domain per line. A leading +. includes every subdomain, for example +.corp.example.com. interval: 43200 refreshes the list every 12 hours.

Our view: once you pass fifty rules, a rule set is worth it. The main profile keeps the policy, the list file keeps the names, and different people can look after each without getting in one another’s way.

Rule type cheat sheet

A rule has three parts: type, what to match, and target. These eight types cover everyday use.

Syntax follows the Mihomo configuration format and applies to the core bundled with Clash Verge v2.5.10.
TypeMatches onExample
DOMAINExact host nameDOMAIN,www.example.com,DIRECT
DOMAIN-SUFFIXDomain and its subdomainsDOMAIN-SUFFIX,example.com,DIRECT
DOMAIN-KEYWORDA string inside the domainDOMAIN-KEYWORD,telemetry,REJECT
IP-CIDRDestination IPv4 rangeIP-CIDR,192.168.0.0/16,DIRECT,no-resolve
IP-CIDR6Destination IPv6 rangeIP-CIDR6,fd00::/8,DIRECT,no-resolve
PROCESS-NAMEName of the requesting programPROCESS-NAME,git.exe,DIRECT
RULE-SETAn external rule setRULE-SET,internal-sites,DIRECT
MATCHAnything not matched aboveMATCH,DIRECT

When a rule does not apply: a checklist

  1. Did the request arrive? If Connections cannot find the domain, system proxy or TUN is off, or the program ignores system settings.
  2. What did it match? If it is listed with the wrong target, read the rule shown on that row. A broader rule higher up is the usual culprit.
  3. Did your rule load? Search for it on Rules. If it is missing, the active profile is not the one you edited, or a Script failed.
  4. Are old connections gone? After changing rules, close all connections on Connections and retry, because browsers reuse connections they already opened.
  5. Is the version current? v2.5.10 fixed the missing GLOBAL group in global mode among other things. Make sure you are not fighting a bug that is already fixed.

Pick a pattern and try it

Copy the snippet, put in your own domains and gateway addresses, and watch the result on Connections.