Installation

System Requirements

ClickHouse can run on any Linux, FreeBSD, or Mac OS X with x86_64, AArch64, or PowerPC64LE CPU architecture.

Official pre-built binaries are typically compiled for x86_64 and leverage SSE 4.2 instruction set, so unless otherwise stated usage of CPU that supports it becomes an additional system requirement. Here’s the command to check if current CPU has support for SSE 4.2:

From Tgz Archives

It is recommended to use official pre-compiled tgz archives for all Linux distributions, where installation of deb or rpm packages is not possible.

The required version can be downloaded with curl or wget from repository https://repo.yandex.ru/clickhouse/tgz/. After that downloaded archives should be unpacked and installed with installation scripts. Example for the latest version:

From Docker Image

To run ClickHouse inside Docker follow the guide on Docker Hub. Those images use official deb packages inside.

From Sources

To manually compile ClickHouse, follow the instructions for Linux or Mac OS X.

You can compile packages and install them or use programs without installing packages. Also by building manually you can disable SSE 4.2 requirement or build for AArch64 CPUs.

Client: programs/clickhouse-client Server: programs/clickhouse-server

You’ll need to create a data and metadata folders and chown them for the desired user. Their paths can be changed in server config (src/programs/server/config.xml), by default they are:

/opt/clickhouse/data/default/ /opt/clickhouse/metadata/default/

On Gentoo, you can just use emerge clickhouse to install ClickHouse from sources.

Launch

To start the server as a daemon, run:

$ sudo service clickhouse-server start

If you don’t have service command, run as

$ sudo /etc/init.d/clickhouse-server start

See the logs in the /var/log/clickhouse-server/ directory.

If the server doesn’t start, check the configurations in the file /etc/clickhouse-server/config.xml.

You can also manually launch the server from the console:

$ clickhouse-server --config-file=/etc/clickhouse-server/config.xml

In this case, the log will be printed to the console, which is convenient during development. If the configuration file is in the current directory, you don’t need to specify the --config-file parameter. By default, it uses ./config.xml.

ClickHouse supports access restriction settings. They are located in the users.xml file (next to config.xml). By default, access is allowed from anywhere for the default user, without a password. See user/default/networks. For more information, see the section “Configuration Files”.

After launching server, you can use the command-line client to connect to it:

$ clickhouse-client

By default, it connects to localhost:9000 on behalf of the user default without a password. It can also be used to connect to a remote server using --host argument.