
Maintained by:
https://github.com/ClickHouse/ClickHouse
Where to get help:
the Docker Community Slack, Server Fault, Unix & Linux, or Stack Overflow
Dockerfile linkshttps://github.com/ClickHouse/docker-library/blob/1a906c8184fab558b6df654fa30d2e361d869337/server/26.3.9.8/Dockerfile.ubuntu
https://github.com/ClickHouse/docker-library/blob/1a906c8184fab558b6df654fa30d2e361d869337/server/26.2.16.4/Dockerfile.ubuntu
https://github.com/ClickHouse/docker-library/blob/1a906c8184fab558b6df654fa30d2e361d869337/server/26.1.11.9/Dockerfile.ubuntu
https://github.com/ClickHouse/docker-library/blob/1a906c8184fab558b6df654fa30d2e361d869337/server/25.8.22.28/Dockerfile.ubuntu
Where to file issues:
https://github.com/ClickHouse/ClickHouse/issues?q=
Supported architectures: (https://github.com/docker-library/official-images#architectures-other-than-amd64)
https://hub.docker.com/r/amd64/clickhouse/, https://hub.docker.com/r/arm64v8/clickhouse/
Published image artifact details:
https://github.com/docker-library/repo-info/blob/master/repos/clickhouse (https://github.com/docker-library/repo-info/commits/master/repos/clickhouse)
(image metadata, transfer size, etc)
Image updates:
https://github.com/docker-library/official-images/issues?q=label%3Alibrary%2Fclickhouse
https://github.com/docker-library/official-images/blob/master/library/clickhouse (https://github.com/docker-library/official-images/commits/master/library/clickhouse)
Source of this description:
https://github.com/docker-library/docs/tree/master/clickhouse (https://github.com/docker-library/docs/commits/master/clickhouse)
!https://raw.githubusercontent.com/docker-library/docs/007e3209490145a9855f4825218a9a08753d425b/clickhouse/logo.svg?sanitize=true
ClickHouse is an open-source column-oriented DBMS (columnar database management system) for online analytical processing (OLAP) that allows users to generate analytical reports using SQL queries in real-time.
ClickHouse works 100-1000x faster than traditional database management systems, and processes hundreds of millions to over a billion rows and tens of gigabytes of data per server per second. With a widespread user base around the globe, the technology has received praise for its reliability, ease of use, and fault tolerance.
For more information and documentation see [***]
latest tag points to the latest release of the latest stable branch.22.2 point to the latest release of the corresponding branch.22.2.3 and 22.2.3.5 point to the corresponding release.ubuntu:22.04 as its base image. It requires docker version >= 20.10.10 containing https://github.com/moby/moby/commit/977283509f75303bc6612665a04abf76ff1d2468. As a workaround you could use docker run --security-opt seccomp=unconfined instead, however that has security implications.bashdocker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse
By default, ClickHouse will be accessible only via the Docker network. See the networking section below.
By default, starting above server instance will be run as the default user without password.
bashdocker run -it --rm --network=container:some-clickhouse-server --entrypoint clickhouse-client clickhouse # OR docker exec -it some-clickhouse-server clickhouse-client
More information about the ClickHouse client.
bashecho "SELECT 'Hello, ClickHouse!'" | docker run -i --rm --network=container:some-clickhouse-server buildpack-deps:curl curl 'http://localhost:8123/?query=' -s --data-binary @-
More information about the ClickHouse HTTP Interface.
bashdocker stop some-clickhouse-server docker rm some-clickhouse-server
⚠️ Note: the predefined user
defaultdoes not have the network access unless the password is set, see "How to create default database and user on starting" and "Managingdefaultuser" below
You can expose your ClickHouse running in docker by mapping a particular port from inside the container using host ports:
bashdocker run -d -p 18123:8123 -p 19000:9000 -e CLICKHOUSE_PASSWORD=changeme --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse echo 'SELECT version()' | curl 'http://localhost:18123/?password=changeme' --data-binary @-
22.6.3.35
Or by allowing the container to use host ports directly using --network=host (also allows achieving better network performance):
bashdocker run -d --network=host --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse echo 'SELECT version()' | curl 'http://localhost:8123/' --data-binary @-
22.6.3.35
⚠️ Note: the user
defaultin the example above is available only for the localhost requests
Typically you may want to mount the following folders inside your container to achieve persistency:
/var/lib/clickhouse/ - main folder where ClickHouse stores the data/var/log/clickhouse-server/ - logsbashdocker run -d \ -v "$PWD/ch_data:/var/lib/clickhouse/" \ -v "$PWD/ch_logs:/var/log/clickhouse-server/" \ --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse
You may also want to mount:
/etc/clickhouse-server/config.d/*.xml - files with server configuration adjustments/etc/clickhouse-server/users.d/*.xml - files with user settings adjustments/docker-entrypoint-initdb.d/ - folder with database initialization scripts (see below).ClickHouse has some advanced functionality, which requires enabling several Linux capabilities.
They are optional and can be enabled using the following docker command-line arguments:
bashdocker run -d \ --cap-add=SYS_NICE --cap-add=NET_ADMIN --cap-add=IPC_LOCK \ --name some-clickhouse-server --ulimit nofile=262144:262144 clickhouse
Read more in knowledge base.
The container exposes port 8123 for the HTTP interface and port 9000 for the native client.
ClickHouse configuration is represented with a file "config.xml" (documentation)
bashdocker run -d --name some-clickhouse-server --ulimit nofile=262144:262144 -v /path/to/your/config.xml:/etc/clickhouse-server/config.xml clickhouse
bash# $PWD/data/clickhouse should exist and be owned by current user docker run --rm --user "${UID}:${GID}" --name some-clickhouse-server --ulimit nofile=262144:262144 -v "$PWD/logs/clickhouse:/var/log/clickhouse-server" -v "$PWD/data/clickhouse:/var/lib/clickhouse" clickhouse
When you use the image with local directories mounted, you probably want to specify the user to maintain the proper file ownership. Use the --user argument and mount /var/lib/clickhouse and /var/log/clickhouse-server inside the container. Otherwise, the image will complain and not start.
bashdocker run --rm -e CLICKHOUSE_RUN_AS_ROOT=1 --name clickhouse-server-userns -v "$PWD/logs/clickhouse:/var/log/clickhouse-server" -v "$PWD/data/clickhouse:/var/lib/clickhouse" clickhouse
Sometimes you may want to create a user (user named default is used by default) and database on a container start. You can do it using environment variables CLICKHOUSE_DB, CLICKHOUSE_USER, CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT and CLICKHOUSE_PASSWORD:
bashdocker run --rm -e CLICKHOUSE_DB=my_database -e CLICKHOUSE_USER=username -e CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 -e CLICKHOUSE_PASSWORD=password -p 9000:9000/tcp clickhouse
Managing default user
The user default has disabled network access by default in the case none of CLICKHOUSE_USER, CLICKHOUSE_PASSWORD, or CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT are set.
There's a way to make default user insecurely available by setting environment variable CLICKHOUSE_SKIP_USER_SETUP to 1:
bashdocker run --rm -e CLICKHOUSE_SKIP_USER_SETUP=1 -p 9000:9000/tcp clickhouse
To perform additional initialization in an image derived from this one, add one or more *.sql, *.sql.gz, or *.sh scripts under /docker-entrypoint-initdb.d. After the entrypoint calls initdb, it will run any *.sql files, run any executable *.sh scripts, and source any non-executable *.sh scripts found in that directory to do further initialization before starting the service.
Also, you can provide environment variables CLICKHOUSE_USER & CLICKHOUSE_PASSWORD that will be used for clickhouse-client during initialization.
For example, to add an additional user and database, add the following to /docker-entrypoint-initdb.d/init-db.sh:
bash#!/bin/bash set -e clickhouse client -n <<-EOSQL CREATE DATABASE docker; CREATE TABLE docker.docker (x Int32) ENGINE = Log; EOSQL
View https://github.com/ClickHouse/ClickHouse/blob/master/LICENSE for the software contained in this image.
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
Some additional license information which was able to be auto-detected might be found in https://github.com/docker-library/repo-info/tree/master/repos/clickhouse.
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
以下是 clickhouse 相关的常用 Docker 镜像,适用于 不同场景 等不同场景:
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。


探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
不支持 push
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务