Install and configure ClickHouse server and client on any modern Linux distribution for high-performance analytics.
Add the Altinity-signed repository to guarantee the latest stable builds.On Debian/Ubuntu, import the key with wget -qO - https://packages.clickhouse.com/CLICKHOUSE-KEY.GPG | sudo apt-key add -
, then add the repo line to /etc/apt/sources.list.d/clickhouse.list
.
Running sudo apt update
(or sudo yum makecache
) refreshes metadata so the package manager finds the newly added ClickHouse packages instead of stale indexes.
Install both server and client to run queries locally: sudo apt install clickhouse-server clickhouse-client
.On RHEL/CentOS/Fedora use sudo yum install clickhouse-server clickhouse-client
.
Systemd units are installed automatically. Enable auto-start and run immediately: sudo systemctl enable --now clickhouse-server
.
Use clickhouse-client --query "SELECT version();"
. A version string confirms the server answers locally via TCP port 9000.
/etc/clickhouse-server/config.xml controls network, users, and storage paths. Any edit requires sudo systemctl restart clickhouse-server
.
Run DDL inside the client.Example: CREATE TABLE Customers (id UInt64, name String, email String, created_at DateTime) ENGINE = MergeTree() ORDER BY id;
Pipe files directly: clickhouse-client --query "INSERT INTO Customers FORMAT CSV" < customers.csv
.ClickHouse parallelizes ingestion for millions of rows per second.
Mount the /var/lib/clickhouse data directory on fast NVMe or RAID-10, tune <max_memory_usage>
, and separate ZooKeeper if using ReplicatedMergeTree engines.
Create users with strong passwords in users.xml, restrict <listen_host>
to private IPs, and allow TLS by enabling <https_port>
and providing certs.
Do not leave the default "default" user without a password, and never expose port 8123 to the internet without HTTPS and authentication.
.
No. A single VPS with 2 vCPU and 4 GB RAM can handle billions of rows thanks to columnar storage.
Minor upgrades are in-place: sudo apt upgrade clickhouse-server
. For major versions, use rolling upgrades on replicated nodes.