docker.recipes

ClickHouse + Tabix

intermediate

ClickHouse high-performance columnar OLAP database with Tabix web UI for analytics and data exploration.

Overview

ClickHouse is a high-performance columnar database management system designed for online analytical processing (OLAP) workloads. Developed by Yandex in 2009 and open-sourced in 2016, ClickHouse excels at processing billions of rows in milliseconds through its innovative column-oriented storage architecture and advanced compression algorithms. Unlike traditional row-based databases, ClickHouse stores data in columns, making it exceptionally fast for analytical queries that typically scan large datasets but only need specific columns. Tabix provides a modern web-based interface for ClickHouse, offering visual query building, data exploration tools, and interactive dashboards. This web client transforms ClickHouse's command-line interface into an accessible graphical environment where users can write SQL queries, visualize results, and manage database schemas without technical expertise. Tabix includes features like query history, result formatting, and connection management that streamline database interactions. This combination delivers enterprise-grade analytical capabilities for organizations processing large volumes of time-series data, logs, or business metrics. Data engineers and analysts benefit from ClickHouse's sub-second query performance on massive datasets while business users can explore data through Tabix's intuitive interface, making advanced analytics accessible across different skill levels.

Key Features

  • Column-oriented storage with advanced compression reducing storage by 10x compared to traditional databases
  • Real-time query performance processing billions of rows in milliseconds
  • Native SQL support with extensions for analytical functions and window operations
  • Tabix web interface with visual query builder and interactive result visualization
  • MergeTree engine family optimized for time-series and analytical workloads
  • Distributed query execution across multiple nodes for horizontal scaling
  • Approximate query processing for ultra-fast statistical analysis
  • Built-in materialized views for pre-aggregated analytics and real-time reporting

Common Use Cases

  • 1Real-time business intelligence dashboards analyzing customer behavior and sales metrics
  • 2Log analytics for monitoring application performance and system health at scale
  • 3Time-series analysis for IoT sensor data and infrastructure monitoring
  • 4Financial data analysis processing trading records and market data
  • 5E-commerce analytics tracking user journeys and conversion funnels
  • 6Media analytics measuring content engagement and advertising effectiveness
  • 7Telecommunications data analysis for call detail records and network optimization

Prerequisites

  • Minimum 8GB RAM recommended for production workloads with large datasets
  • Docker Engine 20.10+ and Docker Compose V2 for container orchestration
  • Available ports 8123 (HTTP API), 9000 (native protocol), and 8080 (Tabix UI)
  • Basic SQL knowledge for writing analytical queries and data modeling
  • Understanding of columnar database concepts and OLAP workload patterns
  • SSD storage recommended for optimal query performance on large datasets

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 clickhouse:
3 image: clickhouse/clickhouse-server:latest
4 container_name: clickhouse
5 restart: unless-stopped
6 environment:
7 CLICKHOUSE_USER: ${CLICKHOUSE_USER}
8 CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD}
9 CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
10 volumes:
11 - clickhouse_data:/var/lib/clickhouse
12 - clickhouse_logs:/var/log/clickhouse-server
13 ports:
14 - "8123:8123"
15 - "9000:9000"
16 networks:
17 - clickhouse-network
18 ulimits:
19 nofile:
20 soft: 262144
21 hard: 262144
22
23 tabix:
24 image: spoonest/clickhouse-tabix-web-client:stable
25 container_name: tabix
26 restart: unless-stopped
27 environment:
28 CH_HOST: clickhouse
29 CH_PORT: 8123
30 ports:
31 - "8080:80"
32 depends_on:
33 - clickhouse
34 networks:
35 - clickhouse-network
36
37volumes:
38 clickhouse_data:
39 clickhouse_logs:
40
41networks:
42 clickhouse-network:
43 driver: bridge

.env Template

.env
1# ClickHouse Configuration
2CLICKHOUSE_USER=default
3CLICKHOUSE_PASSWORD=changeme

Usage Notes

  1. 1Docs: https://clickhouse.com/docs
  2. 2Tabix UI at http://localhost:8080 | HTTP API at http://localhost:8123
  3. 3Native protocol on port 9000 - use for high-performance clients
  4. 4Test query: curl 'http://localhost:8123/?query=SELECT%201'
  5. 5Use MergeTree engine family for time-series and analytics workloads
  6. 6Optimized for OLAP - billions of rows in sub-second queries

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

clickhouse
clickhouse:
  image: clickhouse/clickhouse-server:latest
  container_name: clickhouse
  restart: unless-stopped
  environment:
    CLICKHOUSE_USER: ${CLICKHOUSE_USER}
    CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD}
    CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
  volumes:
    - clickhouse_data:/var/lib/clickhouse
    - clickhouse_logs:/var/log/clickhouse-server
  ports:
    - "8123:8123"
    - "9000:9000"
  networks:
    - clickhouse-network
  ulimits:
    nofile:
      soft: 262144
      hard: 262144
tabix
tabix:
  image: spoonest/clickhouse-tabix-web-client:stable
  container_name: tabix
  restart: unless-stopped
  environment:
    CH_HOST: clickhouse
    CH_PORT: 8123
  ports:
    - "8080:80"
  depends_on:
    - clickhouse
  networks:
    - clickhouse-network

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 clickhouse:
5 image: clickhouse/clickhouse-server:latest
6 container_name: clickhouse
7 restart: unless-stopped
8 environment:
9 CLICKHOUSE_USER: ${CLICKHOUSE_USER}
10 CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD}
11 CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
12 volumes:
13 - clickhouse_data:/var/lib/clickhouse
14 - clickhouse_logs:/var/log/clickhouse-server
15 ports:
16 - "8123:8123"
17 - "9000:9000"
18 networks:
19 - clickhouse-network
20 ulimits:
21 nofile:
22 soft: 262144
23 hard: 262144
24
25 tabix:
26 image: spoonest/clickhouse-tabix-web-client:stable
27 container_name: tabix
28 restart: unless-stopped
29 environment:
30 CH_HOST: clickhouse
31 CH_PORT: 8123
32 ports:
33 - "8080:80"
34 depends_on:
35 - clickhouse
36 networks:
37 - clickhouse-network
38
39volumes:
40 clickhouse_data:
41 clickhouse_logs:
42
43networks:
44 clickhouse-network:
45 driver: bridge
46EOF
47
48# 2. Create the .env file
49cat > .env << 'EOF'
50# ClickHouse Configuration
51CLICKHOUSE_USER=default
52CLICKHOUSE_PASSWORD=changeme
53EOF
54
55# 3. Start the services
56docker compose up -d
57
58# 4. View logs
59docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/clickhouse/run | bash

Troubleshooting

  • ClickHouse container exits with 'Memory limit exceeded': Increase container memory limits and set max_memory_usage in ClickHouse configuration
  • Tabix shows 'Connection refused' to ClickHouse: Verify CH_HOST environment variable matches ClickHouse service name and both containers are on same network
  • Queries timeout on large datasets: Tune max_execution_time setting and consider using LIMIT clauses for initial data exploration
  • High memory usage during queries: Configure max_memory_usage_for_user and optimize queries to use appropriate WHERE clauses
  • Tabix interface loads but queries fail: Check ClickHouse user permissions and ensure CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT is enabled
  • Poor query performance: Verify data is using MergeTree engine family and consider adding appropriate ORDER BY keys for your query patterns

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space