Introduction · Clash documentation

Getting Started

To run the Clash core on its own, download a prebuilt binary or compile from source with Go. Choose a build for your device, then check GOPATH, the running version, and GOOS and GOARCH for cross-compilation.

  • Golang
  • Precompiled binaries
  • GOPATH
  • Cross-compilation
  • GOARCH
Introduction
On this page

Scope of this historical document

This document preserves historical instructions for original Clash / Clash Premium to help interpret older configurations. References to “Premium only”, unsupported features, or platform limits do not describe current Mihomo capabilities. Do not use them to overwrite your current client configuration or run permission-related commands.

For Mihomo, consult current Mihomo configuration documentation. For the graphical interface, installation, and permissions, follow the documentation for your specific client.

To start using Clash, either build it from source or download a precompiled binary.

Use a precompiled binary

You can download the Clash core binaries here: Clash Premium information

Build from source

You can build Clash on your device with Golang 1.19+:

shell
$ go install github.com/Dreamacro/clash@latest
go: downloading github.com/Dreamacro/clash v1.15.1

The binaries will be built in the $GOPATH/bin directory:

shell
$ $GOPATH/bin/clash -v
Clash unknown version darwin arm64 with go1.20.3 unknown time

Cross-platform/OS builds

Golang supports cross-compilation, so you can build Clash for devices with different architectures or operating systems. You can use make to build them easily, for example:

shell
$ git clone --depth 1 https://github.com/Dreamacro/clash
Cloning into 'clash'...
remote: Enumerating objects: 359, done.
remote: Counting objects: 100% (359/359), done.
remote: Compressing objects: 100% (325/325), done.
remote: Total 359 (delta 25), reused 232 (delta 17), pack-reused 0
Receiving objects: 100% (359/359), 248.99 KiB | 1.63 MiB/s, done.
Resolving deltas: 100% (25/25), done.
$ cd clash && make darwin-arm64
fatal: No names found, cannot describe anything.
GOARCH=arm64 GOOS=darwin CGO_ENABLED=0 go build -trimpath -ldflags '-X "github.com/Dreamacro/clash/constant.Version=unknown version" -X "github.com/Dreamacro/clash/constant.BuildTime=Mon May  8 16:47:10 UTC 2023" -w -s -buildid=' -o bin/clash-darwin-arm64
$ file bin/clash-darwin-arm64
bin/clash-darwin-arm64: Mach-O 64-bit executable arm64

For other build targets, see this site's cross-compilation guide.