Where does self-hosted ClickHouse fit?
Self-hosted ClickHouse fits analytical queries over large, append-heavy datasets such as events, logs, traces and product analytics. It is a column-oriented database released under the Apache License 2.0, as the ClickHouse license shows, and you run it on your own virtual machines or Kubernetes. A column store reads only the columns a query needs and compresses them well. It is less suited to transactional workloads with frequent single-row updates, and joins across large tables need deliberate schema design.
ClickHouse also runs underneath other platforms, so it can arrive as a dependency of a tracing or telemetry tool. When you self-host such a tool, most of the operating effort sits in the ClickHouse layer: disk growth, retention, merges, replication and backups. Give it an owner, even when it came bundled with something else.
Self-hosting is one of several routes. The install docs list ClickHouse Cloud (managed), local development, production server packages and binaries, and Kubernetes. ClickHouse Cloud is a fully managed service that lets compute scale independently of storage. With self-hosted ClickHouse you operate Keeper, storage, upgrades and backups yourself. Section 6 of the LICENSE text also withholds permission to use the licensor's trademarks, except for accurate descriptions of where the work came from.
ClickHouse cluster setup: the building blocks
Knowing which pieces you use shapes failure handling and upgrades.
ClickHouse server
Stores data and runs queries. Clients use the HTTP interface on port 8123 or the native protocol on port 9000. A TLS setup moves them to 8443 and 9440. The Docker docs list /var/lib/clickhouse for data, /var/log/clickhouse-server for logs, and config.d and users.d under /etc/clickhouse-server for overrides.
MergeTree tables
The main table engine family. Each insert creates data parts, and background merges combine them. Rows are sorted by primary key within a part, and parts from different partitions are never merged together. The MergeTree docs set index_granularity to 8192 rows per granule by default.
Replicated tables
ReplicatedMergeTree keeps replica metadata in ClickHouse Keeper. Replication is asynchronous and multi-master, and an INSERT waits for one replica unless insert_quorum is set. CREATE, DROP, ATTACH, DETACH and RENAME run on one server and are not replicated, per the replication docs.
Distributed tables
Route inserts and queries across shards. They hold no data themselves and depend on a sharding key chosen up front. Pair every shard with replicas for availability. Treat adding shards and rebalancing as planned work with a written procedure and a rehearsal.
ClickHouse Keeper
A Raft-based coordination service written in C++ with a ZooKeeper-compatible client protocol. Its formats are incompatible with ZooKeeper, so mixed clusters are not possible. A three-node cluster keeps working if one node crashes. See the Keeper documentation.
Which schema and storage choices drive ClickHouse cost?
Performance and disk use depend heavily on table design. Test each choice with representative data and queries.
| Choice | What it controls | Guidance |
|---|---|---|
| Sorting key | Rows are sorted by primary key within each part, and the sparse index decides how much data a filter can skip. | Lead with the columns most queries filter on. Changing the key substantially later usually means rewriting the table. |
| Partition key | Partitioning is mainly for data management, such as dropping or moving old data. Parts from different partitions are never merged together. | Partition coarsely. Monthly partitions are usually the finest needed, and too many partitions create many small parts and slow merges. |
| TTL | TTL is applied during background merges, so expired rows can still appear in SELECT until a merge runs. | Match the agreed retention policy. Do not treat TTL as an exact deletion time when legal limits apply. |
| Storage policy | A policy groups disks into ordered volumes and moves parts to the next volume when free space drops below move_factor, which defaults to 0.1. | Move older data to cheaper volumes, and alert on free space well before the threshold. |
| Insert pattern | Each insert creates a new part, so many small inserts build a merge backlog. | Batch inserts, or use async_insert=1 with wait_for_async_insert=1. Setting wait_for_async_insert=0 risks silent data loss. |
| Memory and quotas | Large GROUP BY and JOIN operations hold intermediate state in memory. | Use settings profiles and quotas to cap what one user can consume. The operations tips recommend at least 32 GB of RAM. |
| Disks, network and Keeper | Merges use CPU and disk throughput. The tips recommend ext4 with noatime or XFS, and say FAT-32 and exFAT are unsupported. | Disable swap in production and use 10 Gbit networking for clusters. Keep Keeper on separate servers, or at least separate disks, from query work. |
Which ClickHouse deployment topology should you pick?
One server for development, small datasets or a tool with modest retention. Recovery depends entirely on backups, so plan the move to replication before the data becomes important. For ClickHouse Docker, images without a suffix are built from scratch with no shell or package manager, and -ubuntu, -alpine and -distroless tags give other variants. Mount volumes for data, logs and configuration, and raise the open-file limit, as the examples use --ulimit nofile=262144:262144. The install guide lists Docker under local development and packages for production servers.
One shard with two or more replicas and a three-node Keeper quorum. Queries continue if a replica is lost, and a replacement replica fetches data from its peers. Replication is asynchronous, so a write confirmed by one replica may not have reached the others yet. Set insert_quorum where that matters. The Debian install guide calls for dedicated Keeper nodes in production and ships a clickhouse-keeper package for them. Rehearse a replica rebuild and record how long it takes.
Several replicated shards behind Distributed tables. The sharding key is chosen up front, so settle it with the data owners before the first load. Treat adding shards and rebalancing as a planned operation, tested on a pre-production cluster. Because CREATE, DROP, ATTACH, DETACH and RENAME run on one server, check how each schema change reaches every replica of every shard. Move to shards only when one replicated shard no longer fits the data volume or query load, since a single shard with replicas is simpler to upgrade and restore.
The ClickHouse Operator is the official Kubernetes operator, licensed Apache-2.0, and it manages ClickHouse and ClickHouse Keeper clusters. The operator docs list built-in Keeper support, persistent volume claims with storage class selection, high availability, TLS and SSL support and Prometheus metrics. Install it with manifests, Helm or Operator Lifecycle Manager. Run Keeper as its own pods on storage with predictable latency, and choose the storage class as carefully as you would disks on virtual machines.
ClickHouse security hardening: TLS, users and LDAP
Analytical stores collect sensitive data from many sources and need the same care as any production database.
| Area | Approach | Check |
|---|---|---|
| Network and TLS | Expose only the interfaces clients need. A TLS setup uses https_port 8443, tcp_port_secure 9440 and interserver_https_port 9010, and comments out ports 8123, 9000 and 9009. | Keeper and inter-server ports are unreachable from user networks, and plain ports refuse connections. |
| Certificates | Store certificates in /etc/clickhouse-server/certs, owned by clickhouse:clickhouse with permissions 600. Keep the CA key off cluster nodes and use your organization's PKI in production. | Expiry dates are tracked and rotation has been rehearsed. |
| Default user | Set a password on the default user or disable it, and create named administrator accounts. In Docker, CLICKHOUSE_SKIP_USER_SETUP=1 can allow passwordless network access as the default user. | No account can log in without credentials. |
| Users and roles | SQL-driven access control covers user accounts, roles, row policies, settings profiles and quotas. Dropping a table does not revoke its privileges, so run REVOKE explicitly. | A read-only application user cannot alter tables or exceed its quota. Row policies are relied on only for read-only users, because write or DDL privileges can bypass them. |
| Read-only mode | The readonly setting at 1 allows only read and session queries. At 2 it also allows SET and RESTORE. BACKUP is not restricted at any value. | Who can run BACKUP is limited through other access controls. |
| Directory and SSO | Authenticate people through LDAP, Kerberos or SSL X.509 certificates. The docs also list HTTP and JWT. Browser SSO usually happens in the BI or observability tool in front of ClickHouse. | Disabling a directory account removes access. |
| Configuration and secrets | Keep users and secrets in configuration files under change control. | Access defined in users.xml has its own restore procedure, since SQL backups leave it out. |
ClickHouse backup and restore: what to protect and test
Replication keeps replicas current with each other. It does not give you a restorable copy from an earlier time, so separate backups are still required. The backup docs list File, Disk, S3 and AzureBlobStorage as BACKUP and RESTORE targets. Incremental backups use base_backup and need every backup in the chain available to restore, so retention rules must keep chains intact.
Decide what a restore must bring back: table data, schemas, SQL-defined users and roles, and the configuration files SQL backups leave out. SQL-driven access entities (users, roles, settings profiles, row policies and quotas) are backed up as SQL. Configuration in server files such as users.xml is not covered, so keep those files in version control and test their restore separately.
Scheduling needs one detail. By default only one BACKUP and one RESTORE run at a time, and allow_concurrent_backups and allow_concurrent_restores need a server restart to take effect. Stagger jobs across databases, and avoid planning a restore on a node that is also running a scheduled backup.
Restoring replicated tables involves Keeper metadata, so rehearse on a cluster with the same layout and record how long your largest tables take. DeployOpen sets up backups and runs a restore test, and the handover includes the backup schedule and the latest restore result. Protect backup storage and its keys as carefully as the live cluster.
ClickHouse LTS vs stable: which release to run and how to upgrade
The production FAQ says stable releases arrive roughly monthly and are the default recommendation, with the three latest stable releases supported for diagnostics and bug-fix backports. LTS releases arrive twice a year, are supported for one year after initial release, and suit teams whose policy prevents frequent upgrades. On Debian and Ubuntu the apt channel is named stable, and you replace it with lts for the LTS channel.
Security support is narrower than release support. SECURITY.md lists server versions 26.11, 26.10, 26.9, 26.8 and 26.3 as supported for security updates. Versions 26.7, 26.6, 26.5, 26.4, 26.2, 26.1 and all 25.x and earlier are not. The releases page, read on 4 December 2026, lists v26.11.10.7-stable, v26.10.21.9-stable and v26.9.46.12-stable (marked Latest), plus v26.8.55.16-lts as the newest LTS release. Check both pages before choosing a version.
Read the changelog for backward-incompatible changes, test on a pre-production cluster with representative data and queries, then upgrade replicas one at a time while watching replication and merges. Upgrade Keeper separately. When you pin a version, install all ClickHouse packages at the same version. Plan a regular upgrade rhythm, because a version left in place long enough falls out of security support.
Moving from ZooKeeper to Keeper uses clickhouse-keeper-converter, described in the Keeper documentation. It converts ZooKeeper 3.4 or later logs and snapshots into a Keeper snapshot, requires stopping ZooKeeper and data ingestion, and needs the snapshot copied to every Keeper node before startup. Mixed ZooKeeper and Keeper clusters are not possible, so schedule a maintenance window with ingestion paused. DeployOpen carries out upgrades and Keeper migrations.
Who owns what in a ClickHouse deployment?
The platform team keeps the cluster healthy. Data owners decide what is stored, how it is shaped and how long it stays.
Platform
- Monitor disk, part counts, merge backlog, replication queue and Keeper health.
- Upgrade on a planned rhythm with a tested rollback path.
- Add replicas and shards with a written procedure.
- Track running versions against the security support list.
Data owners
- Approve schemas, sorting keys and TTL rules.
- Review materialized views when source tables change.
- Confirm retention meets legal and business requirements.
- Remember that TTL deletes during merges, at no exact time.
Security
- Review users, roles, row policies and quotas.
- Rotate service credentials and certificates.
- Protect backup storage and its keys.
- Check that disabling a directory account removes access.
Consuming applications
- Keep dashboard and API queries within agreed limits.
- Report slow queries with the query ID and time range.
- Coordinate upgrades of observability or analytics tools with their schema migrations.
ClickHouse deployment questions
What is the difference between self-hosted ClickHouse and ClickHouse Cloud?
ClickHouse Cloud is a fully managed service from the creators of ClickHouse. It lets compute scale independently of storage and adds ClickPipes, a SQL console, SSO, customer-managed encryption keys, SOC 2 and HIPAA. Keeper is not supported there because the procedure is automated. A self-hosted deployment runs the open-source server under Apache-2.0, and you operate Keeper, storage, upgrades and backups.
How does ClickHouse replication work?
Replicated tables keep replica metadata in ClickHouse Keeper. Replication is asynchronous and multi-master. By default an INSERT waits for confirmation from only one replica, so set insert_quorum if you need more. CREATE, DROP, ATTACH, DETACH and RENAME run on one server and are not replicated, and DROP TABLE removes only the local replica. Replication supports availability and does not replace backups.
How many ClickHouse Keeper nodes do we need, and where should they run?
A three-node Keeper cluster keeps working if one node crashes, and at least one server needs can_become_leader set to true. In production the Debian guide calls for dedicated Keeper nodes, and the operations tips say separate servers or at least separate disks. On Kubernetes the ClickHouse Operator has built-in Keeper support.
Should we run ClickHouse LTS or stable?
Stable is the default recommendation. It arrives roughly monthly, and the three latest stable releases get bug-fix backports. LTS arrives twice a year, is supported for one year, and suits teams whose policy prevents frequent upgrades. Either way, check the security support list, since only a few recent versions receive security updates. Pick the channel your team can keep current, and pin all packages to one version.
Can we run ClickHouse in Docker?
Docker is a documented route. The image exposes port 8123 for HTTP and 9000 for the native client, and expects volumes for data, logs and configuration. It reads CLICKHOUSE_USER, CLICKHOUSE_PASSWORD and CLICKHOUSE_DB. Avoid CLICKHOUSE_SKIP_USER_SETUP=1 on a reachable network, since it can allow passwordless access as the default user. The install guide lists Docker under local development, with server packages and Kubernetes for production.
How do we configure ClickHouse TLS and LDAP authentication?
For TLS, enable https_port 8443, tcp_port_secure 9440 and interserver_https_port 9010, and comment out the plain ports. Store certificates in /etc/clickhouse-server/certs with permissions 600, and use your organization's PKI in production. LDAP works as an authenticator and as a user directory, next to Kerberos, X.509, HTTP and JWT. DeployOpen configures TLS, users, roles and directory authentication.
Is ClickHouse a good fit for logs and observability data?
Yes for append-heavy data such as events, logs, traces and telemetry. Design partitions and TTL around your retention policy, batch inserts, and cap resource use with quotas. Several tools can share hardware through separate databases, users and quotas, but their upgrades and load then affect each other. Separate clusters are simpler when tools have different owners or recovery needs.
Can ClickHouse replace our transactional database?
It is designed for analytics. Keep transactional records in a database built for them and copy data into ClickHouse for reporting. ClickHouse is less suited to frequent single-row updates, and joins across large tables need deliberate schema design. When you move history in, backfill in batches, run old and new systems in parallel, and compare results for known time windows.
What DeployOpen sets up and hands over for ClickHouse
DeployOpen plans the topology and storage with you and deploys ClickHouse and Keeper on virtual machines or Kubernetes. It configures TLS, users, roles and directory authentication, sets up backups and runs a restore test.
DeployOpen also carries out upgrades and Keeper migrations, documents runbooks and provides ongoing support if you want it. Scope depends on data volume and retention, shards and replicas, consuming applications, environments and network restrictions.
Handover includes the cluster layout, a table register with sorting keys and TTL rules, the user, role and quota model, the backup schedule and latest restore result, alert routes, and the upgrade plan with supported versions.
Sources and further reading
- ClickHouse license ↗
- ClickHouse Keeper documentation ↗
- ClickHouse backup and restore ↗
- Which ClickHouse version to use in production ↗
- ClickHouse GitHub ↗
- ClickHouse LICENSE ↗
- ClickHouse install docs ↗
- ClickHouse Debian install ↗
- ClickHouse Docker docs ↗
- ClickHouse Operator GitHub ↗
- ClickHouse Operator docs ↗
- ClickHouse SECURITY.md ↗
- ClickHouse releases ↗
- ClickHouse operations tips ↗
- ClickHouse replication docs ↗
- ClickHouse MergeTree docs ↗

