Complete FlClash Guide: Cross-Platform Clash Client from Zero to Hero
Table of Contents
- Introduction to FlClash and Core Architecture
- Installation and Initial Setup Across Platforms
- Configuring Profiles and Subscription Management
- Mastering Routing Rules and DNS Settings
- Enabling TUN Mode for Global Proxy
- Advanced Features: Overrides and Clash API
- Troubleshooting Common Issues
- Conclusion and Further Reading
Introduction to FlClash and Core Architecture
FlClash has rapidly emerged as a premier choice for users seeking a unified proxy experience. Built on the Flutter framework and powered by the mihomo core, it delivers a consistent interface across Windows, macOS, Linux, Android, and iOS. Unlike Tauri-based clients that rely on system webviews, Flutter ensures pixel-perfect consistency and smoother animations across all platforms. If you are evaluating your options, our Clash Verge Rev vs FlClash comparison provides a detailed architectural breakdown. This tutorial will take you from a complete beginner to an advanced user, focusing on practical configurations and real-world performance tuning.
Installation and Initial Setup Across Platforms
Installation varies slightly by operating system, but the core experience remains identical. FlClash handles the heavy lifting of bundling the mihomo core, meaning you do not need to manually download or configure the core binary.
Navigate to the official FlClash GitHub releases page. Select the appropriate package for your architecture. For desktop users, ensure you download the correct installer (e.g., .exe for Windows, .dmg for macOS, .AppImage for Linux).
Mobile deployments require specific permissions and installation methods. For mobile users, refer to our Clash for Android complete guide for detailed permission configurations, and our Clash for iOS setup guide for TestFlight or AltStore installation nuances.
Launch the application. On first run, FlClash will prompt you to grant necessary network and VPN permissions. Accept these to allow the mihomo core to bind to local ports and create virtual interfaces.
Configuring Profiles and Subscription Management
Managing subscriptions is the foundation of your proxy setup. FlClash handles profile updates automatically based on your configured intervals. You can import configurations via URL or local YAML files.
Always use the HTTPS protocol for your subscription URLs. FlClash caches profiles locally, but an initial fetch requires a working network connection. If your node provider blocks direct access, use the built-in proxy chain feature to fetch the subscription before applying it.
To add a subscription, navigate to the Profiles section and click the add icon. Paste your URL and set the update interval. The underlying YAML structure for a profile looks like this:
name: My Provider
url: https://provider.example.com/sub?token=xxxx
interval: 86400
health-check:
enable: true
interval: 600
url: https://www.gstatic.com/generate_204
FlClash will automatically parse this into the internal mihomo format, generating proxies, proxy-groups, and rules. You can also create local override profiles to merge with your main subscription, ensuring your custom rules survive automatic updates.
Mastering Routing Rules and DNS Settings
The DNS configuration dictates how your system resolves domain names, directly impacting bypass efficiency and leak prevention. FlClash exposes the full mihomo DNS capabilities through its advanced settings panel.
dns:
enable: true
listen: 0.0.0.0:1053
ipv6: false
enhanced-mode: fake-ip
fake-ip-range: 198.18.0.1/16
fake-ip-filter:
- '*.lan'
- localhost.ptlogin2.qq.com
default-nameserver:
- 223.5.5.5
- 119.29.29.29
nameserver:
- https://dns.alidns.com/dns-query
- https://doh.pub/dns-query
fallback:
- https://dns.cloudflare.com/dns-query
- https://dns.google/dns-query
fallback-filter:
geoip: true
geoip-code: CN
Using fake-ip mode significantly reduces DNS resolution latency by returning a dummy IP immediately. Ensure your fake-ip-filter includes all local network domains and critical authentication servers to prevent connection drops. Additionally, use nameserver-policy to route specific domains to dedicated DNS servers for maximum compatibility.
Enabling TUN Mode for Global Proxy
System proxy mode only intercepts browser and application traffic that respects system proxy settings. To capture all traffic, including non-HTTP protocols and stubborn applications, you must enable TUN mode.
TUN mode creates a virtual network interface. On Windows and macOS, this requires Administrator or Root privileges. On Linux, you must grant the CAP_NET_BIND_SERVICE and CAP_NET_ADMIN capabilities to the mihomo binary, or run the client as root.
In the FlClash settings, navigate to the TUN section and enable it. The underlying configuration injected into mihomo looks like this:
tun:
enable: true
stack: system
dns-hijack:
- any:53
auto-route: true
auto-detect-interface: true
If you experience network drops after enabling TUN, switch the stack parameter from system to gvisor or mixed, depending on your operating system compatibility. The mixed stack often provides the best balance of performance and stability on modern Linux kernels.
Advanced Features: Overrides and Clash API
FlClash supports advanced profile manipulation through JavaScript overrides. This is invaluable when your provider's subscription lacks specific routing rules or includes unwanted default configurations that conflict with your network environment.
Create a JS file in the FlClash overrides directory. A typical script to modify proxy groups and inject rules looks like this:
// Remove unwanted proxy groups
function main(params) {
params['proxy-groups'] = params['proxy-groups'].filter(
group => !group.name.includes('Unused')
);
// Add custom rules at the top
const customRules = [
'DOMAIN-SUFFIX,example.com,DIRECT',
'IP-CIDR,192.168.0.0/16,DIRECT'
];
params['rules'] = customRules.concat(params['rules']);
return params;
}
Link this script to your profile in the FlClash UI. The script executes locally before the configuration is passed to the mihomo core, ensuring your custom logic is always applied after an automatic subscription update. Furthermore, FlClash integrates seamlessly with the Clash RESTful API, allowing external tools like Yacd or MetaCubeX dashboards to control the core directly.
Troubleshooting Common Issues
Even with a robust client, misconfigurations occur. Here are solutions to the most frequent issues encountered during daily use.
Issue: TUN mode fails to start on Windows.
Solution: This is almost always a permissions issue. Ensure FlClash is set to run as administrator in the shortcut properties. Alternatively, install the mihomo service mode via the settings menu to run the core as a background Windows service, bypassing UAC prompts.
Issue: DNS leaks detected on testing websites.
Solution: Verify that ipv6: false is set in your DNS configuration if your ISP does not support IPv6. Additionally, ensure that your fallback DNS servers are correctly routed through a proxy group, not DIRECT, to prevent geographical IP exposure during resolution.
Issue: High CPU usage during idle.
Solution: Check your health-check interval. Setting it too low (e.g., 60 seconds) for a large number of nodes will cause constant background polling. Increase the interval to 600 or higher. Also, verify that no infinite loop rules exist in your routing configuration.
Conclusion and Further Reading
FlClash provides a powerful, unified interface for managing complex proxy configurations across all your devices. By mastering profile overrides, optimizing DNS settings, and correctly implementing TUN mode, you can build a resilient and high-performance network environment. For further exploration, consult the official mihomo documentation for advanced routing syntax, and continue refining your rulesets to match your specific privacy and performance requirements. The open-source community continues to push the boundaries of what is possible with Flutter and mihomo, making FlClash a future-proof choice for your networking needs.