It is recommended to use official pre-compiled deb packages for Debian or Ubuntu.
1
Review recommendations
Before installing ClickHouse, review the following recommendations:- Swap: Disable the operating system’s swap file in production environments.
- Disk space: The ClickHouse binary requires at least 2.5 GB of disk space for installation.
- Network: For distributed deployments (clustering), use at least 10 Gbit network connectivity. Network bandwidth is critical for processing distributed queries with large amounts of intermediate data, as well as for replication.
- Estimate data volume: Take a sample of your data and calculate the average row size, then multiply by the number of rows you plan to store.
- Apply the compression coefficient: Load a sample into ClickHouse and compare the original data size with the stored table size. Clickstream data, for example, is typically compressed 6-10x.
- Account for replicas: If you plan to store data in multiple replicas, multiply the estimated volume by the number of replicas.
2
Set up the Debian repository
To install ClickHouse run the following commands:- You can replace
stablewithltsto use different release kinds based on your needs. - You can download and install packages manually from packages.clickhouse.com.
Old distributions method for installing the deb-packages
Old distributions method for installing the deb-packages
3
Install ClickHouse server and client
4
Start ClickHouse
To start the ClickHouse server, run:5
Install standalone ClickHouse Keeper
To installclickhouse-keeper on standalone ClickHouse Keeper servers, run:6
Enable and start ClickHouse Keeper
Packages
The various deb packages available are detailed below:If you need to install a specific version of ClickHouse, you have to install all packages with the same version:
sudo apt-get install clickhouse-server=21.8.5.7 clickhouse-client=21.8.5.7 clickhouse-common-static=21.8.5.7