Skip to main content
This build guide is for contributors modifying ClickHouse itself.If you are not changing ClickHouse source code, you can install pre-built ClickHouse as described in Quick Start.
ClickHouse can be compiled on macOS x86_64 (Intel) and arm64 (Apple Silicon) using on macOS 10.15 (Catalina) or higher. As compiler, only Clang from homebrew is supported.

Install prerequisites

First, see the generic prerequisites documentation. Next, install Homebrew and run Then run:
Like llvm, Homebrew’s rustup is keg-only, so its bin directory is not added to PATH automatically. Export it the same way llvm’s PATH is exported in Build ClickHouse:
ClickHouse also pins the Rust toolchain used by the corrosion contrib module. Install and select it by following the Install the Rust compiler section of the Linux build guide. Without this, cmake fails at the corrosion contrib module with Cannot find nightly-<date> Rust toolchain.
Apple uses a case-insensitive file system by default. While this usually does not affect compilation (especially scratch makes will work), it can confuse file operations like git mv. For serious development on macOS, make sure that the source code is stored on a case-sensitive disk volume, e.g. see these instructions.

Build ClickHouse

To build you must use Homebrew’s Clang compiler:
Plain brew install llvm always installs Homebrew’s latest LLVM release, which can be newer than the Clang version pinned for CI and Linux builds (see Install the Clang compiler). A newer Clang can enable -Weverything diagnostics that aren’t yet suppressed in the build and fail under -Werror. If that happens, install the pinned major version instead, e.g. via a versioned formula (brew install llvm@<version>) if Homebrew still carries it, rather than disabling warnings.
If you are running into ld: archive member '/' not a mach-o file in ... errors during linking, you may need to use llvm-ar by setting flag -DCMAKE_AR=/opt/homebrew/opt/llvm/bin/llvm-ar.

Caveats

If you intend to run clickhouse-server, make sure to increase the system’s maxfiles variable.
You’ll need to use sudo.
To do so, create the /Library/LaunchDaemons/limit.maxfiles.plist file with the following content:
Give the file correct permissions:
Validate that the file is correct:
Load the file (or reboot):
To check if it’s working, use the ulimit -n or launchctl limit maxfiles commands.
Last modified on September 28, 2026