Table of Contents
ClickHouse is a high-performance, column-oriented database designed for analytics, logs, metrics, and large-scale read-heavy workloads. CentOS Stream 9 is a solid base for running ClickHouse in production due to its stability and modern kernel.
Step 1: Update System Packages
Start by updating the system to avoid dependency conflicts.
sudo dnf update -y
Step 2: Install Required Dependencies
ClickHouse repositories require HTTPS and GPG support.
sudo dnf install -y curl ca-certificates gnupg2
Step 3: Add the ClickHouse Repository
Create the official ClickHouse repository file:
sudo tee /etc/yum.repos.d/clickhouse.repo <<EOF
[clickhouse]
name=ClickHouse
baseurl=https://packages.clickhouse.com/rpm/stable/
enabled=1
gpgcheck=1
gpgkey=https://packages.clickhouse.com/rpm/stable/repodata/repomd.xml.key
EOF
Refresh the package cache:
sudo dnf makecache
Step 4: Install ClickHouse Server and Client
Install the server and command-line client:
sudo dnf install -y clickhouse-server clickhouse-client
Step 5: Start and Enable ClickHouse Service
Enable ClickHouse to start on boot and launch it now:
sudo systemctl enable --now clickhouse-server
Verify the service status:
systemctl status clickhouse-server
You should see active (running).
Step 6: Connect to ClickHouse
Access the ClickHouse interactive shell:
clickhouse-client
Run a test query:
SELECT version();
If a version is returned, the installation is successful. ClickHouse is not a general-purpose database. If your workload is transactional, stop here and use PostgreSQL or MySQL. ClickHouse excels at analytics, aggregation, and massive read-heavy datasets — that’s where it belongs.
