What is ClickHouse Cluster?
ClickHouse is the open-source column store that made sub-second analytics over billions of rows ordinary. This template runs a real replicated cluster - one shard, three replicas - with ClickHouse Keeper embedded in the server nodes, so there are no separate ZooKeeper or Keeper pods to deploy and feed.
Tables created ON CLUSTER main with the ReplicatedMergeTree engine replicate across all three nodes; any node can take writes and queries. Each node owns a 20 GB volume, and the whole cluster is internal-only - apps in the project connect to any node over HTTP (:8123) or the native protocol (:9000).
One required variable (CLICKHOUSE_PASSWORD) and you have the analytics backend that ClickHouse Cloud meters by the compute-hour - on a flat resource or by the second on Usage Billing.
What you get
- One shard × three replicas with ReplicatedMergeTree - survive any single node loss
- Embedded ClickHouse Keeper: no ZooKeeper, no extra pods
- Cluster name main preconfigured for ON CLUSTER DDL
- 20 GB per-node volumes; column compression stretches that a long way
- HTTP (:8123) and native (:9000) interfaces on every node
- Single required variable: CLICKHOUSE_PASSWORD
How it runs on Lyngbak
| Service | Role | Public |
|---|---|---|
ch-1..3 | ClickHouse server + embedded Keeper (HTTP :8123, native :9000) | no |
Before you deploy
CLICKHOUSE_PASSWORDpassword for the app user on all nodes
Sizing and billing
2 GiB per node is a working floor for moderate analytics; ClickHouse respects container memory limits. Columnar compression typically fits hundreds of millions of rows in the 3×20 GB provisioned here.
A resource is a flat monthly price, with RAM and disk add-ons when the stack needs a little more than a tier, and room for your own apps on a larger one. On Usage Billing each service takes the smallest size that fits it and is billed by the second it runs, so a stopped stack stops costing CPU and RAM. Its 58.59 GiB of volumes cost $0.15 per GiB a month ($8.79/mo) for as long as they exist. One workspace can use both. See pricing
Compared with the managed service
| Service | Plan | Price | Includes |
|---|---|---|---|
| ClickHouse Cloud | Basic | $67/mo | development-shaped: single replica active ~6h/day + 500 GB storage (worked example) |
| ClickHouse Cloud | Scale | $499/mo | production: 2× 8 GiB replicas always-on + 1 TB storage (worked example) |
Prices from each vendor's pricing page, June 2026.
Run it locally first
The same compose file runs with plain Docker Compose. Clone the template source, copy .env.example to .env, and run docker compose up -d.
Questions
How does this compare to ClickHouse Cloud pricing?
ClickHouse Cloud bills compute per hour plus storage, which is excellent for spiky workloads but adds up for always-on ones. This cluster fits in 8 GiB, on a flat resource or by the second on Usage Billing - predictable, with your data on your volumes.
Do I need ZooKeeper for ClickHouse replication?
No - coordination runs on ClickHouse Keeper, embedded inside the same three server nodes. You get replicated tables with zero extra processes to operate.
How do I create replicated tables?
Use CREATE TABLE ... ON CLUSTER main with ENGINE = ReplicatedMergeTree. The cluster macro config is baked in, so the standard '/clickhouse/tables/{shard}/{table}' path templates just work.
Can ClickHouse replace my Postgres for analytics?
For append-heavy, aggregate-style workloads (events, logs, metrics, funnels) - emphatically yes, often 100× faster. Keep transactional row-level workloads in Postgres; ClickHouse is an OLAP engine, not an OLTP database.