Install ClickHouse
You need a Linux or macOS machine with curl installed. To skip local installation entirely, start a Cloud service instead — it requires no install step.
Install with one command#
Run the install script. It detects your OS and CPU architecture and downloads the matching build:
curl https://clickhouse.com/ | shOn Linux and macOS this also installs clickhousectl, the ClickHouse CLI, into ~/.local/bin with a chctl alias. To download only the clickhouse binary:
curl https://clickhouse.com/ | CLICKHOUSE_ONLY=1 shRun the binary with no arguments to start clickhouse-local, which needs no configuration and stores data in a temporary directory:
./clickhouseTables created in clickhouse-local disappear when it exits. Use it to query files and test SQL, not to store data.
Start a full server. It stores data in the current directory, so the data survives a restart:
./clickhouse serverTo start the server with a configuration file, pass -C:
./clickhouse server -C config.xmlIn a second terminal, connect to the running server:
./clickhouse clientThe client reports the version it connected to and opens a prompt:
ClickHouse client version 24.5.1.117 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 24.5.1.
local-host :)A prompt means the installation works.
Run in Docker#
Pull the official image and start a container. The --ulimit nofile setting raises the open-file limit, which ClickHouse needs for its column files:
docker pull clickhouse/clickhouse-serverdocker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-serverConnect the native client to the running container:
docker exec -it some-clickhouse-server clickhouse-clientTo reach the container from your host, publish the ports and set a password. The default user has no network access until a password is set:
docker run -d -p 18123:8123 -p 19000:9000 -e CLICKHOUSE_PASSWORD=changeme \
--name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse/clickhouse-serverecho 'SELECT version()' | curl 'http://localhost:18123/?password=changeme' --data-binary @-Image tags and CPU requirements#
latest tracks the newest release of the latest stable branch. A branch tag such as 22.2 tracks the newest release on that branch, and a full version such as 22.2.3.5 pins an exact release. Add -alpine for the smaller Alpine-based variant.
The amd64 image requires an x86-64-v3 CPU (AVX2, BMI1, BMI2, F16C, FMA, LZCNT, MOVBE, XSAVE) — virtually all x86 CPUs released after 2015. The arm64 image requires ARMv8.2-A with Load-Acquire RCpc, which covers AWS Graviton 2 and later, Azure, and GCP, but not Raspberry Pi 4 or Jetson AGX Xavier. Since version 24.11 the Ubuntu-based images require Docker 20.10.10 or newer.
Connect to ClickHouse Cloud#
The same client connects to a Cloud service over the secure native port, 9440. Both --secure and the port are required:
./clickhouse client \
--host $CLICKHOUSE_HOST \
--port 9440 \
--user $CLICKHOUSE_USER \
--password $CLICKHOUSE_PASSWORD \
--secure \
-q "SELECT 1"Production installation#
For a server you intend to keep running, install from a package rather than the standalone binary: Debian and Ubuntu .deb packages, RedHat .rpm packages, NixOS, or a source build. Packages register a service, create a system user, and place configuration under /etc/clickhouse-server.
Next steps#
- Create your first table — write a MergeTree table and query it
- Why ClickHouse is fast — what the engine does with the data you insert
- Self-hosting vs Cloud — what running this yourself involves at scale