Tutorial Center
Setup Clash in 5 Minutes – Visual Guide for All Platforms
From installation to intelligent split tunneling, we'll walk you through all Clash configurations. Supports Windows, macOS, Android, iOS, Linux, and Mihomo Core / CLI server deployment. Easy for beginners and advanced users alike.
Complete Clash Setup in Three Steps
The core process is the same regardless of your platform. Platform-specific tutorials below provide more detailed visual instructions.
Download & Install Client
Choose the Clash GUI client for your operating system. For Windows, we recommend Clash Verge Rev or FlClash (both actively maintained and free); for macOS, Clash Verge Rev or FlClash (both support Apple Silicon and Intel); for Linux, Clash Verge Rev (.deb / .rpm / AUR) or FlClash (.deb, amd64); for Android, FlClash (arm64, Material Design 3), Clash Meta for Android (universal APK, all-arch), or Surfboard (lightweight Material You); for iOS, Stash or Shadowrocket; and for servers / NAS / routers / Docker without a GUI, use Mihomo Core (command-line binary).
Go to Download PageImport Provider Subscription
Obtain a Clash-format subscription URL from your provider. Copy and paste it into the "Config" or "Subscription" page of the client, then click Update. The client will automatically parse nodes and split-tunneling rules—no manual YAML editing required.
Select Node & Enable Proxy
Choose a low-latency proxy node from the list and enable "System Proxy" (lightweight) or "TUN Mode" (global transparent proxy). Clash will automatically split traffic—high-speed local connections and proxied international access with seamless switching.
Download & Install a Windows Client
Go to the Download Page. Two actively maintained free clients are available for Windows:
Clash Verge Rev
Built on Tauri, modern UI with low resource usage. The most actively recommended Clash client in the community. Supports both x64 and ARM64.
- Most users:
Clash%20Verge_2.4.7_x64-setup.exe(most desktops/laptops) - ARM devices (Surface Pro X etc.):
clash-verge-rev-win-arm64.exe
FlClash
Flutter-based cross-platform client with Material Design 3 UI, covering Windows, macOS, Android, and Linux from a single codebase. Great for multi-device users.
- Download
FlClash-0.8.93-windows-amd64-setup.exe(x64 only; ARM64 users should choose Clash Verge Rev)
Import Provider Subscription
Open Clash Verge Rev. Click "Profiles" in the left navigation bar, then:
- Click "New" or the input box in the top right
- Paste the Clash subscription URL provided by your service
- Click "Import" or press Enter
- Wait for the download to complete; the configuration will appear in the list
- Click "Use this profile" on the right side of the configuration to activate it
https://your-airport.com/api/v1/client/subscribe?token=xxxxxxxx&flag=clash
View & Select Proxy Nodes
Click "Proxies" in the left navigation to see all available nodes and policy groups:
- Click any policy group (e.g., "Proxy") and choose a low-latency node from the list
- Click the lightning bolt icon on the right for a manual speed test to see real-time latency
- The "Auto Select" policy will automatically switch to the best node based on latency—ideal for users who prefer zero manual management
Enable System Proxy
Find the "System Proxy" switch in the top right of Clash Verge Rev and click to turn it on (it will turn blue).
- System Proxy mode automatically configures Windows settings, taking effect immediately for browsers and other apps that support system proxies
- By default, Clash listens on
127.0.0.1:7890(HTTP) and127.0.0.1:7891(SOCKS5) - Verify: Visit google.com in your browser; if it opens, you're all set
Enable TUN Mode (Global Transparent Proxy)
TUN mode proxies all traffic, including games and CLI tools that don't support system proxies. Recommended for advanced users:
- In the Clash Verge Rev Settings page, find and enable the "TUN Mode" switch
- A Windows UAC prompt will appear; click "Yes" to grant administrator privileges (required for the virtual network interface)
- Once TUN Mode is active, you can turn off the System Proxy switch; TUN will handle all traffic
Windows Usage FAQ
PROCESS-NAME,xxx.exe,DIRECT rule to the `rules` section of your YAML configuration, or manually add a direct rule in the client's proxy rules page.Download & Install a macOS Client
Go to the Download Page. Two actively maintained free clients are available for macOS:
Clash Verge Rev
Built on Tauri, modern UI with low resource usage. The most actively recommended Clash client in the community, also supports Linux.
- M1 / M2 / M3 / M4 Macs:
Clash%20Verge_2.4.7_aarch64.dmg - Intel Macs (Pre-2020):
Clash%20Verge_2.4.7_x64.dmg
FlClash
Flutter-based cross-platform client with Material Design 3 UI, covering Windows, macOS, Android, and Linux from a single codebase. Great for multi-device users.
- M1 / M2 / M3 / M4 Macs:
FlClash-0.8.93-macos-arm64.dmg - Intel Macs (Pre-2020):
FlClash-0.8.93-macos-amd64.dmg
.dmg file and drag the app icon into the Applications folder. Both clients share the same workflow for importing subscriptions and enabling the proxy—this tutorial uses Clash Verge Rev as the reference.Bypass macOS Gatekeeper Restrictions
When first opening your client, macOS may say "Cannot be opened because the developer cannot be verified." This is normal for open-source apps (both Clash Verge Rev and FlClash are unsigned by Apple). There are two ways to resolve this:
Allow via System Settings
- Open "System Settings" → "Privacy & Security"
- Scroll down to find the blocked app prompt
- Click "Open Anyway" and enter your password to confirm
Terminal Command Method
Open Terminal and run the command for your chosen client:
sudo xattr -r -d com.apple.quarantine /Applications/ClashVergeRev.app
sudo xattr -r -d com.apple.quarantine /Applications/FlClash.app
Import Provider Subscription
Open Clash Verge Rev. Click "Profiles" in the left navigation bar:
- Click the "New" button
- Paste your provider's subscription URL into the input box
- (Optional) Enter a name to help distinguish multiple subscriptions
- Click "Import" and wait for the file to download
- Click the profile to set it as active
Select Node & Enable System Proxy
After selecting a node on the "Proxies" page, turn on the "System Proxy" switch in the top right:
- macOS will prompt for network permissions; click "OK" to authorize
- Clash Verge Rev will automatically configure macOS proxy settings, taking effect immediately for Safari, Chrome, and other browsers
- A Clash status icon will appear in the menu bar for quick node switching
google.com in your browser. If it loads, you're all set.Enable Enhanced Mode (TUN)
To proxy all traffic (including CLI tools and games that don't support system proxies), enable Enhanced Mode:
- Find "TUN Mode" or "Enhanced Mode" in Settings
- Enable it; you may be asked to install a system extension (confirm with your password)
- Allow the system extension in "Privacy & Security"
- Restart Clash Verge Rev for TUN mode to take effect
macOS Usage FAQ
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890Download & Install Android Client APK
Go to the Download Page. Three recommended Android clients are available:
- FlClash (Recommended): Download
FlClash-0.8.93-android-arm64-v8a.apk— ideal for most modern phones (2016 and later), Material Design 3 UI, cross-platform consistency across Windows / macOS / Android / Linux - Clash Meta for Android / CMFA (Universal): Download the universal APK — compatible with ARM64, ARMv7, and x86_64. Best if you're unsure of your device's architecture
- Surfboard (Lightweight): Download the universal APK — Material You design, fully compatible with Clash YAML subscriptions, ideal for users who prefer a lightweight experience
Import Subscription Configuration
Open the app (FlClash / CMFA / Surfboard) and click "Profiles" in the bottom navigation:
- Click the "+" button in the top right and select "URL"
- Enter a name in the label field and paste your provider's link into the URL field
- Click the save icon in the top right, then click "Update" to download
- Once downloaded, click the dot next to the profile name to set it as active
Select Node & Start Proxy
- Click "Proxies" in the bottom navigation to view and select nodes in the policy groups
- Click the speed test icon next to a node to check latency; choose a low-latency node
- Return to the home screen and click the large "Stopped" button (Play icon)
- A VPN connection authorization prompt will appear; click "OK"
- The status will change to "Running," and a VPN icon will appear in the notification bar
Configure TUN Mode (Global Proxy)
FlClash and CMFA use the Android VPN API by default, achieving global proxy effects similar to TUN without extra config. For finer control:
- Customize proxy mode (Rule/Global/Direct) in "Settings → Override"
- We recommend enabling "Bypass private networks" to keep local traffic off the proxy
- Set which apps use the proxy in "Settings → Access Control" (per-app filtering); Surfboard users can configure this in the "App Proxy" section
Android Usage FAQ
Switch to a non-CN Apple ID & Purchase
- Open the App Store, click your avatar in the top right, scroll to the bottom, and click "Sign Out"
- Sign in with a US or HK Apple ID (you can borrow one or register your own)
- Search for "Stash" or "Shadowrocket," purchase, and download
- After downloading, you can switch back to your original Apple ID; the purchased app will remain
Import Subscription in Stash
- Open Stash and click "Home" at the bottom
- Click "Add Configuration File" → "Download from URL"
- Paste your Clash subscription URL and click "Download"
- The profile will automatically become active once downloaded
- Select a node on the "Policy Groups" page or use Auto Select
Import Subscription in Shadowrocket
- Open Shadowrocket and click the "+" icon in the top right
- For "Type," select "Subscribe"
- Paste your provider's subscription URL and add a label
- Click "Done" in the top right and wait for the nodes to load
- Choose a low-latency node from the list
Start Proxy
After importing and selecting a node, toggle the switch next to "Not Connected" on the home screen:
- iOS will prompt "Shadowrocket Would Like to Add VPN Configurations"; click "Allow" and confirm with Face ID or your passcode
- The status will change to "Connected," and a VPN icon will appear in the status bar
- Verify: Visit google.com in Safari to ensure it's working correctly
iOS Usage FAQ
?flag=clash to the end of the URL.Download & Install a Linux Client
Go to the Download Page. Two actively maintained free clients are available for Linux:
Clash Verge Rev
Built on Tauri — the most feature-complete Linux GUI client. Provides .deb, .rpm, and AUR packages, covering all major distros.
- Ubuntu / Debian: Download
Clash%20Verge_2.4.7_amd64.deb - Fedora / RHEL / openSUSE: Download
Clash%20Verge-2.4.7-1.x86_64.rpm - Arch Linux / Manjaro (AUR): See commands below
sudo apt install ./Clash%20Verge_2.4.7_amd64.deb
sudo rpm -i Clash%20Verge-2.4.7-1.x86_64.rpm
paru -S clash-verge-rev
# Or use yay
yay -S clash-verge-rev
FlClash
Flutter-based cross-platform client with Material Design 3 UI, covering Windows, macOS, Android, and Linux. Great for multi-device users.
- Ubuntu / Debian (amd64): Download
FlClash-0.8.93-linux-amd64.deb - RPM-based distros (Fedora / RHEL) or ARM users: choose Clash Verge Rev
sudo apt install ./FlClash-0.8.93-linux-amd64.deb
Import Subscription Configuration
Operations are identical to the Windows and macOS versions:
- Open Clash Verge Rev (or FlClash) and go to the "Profiles" page
- Click "New" and paste your provider's subscription URL
- Click "Import" and wait for the download to complete
- Click the profile to set it as active
Enable Proxy
Clash on Linux offers two proxy methods:
System Proxy (GNOME / KDE)
Enable "System Proxy" in Clash Verge Rev or FlClash to automatically configure GNOME or KDE desktop settings.
Terminal Environment Variable Method
export http_proxy="http://127.0.0.1:7890"
export https_proxy="http://127.0.0.1:7890"
export all_proxy="socks5://127.0.0.1:7891"
You can also enable TUN Mode for global transparent proxying (requires root). Find the TUN option in settings and toggle it on.
Linux Usage FAQ
gnome-settings-daemon is installed; KDE users should check proxy settings in System Settings. Some distros require manual proxy configuration in network settings: host 127.0.0.1, port 7890.~/.config/autostart/clash-verge-rev.desktop autostart file pointing to the client executable path.WAYLAND_DISPLAY="" before launching to force XWayland mode. FlClash, being Flutter-based, generally has better Wayland compatibility.Download the Mihomo Core Binary
Go to the Download Page → Core / CLI and choose the binary for your target OS and architecture:
- Linux x86_64 server / VPS / NAS: Download
mihomo-linux-amd64.gz(compressed) ormihomo-linux-amd64.deb(Debian/Ubuntu package — recommended) - Linux ARM64 (Raspberry Pi, ARM servers): Download
mihomo-linux-arm64.gzfrom GitHub Releases - Windows x64: Download
mihomo-windows-amd64.zip
Prepare the Clash Config File
Mihomo is driven by a single YAML configuration file (config.yaml). There are two ways to get one:
Download Subscription as config.yaml
Use curl or wget to download your provider's Clash subscription directly as config.yaml — the fastest approach.
mkdir -p ~/.config/mihomo
curl -L "https://your-airport.com/api/v1/client/subscribe?token=xxxx&flag=clash" \
-o ~/.config/mihomo/config.yaml
Write a Minimal Config Manually
For building from scratch, here is a minimal working config.yaml:
mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
external-controller: 127.0.0.1:9090
dns:
enable: true
enhanced-mode: fake-ip
nameserver:
- 8.8.8.8
- 1.1.1.1
proxies:
- name: "my-node"
type: vmess
server: example.com
port: 443
uuid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
alterId: 0
cipher: auto
tls: true
proxy-groups:
- name: "Proxy"
type: select
proxies: ["my-node", "DIRECT"]
rules:
- MATCH,Proxy
~/.config/mihomo/; on Windows it is %USERPROFILE%\.config\mihomo\. You can also specify a custom directory with the -d <dir> flag.Linux — Install via .deb and Register systemd Service (Recommended)
Installing via the .deb package on Debian / Ubuntu automatically registers a systemd service with startup and process supervision:
# Install the .deb package (auto-registers systemd service)
sudo apt install ./mihomo-linux-amd64.deb
# Place your config file in the service directory
sudo mkdir -p /etc/mihomo
sudo cp ~/.config/mihomo/config.yaml /etc/mihomo/config.yaml
# Enable and start the mihomo service
sudo systemctl enable --now mihomo
# Check status
systemctl status mihomo
# Follow logs in real time
journalctl -u mihomo -f
# Stop the service
sudo systemctl stop mihomo
# Restart after config changes
sudo systemctl restart mihomo
# Disable autostart
sudo systemctl disable mihomo
# View last 100 log lines
journalctl -u mihomo -n 100
/etc/mihomo/ and the systemd unit file is at /etc/systemd/system/mihomo.service. Run sudo systemctl restart mihomo after any config change.Linux — Standalone Binary (.gz)
If you prefer not to use the .deb package, extract the compressed binary and run it directly:
# Extract and make executable
gunzip mihomo-linux-amd64.gz
chmod +x mihomo-linux-amd64
sudo mv mihomo-linux-amd64 /usr/local/bin/mihomo
# Create config directory
mkdir -p ~/.config/mihomo
# (Place config.yaml in ~/.config/mihomo/)
# Run in foreground (for debugging)
mihomo -d ~/.config/mihomo
# Run in background
nohup mihomo -d ~/.config/mihomo > ~/.config/mihomo/mihomo.log 2>&1 &
echo $! > ~/.config/mihomo/mihomo.pid
To create a systemd unit manually (when not using .deb):
[Unit]
Description=Mihomo Clash Meta Service
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/mihomo -d /etc/mihomo
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now mihomo
Windows — Run Mihomo via PowerShell
On Windows, run Mihomo through PowerShell directly or register a Task Scheduler task for auto-start:
# Extract the zip archive
Expand-Archive mihomo-windows-amd64.zip -DestinationPath .\mihomo
# Enter directory
cd .\mihomo
# Create config directory and place config.yaml there
New-Item -ItemType Directory -Force "$env:USERPROFILE\.config\mihomo"
# Run in foreground
.\mihomo.exe -d "$env:USERPROFILE\.config\mihomo"
Register as a Task Scheduler task for auto-start at login:
$action = New-ScheduledTaskAction `
-Execute "C:\path\to\mihomo.exe" `
-Argument "-d `"$env:USERPROFILE\.config\mihomo`""
$trigger = New-ScheduledTaskTrigger -AtLogOn
$settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit 0
Register-ScheduledTask -TaskName "Mihomo" `
-Action $action -Trigger $trigger `
-Settings $settings -RunLevel Highest -Force
Docker Container Deployment
Docker is the cleanest way to deploy Mihomo on a server — no manual dependency management required:
services:
mihomo:
image: metacubex/mihomo:latest
container_name: mihomo
restart: unless-stopped
network_mode: host # Required for TUN mode
cap_add:
- NET_ADMIN # Required for TUN mode
devices:
- /dev/net/tun:/dev/net/tun
volumes:
- ./config:/root/.config/mihomo # Mount config directory
environment:
- TZ=UTC
# Place config.yaml in ./config/ then start
docker compose up -d
# Follow logs
docker compose logs -f mihomo
# Update image and restart
docker compose pull && docker compose up -d
# Stop and remove container
docker compose down
cap_add, devices, and network_mode: host, and use standard port mapping instead (ports: - "7890:7890" - "9090:9090") for better container isolation.Using the Web Dashboard
Mihomo has a built-in RESTful API. Use an open-source web dashboard to monitor traffic, switch nodes, and view connections in real time—no command line needed.
First, make sure the external controller is enabled in your config:
external-controller: 127.0.0.1:9090 # Change to 0.0.0.0:9090 for remote access
secret: "your-secret-key" # API secret (always set one for remote access!)
# Optional: embed dashboard locally
external-ui: ui
external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip"
After starting Mihomo, open any of the following dashboards in a browser and enter your controller address and secret:
- MetaCubeXD (recommended): d.metacubex.one
- Yacd-meta: yacd.metacubex.one
- Local embedded dashboard (after setting external-ui):
http://127.0.0.1:9090/ui
external-controller to 0.0.0.0:9090 for public access, always set a strong secret. Anyone with access to the port will be able to control your proxy nodes otherwise.Core / CLI Common Questions
?flag=clash to the URL); ③ file encoding is not UTF-8. Run mihomo -t -d ~/.config/mihomo to validate the config without starting the service.mixed-port in config.yaml to another available port (e.g. 7892). Or find the conflicting process: on Linux run lsof -i :7890; on Windows run netstat -ano | findstr 7890, then terminate the conflict before restarting Mihomo.allow-lan: true in config.yaml and ensure the firewall allows the mixed-port on your LAN. Other devices configure their HTTP proxy to the Mihomo host's LAN IP (e.g. 192.168.1.100:7890). No need to install Clash on every device.proxy-providers in config.yaml with the subscription URL and an interval in seconds — Mihomo will refresh the node list in the background automatically without restarting. Alternatively, use a cron job to re-download config.yaml and hot-reload via the API: curl -X PUT http://127.0.0.1:9090/configs?force=true -d '{"path":"/etc/mihomo/config.yaml"}'Advanced Clash Usage Tips
Master these tips to unlock powerful features and meet personalized proxy needs.
DNS Leak Prevention
Set enhanced-mode: fake-ip in the dns field of your YAML config, and configure DoH (https://8.8.8.8/dns-query) or DoT as a fallback DNS to prevent DNS queries from leaking your real IP.
dns:
enable: true
enhanced-mode: fake-ip
nameserver:
- 114.114.114.114
- 223.5.5.5
fallback:
- https://8.8.8.8/dns-query
- https://1.1.1.1/dns-query
Rule Provider Subscriptions
Use Rule Provider to subscribe to remote rule sets, keeping them automatically updated. Clash Meta supports multiple formats like DOMAIN and IPCIDR.
rule-providers:
reject:
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt"
interval: 86400
Proxy Group Configuration
Implement advanced traffic scheduling with Proxy Groups: url-test for auto-selection of lowest latency nodes, fallback for auto-failover, and load-balance for multi-node load balancing.
proxy-groups:
- name: "Auto"
type: url-test
proxies: [Node-HK, Node-US, Node-JP]
url: http://www.gstatic.com/generate_204
interval: 300
External Control Panel (Dashboard)
Clash Meta features a built-in RESTful API for real-time traffic monitoring and node management via a web panel. Visit d.metacubex.one and enter your controller address (default 127.0.0.1:9090) and secret.
Usage Tutorial FAQ
A compilation of the most common configuration and usage issues to help you troubleshoot quickly.
ifconfig.me to see if the IP matches your proxy node's region. You can also monitor active connections in the Clash "Connections" tab.allow-lan: true in your config and ensure your firewall allows access to port 7890. Other devices can then point their HTTP/HTTPS proxy settings to your device's local IP (e.g., 192.168.1.100:7890).Free Clash Download – Start Configuring Now
Supports Windows, macOS, Linux, Android, and iOS. Completely free and open-source. Complete your setup in 5 minutes with our guide and experience high-speed intelligent proxying.