Skip to content
Edit this page

Quick Start

This guide helps you install ClashRS, write a minimal working configuration, and verify that traffic is flowing.

Installation

Download the release archive for your operating system and architecture from GitHub Releases.

On Linux/macOS, make the binary executable:

chmod +x clash-rs
./clash-rs -v

Windows TUN requirement

To use TUN on Windows with a standard build, place the architecture-matching wintun.dll in the same directory as clash-rs.exe and run as Administrator. Alternatively, build with --features wintun-embed (Windows MSVC) to embed Wintun inside the executable.

Official container images are published to GitHub Container Registry:

docker run -d \
  --name clash-rs \
  --restart unless-stopped \
  -p 7890:7890 \
  -p 9090:9090 \
  -v /path/to/clash-config:/etc/clash \
  ghcr.io/watfaq/clash-rs:latest \
  -d /etc/clash -c config.yaml

If you enable TUN inside Docker on Linux, also pass --cap-add NET_ADMIN --device /dev/net/tun.

Prerequisites

  • Rust toolchain (Edition 2024)
  • cmake (3.29 or newer)
  • libclang (LLVM)
  • protoc (Protocol Buffers compiler for GeoData code generation)
  • nasm (Windows only)

Compile

git clone https://github.com/Watfaq/clash-rs.git
cd clash-rs

# Standard release build (default features: standard, aws-lc-rs, dashboard)
cargo build --release

# Plus build (includes Tor / onion support)
cargo build --release --features plus

# Build with static Naive/Cronet support
cargo build --locked --release -p clash-rs --features naive-static,naive-download

Cargo Feature Bundles

Feature Included Capabilities
default (clash-bin) standard, aws-lc-rs, dashboard
standard shadowsocks, tuic, ssh, shadowquic, wireguard, tailscale, zero_copy, tproxy, tun, redir
plus Everything in standard plus onion (Tor)
naive / naive-static / naive-download Naive outbound (Cronet-based); not enabled by default
wintun-embed Embeds wintun.dll in Windows MSVC builds
telemetry OpenTelemetry / Jaeger tracing export

Minimal Configuration

Create a working directory and save config.yaml:

mixed-port: 7890
allow-lan: false
mode: rule
log-level: info
external-controller: 127.0.0.1:9090

proxies:
  - name: demo-ss
    type: ss
    server: proxy.example.com
    port: 8388
    cipher: 2022-blake3-aes-128-gcm
    password: "YOUR_BASE64_PASSWORD"
    udp: true

proxy-groups:
  - name: PROXY
    type: select
    proxies:
      - demo-ss
      - DIRECT

rules:
  - DOMAIN-SUFFIX,example.com,PROXY
  - MATCH,DIRECT

Auto-generated bootstrap config

Outside --service-mode, if the specified config file does not exist, ClashRS automatically creates a starter file containing port: 7890.

Validate and Run

  1. Test your configuration before starting:

    clash-rs -d ./clash-data -c config.yaml -t
    

    Use --strict-config alongside -t if you want unknown YAML keys rejected instead of silently ignored:

    clash-rs -d ./clash-data -c config.yaml -t --strict-config
    
  2. Start ClashRS:

    clash-rs -d ./clash-data -c config.yaml
    
  3. Verify proxy connectivity:

    curl -x http://127.0.0.1:7890 https://example.com
    
  4. Open the built-in Web Dashboard:

    When external-controller is set and the binary is compiled with the default dashboard feature, open http://127.0.0.1:9090/ui/ in your browser.

Next Steps