Deploying ClickHouse
Hardware and Software Requirements
Hardware specifications are described in the ClickHouse hardware requirements section. The list of software requirements can be found in the corresponding Software requirements section.
Installation Options Overview
The official ClickHouse documentation recommends the following installation methods:
- via
debpackages for Debian/Ubuntu - via the
rpmrepository for RedHat-like systems - from
tgzarchives for Linux distributions
Adapted instructions are provided below for:
- Debian / Ubuntu
- RedHat / CentOS and other rpm-based distributions
- Linux distributions (installation from
tgzarchives)
In all cases, it is separately described how to view available versions and select the required one.
Installation on Debian / Ubuntu from the Official Repository
Adding the ClickHouse Repository
# Prerequisite packages
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg
# Download the ClickHouse GPG key and save it to the keyring
curl -fsSL 'https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key' | sudo gpg --dearmor -o /usr/share/keyrings/clickhouse-keyring.gpg
# Determine the system architecture
ARCH=$(dpkg --print-architecture)
# Add the ClickHouse repository (stable branch)
echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg arch=${ARCH}] https://packages.clickhouse.com/deb stable main" | sudo tee /etc/apt/sources.list.d/clickhouse.list
# Update the package list
sudo apt-get update
If necessary, you can replace stable with lts to use the LTS release line. The current list of releases and their types (LTS, fast, etc.) is available in the ClickHouse changelog.
Viewing Available ClickHouse Versions (Debian / Ubuntu)
After adding the repository, you can list the available versions of the package using the following commands:
apt-cache madison clickhouse-server
or:
apt-cache policy clickhouse-server
The output will show several lines with versions; select the desired version (e.g., 25.7.4.11 or a newer LTS/Stable version).
For correct operation, it is recommended to install all main packages with the same version: clickhouse-common-static, clickhouse-server, clickhouse-client. When installing a specific version, it must be specified for all these packages.
Installing a Specific ClickHouse Version (Debian / Ubuntu)
After selecting the version, set it in the VERSION variable:
export VERSION=25.7.4.11
Install the packages for this version using the following command:
sudo apt-get install -y clickhouse-common-static=${VERSION} clickhouse-server=${VERSION} clickhouse-client=${VERSION}
Alternatively, you can specify the version directly in the command without using a variable:
sudo apt-get install clickhouse-server=25.7.4.11 clickhouse-client=25.7.4.11 clickhouse-common-static=25.7.4.11
Starting ClickHouse Server and Client (Debian / Ubuntu)
sudo service clickhouse-server start
# Connect via the client:
clickhouse-client
# or, if a password is configured:
clickhouse-client --password
Installing and Starting ClickHouse Keeper on Dedicated Nodes (Optional)
After preparing the Keeper configuration file on each dedicated node, execute the following commands in order:
sudo apt-get install -y clickhouse-keeper
sudo systemctl enable clickhouse-keeper
sudo systemctl start clickhouse-keeper
sudo systemctl status clickhouse-keeper
Installation on RedHat / CentOS and Other rpm-based Distributions
Adding the ClickHouse RPM Repository
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://packages.clickhouse.com/rpm/clickhouse.repo
For systems with zypper (openSUSE, SLES), use the following commands:
sudo zypper addrepo -r https://packages.clickhouse.com/rpm/clickhouse.repo -g
sudo zypper --gpg-auto-import-keys refresh clickhouse-stable
Viewing Available ClickHouse Versions (RedHat / CentOS)
After adding the repository, you can list all available versions of the package:
sudo yum list clickhouse-server --showduplicates
or, if necessary, filter and sort the output:
sudo yum list clickhouse-server --showduplicates | sort -r
Select the desired version, for example, 25.7.4.11 or a current LTS release. Installing a specific version is supported by appending the version number to the package name.
Installing a Specific ClickHouse Version (RedHat / CentOS)
Set the chosen version:
export VERSION=25.7.4.11
Install the server and client for this version using the following command:
sudo yum install -y clickhouse-server-${VERSION} clickhouse-client-${VERSION}
If necessary, you can add clickhouse-common-static-${VERSION} and other packages (e.g., clickhouse-common-static-dbg).
Starting ClickHouse (RedHat / CentOS)
sudo systemctl enable clickhouse-server
sudo systemctl start clickhouse-server
sudo systemctl status clickhouse-server
clickhouse-client
# or, if a password is configured:
clickhouse-client --password
Installing ClickHouse Keeper (Optional)
sudo yum install -y clickhouse-keeper
sudo systemctl enable clickhouse-keeper
sudo systemctl start clickhouse-keeper
sudo systemctl status clickhouse-keeper
To ensure fault tolerance and stability of production clusters, ClickHouse Keeper should be deployed on separate servers, not co-located with ClickHouse Server.
Installation from TGZ Archives (Other Linux)
This method is recommended for distributions without full deb/rpm package support, as well as in cases where full control over the directory structure and installation process is required.
Viewing Available ClickHouse Versions (tgz)
Available tgz archives are published in the repository:
https://packages.clickhouse.com/tgz/stable/— stable releaseshttps://packages.clickhouse.com/tgz/lts/— LTS releases
To view the list of versions, use a browser or command line. For example, to get a list of versions from the auxiliary file version_date.tsv:
curl -s https://raw.githubusercontent.com/ClickHouse/ClickHouse/master/utils/list-versions/version_date.tsv | awk -F' ' '{print $1}' | sort -Vr | head
The command will output the most recent versions. Select the one approved for use in your environment (typically, a specific LTS or stable release).
After selection, set the version in a variable:
export VERSION=25.7.4.11
Determining the Target System Architecture
Determine the architecture and set it in the ARCH variable:
case $(uname -m) in
x86_64) ARCH=amd64 ;; # 64‑битные Intel/AMD
aarch64) ARCH=arm64 ;; # 64‑битные ARM
*) echo "Unknown architecture $(uname -m)"; exit 1 ;;
esac
export ARCH
Downloading ClickHouse Archives
Download the tgz archives for the main ClickHouse components of the specified version. The download algorithm sequentially checks the availability of:
- An archive for the specific architecture
- A universal archive (without the architecture specified in the name)
for PKG in clickhouse-common-static clickhouse-common-static-dbg clickhouse-server clickhouse-client clickhouse-keeper
do
curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$VERSION-${ARCH}.tgz" || curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$VERSION.tgz"
done
If necessary, you can replace stable with lts if using the LTS release line.
Installation on the Target Host
Next, extract and install each component using the built-in doinst.sh scripts for the chosen version.
Installing clickhouse-common-static
tar -xzvf "clickhouse-common-static-$VERSION-${ARCH}.tgz" || tar -xzvf "clickhouse-common-static-$VERSION.tgz"
sudo "clickhouse-common-static-$VERSION/install/doinst.sh"
Installing clickhouse-common-static-dbg (Optional)
tar -xzvf "clickhouse-common-static-dbg-$VERSION-${ARCH}.tgz" || tar -xzvf "clickhouse-common-static-dbg-$VERSION.tgz"
sudo "clickhouse-common-static-dbg-$VERSION/install/doinst.sh"
Installing and Starting clickhouse-server
tar -xzvf "clickhouse-server-$VERSION-${ARCH}.tgz" || tar -xzvf "clickhouse-server-$VERSION.tgz"
sudo "clickhouse-server-$VERSION/install/doinst.sh" configure
# start the server
sudo /etc/init.d/clickhouse-server start
Installing clickhouse-client
tar -xzvf "clickhouse-client-$VERSION-${ARCH}.tgz" || tar -xzvf "clickhouse-client-$VERSION.tgz"
sudo "clickhouse-client-$VERSION/install/doinst.sh"
After installation, connect to the server:
clickhouse-client
# or:
clickhouse-client --password
Password for the default User and Network Access
During installation, you will be prompted to set a password for the built-in default user. This password is saved in the file /etc/clickhouse-server/users.d/default-password.xml. It can be changed at any time by editing this configuration file.
By default, ClickHouse may listen only on the local interface. If you need to accept connections from other servers, check the listen_host and related settings in config.xml, as well as firewall rules and network ACLs.