This repository provides a docker compose setup for running a self-hosted ClickHouse server.
It is pre-configured to join a shared Docker network, which simplifies connecting to other services like n8n.
- Uses the official ClickHouse server Docker image.
- Persists data in a local volume.
- Configured for a shared network for easy integration.
- Includes scripts for easy management.
- Telemetry is disabled by default.
- Pre-configured to query data directly from MySQL and PostgreSQL sources.
-
Clone the repository:
git clone https://github.com/AiratTop/clickhouse-self-hosted.git cd clickhouse-self-hosted -
Create the shared network: If it doesn't exist yet, create the shared Docker network:
docker network create shared_network
-
Configure environment variables: Update a
.envfile and specify your database credentials. -
Start the service:
docker compose up -d
- Start:
docker compose up -d - Restart:
./restart-docker.sh - Update:
./update-docker.sh(Pulls the latest image and restarts)
This setup is designed to work with the n8n-self-hosted configuration. Since both services are on the shared_network, you can connect to ClickHouse from n8n using clickhouse as the host.
- Use port
8123for the native ClickHouse HTTP interface. - Use port
9004for the MySQL compatible endpoint. - Use port
9005for the PostgreSQL compatible endpoint.
Check out other self-hosted solutions:
- postgresql-self-hosted: A simple and robust PostgreSQL setup.
- mysql-self-hosted: A self-hosted MySQL instance.
- clickhouse-self-hosted: High-performance columnar database for analytics.
- metabase-self-hosted: Self-hosted Metabase on Docker for business intelligence and analytics.
- qdrant-self-hosted: A vector database for AI applications.
- redis-self-hosted: A fast in-memory data store, often used as a cache or message broker.
- caddy-self-hosted: A modern, easy-to-use web server with automatic HTTPS.
- wordpress-self-hosted: Production-ready WordPress stack with MySQL, phpMyAdmin, and WP-CLI.
- n8n-self-hosted: Scalable n8n with workers, Caddy for auto-HTTPS, and backup scripts.
- monitoring-self-hosted: Self-hosted monitoring stack with Prometheus and Grafana.
- ollama-self-hosted: Ready-to-use solution for running Ollama with the Open WebUI on Docker.
- authentik-self-hosted: Authentik is a flexible, open-source Identity & Access Management (IAM) solution.
- gatus-self-hosted: Automated service health dashboard with a PostgreSQL backend and backup scripts.
- beszel-self-hosted: Ready-to-run Beszel hub + agent stack for monitoring your infrastructure.
This project is licensed under the MIT License - see the LICENSE file for details.
AiratTop
- Website: airat.top
- GitHub: @AiratTop
- Email: mail@airat.top
- Repository: clickhouse-self-hosted