EDB publishes a container image built from the same RPMs as the Linux packages. The image is based on Red Hat Universal Base Image (UBI) 10 minimal, is available for x86_64, aarch64, and ppc64le, and includes clickhouse-server, clickhouse-keeper, and clickhouse-client.
Prerequisites
- Docker Engine 20.10 or later with Compose v2 (
docker composecommand) - An EDB subscription token, available from the EDB customer portal
Pulling the image
Log in to the EDB container registry and pull the image:
export EDB_SUBSCRIPTION_TOKEN=<your-token> echo "$EDB_SUBSCRIPTION_TOKEN" | docker login docker.enterprisedb.com \ --username clickhouse \ --password-stdin docker pull docker.enterprisedb.com/clickhouse/edb-clickhouse-server:26.3.37.3-1edb1
Note
The username must match the repository you're pulling from. Docker stores credentials keyed by registry with no distinction between repositories, so each login overwrites the previous one. If you need to pull images from a different repository on docker.enterprisedb.com, log in again with the appropriate username.
Running a single-node server
For development and testing purposes, run a single ClickHouse Server node.
Start the server:
docker run -d \ --name clickhouse-server \ --ulimit nofile=262144:262144 \ -p 8123:8123 \ -p 9000:9000 \ docker.enterprisedb.com/clickhouse/edb-clickhouse-server:26.3.37.3-1edb1
Port
8123exposes the HTTP interface. Port9000exposes the native TCP interface used byclickhouse-clientand most drivers.To persist data across container restarts, add a volume mount:
docker run -d \ --name clickhouse-server \ --ulimit nofile=262144:262144 \ -p 8123:8123 \ -p 9000:9000 \ -v /local/path/clickhouse-data:/var/lib/clickhouse \ docker.enterprisedb.com/clickhouse/edb-clickhouse-server:26.3.37.3-1edb1
To override default server settings, mount a configuration directory:
docker run -d \ --name clickhouse-server \ --ulimit nofile=262144:262144 \ -p 8123:8123 \ -p 9000:9000 \ -v /local/path/config:/etc/clickhouse-server/config.d \ docker.enterprisedb.com/clickhouse/edb-clickhouse-server:26.3.37.3-1edb1
ClickHouse merges all
.xmlfiles inconfig.dinto the main configuration at startup.Connect with the ClickHouse client. The default password for the
defaultuser isadmin123:docker exec -it clickhouse-server clickhouse-client --password admin123
Verify the EDB build:
SELECT version();
The output includes the EDB release, for example
26.3.37.3+1edb1.
Running a multi-node cluster
Use Docker Compose to deploy a multi-node cluster. The EDB-provided server image includes both clickhouse-server and clickhouse-keeper, so all nodes in the cluster run from a single image.
The following example sets up a 2-shard, 2-replica cluster with 3 dedicated Keeper nodes (7 containers total). For an explanation of sharding, replication, and Keeper roles, see Architecture.
Creating the configuration files
Create the following directory structure:
cluster/
├── docker-compose.yml
├── keeper-01/
│ └── keeper_config.xml
├── keeper-02/
│ └── keeper_config.xml
├── keeper-03/
│ └── keeper_config.xml
├── server-01/
│ ├── config.xml
│ └── users.xml
├── server-02/
│ ├── config.xml
│ └── users.xml
├── server-03/
│ ├── config.xml
│ └── users.xml
└── server-04/
├── config.xml
└── users.xmlPopulate each directory with the configuration files for its node role:
Keeper nodes
The three Keeper nodes form a Raft quorum. Each has a unique server_id. Create keeper_config.xml in each keeper directory, setting server_id to 1, 2, and 3 respectively.