How to Build ClickHouse on Mac OS X

Build should work on Mac OS X 10.15 (Catalina)

Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL"

Install Required Compilers, Tools, and Libraries

$ brew install cmake ninja libtool gettext

Checkout ClickHouse Sources

$ git clone --recursive [email protected]:ClickHouse/ClickHouse.git


$ git clone --recursive

$ cd ClickHouse

Build ClickHouse

$ mkdir build
$ cd build
$ cmake .. -DCMAKE_CXX_COMPILER=`which clang++` -DCMAKE_C_COMPILER=`which clang`
$ ninja
$ cd ..


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 following file:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
<plist version="1.0">

Execute the following command:

$ sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist


To check if it’s working, you can use ulimit -n command.