Back to articles
Technology Insight

Building an Advanced Business Intelligence System: Deploying Metabase with ClickHouse on a VPS

May 30, 2026

Introduction: The Challenge of Modern Business Intelligence

In today's data-driven market, the capacity to rapidly analyze vast volumes of business information is no longer a luxury—it is a core competitive necessity. Organizations frequently find themselves caught between two extremes: expensive, proprietary enterprise business intelligence (BI) platforms that strain corporate budgets, or traditional relational databases that grind to a halt under the weight of analytical queries. Fortunately, a powerful open-source alternative exists. By combining Metabase, an intuitive visualization layer, with ClickHouse, a column-oriented database management system designed for lightning-fast analytics, businesses can deploy a robust, enterprise-grade BI suite. When hosted on a virtual private server (VPS), this architecture offers complete data sovereignty, exceptional performance, and highly predictable infrastructure costs.

Why Combine Metabase and ClickHouse?

Before diving into the deployment architecture, it is essential to understand why this specific technology stack is so effective for advanced business analytics.

ClickHouse: The Columnar Powerhouse

Traditional databases like PostgreSQL or MySQL process data by rows, making them ideal for transactional workloads (OLTP). However, analytical queries (OLAP) typically require aggregating billions of rows across only a few specific columns. ClickHouse organizes data by columns, allowing it to process analytical queries up to 100 to 1,000 times faster than traditional relational databases. It utilizes vectorized query execution and efficient data compression, maximizing the hardware capabilities of your VPS.

Metabase: Democratic Data Exploration

While ClickHouse handles the heavy lifting of data storage and processing, Metabase provides the user-facing layer. Metabase stands out due to its user-friendly interface, allowing non-technical stakeholders to build dashboards, filter records, and generate insights using a visual "Question" builder. For data analysts, it supports native SQL queries, offering the flexibility to build highly complex reports. Together, they bridge the gap between massive datasets and actionable business decisions.

Architecture Overview and VPS Sizing

To ensure a resilient and high-performing setup, selecting the appropriate VPS specifications is critical. Because ClickHouse relies heavily on RAM for caching and CPU for query parallelization, we recommend the following minimum guidelines:

  • Minimum Specifications: 4 vCPUs, 8 GB RAM, 100 GB NVMe SSD storage.
  • Recommended Specifications: 8 vCPUs, 16 GB or 32 GB RAM, high-speed NVMe SSD storage.
  • Operating System: Ubuntu 22.04 LTS or Ubuntu 24.04 LTS.

Using Docker and Docker Compose is highly recommended for this deployment, as it isolates application dependencies and simplifies updates and backups.

Step-by-Step Deployment Guide

Step 1: Preparing the VPS Environment

First, access your VPS via SSH and update the system packages to ensure security and stability. Then, install Docker and Docker Compose:

sudo apt update && sudo apt upgrade -y
sudo apt install docker.io docker-compose -y
sudo systemctl enable --now docker

Step 2: Configuring Docker Compose

Create a dedicated directory for your BI stack and construct a docker-compose.yml file. This configuration will define services for ClickHouse, Metabase, and a PostgreSQL instance dedicated strictly to storing Metabase's internal metadata (such as saved questions, dashboards, and user credentials) to ensure stability in production environments.

Your structure should look like this:

  • clickhouse-server: The analytical database engine exposing port 8123 (HTTP) and 9000 (Native client).
  • metabase: The BI visualization layer exposing port 3000.
  • metabase-backend-db: A reliable PostgreSQL instance to store Metabase internal application data.

Step 3: Optimizing ClickHouse Configuration

To ensure ClickHouse runs securely and efficiently on your VPS, modify the internal XML configuration files to restrict network access, set secure passwords, and establish resource limits. Never leave the default ClickHouse admin password empty when hosting on a public VPS. Always configure a strong password within the users.xml file or use environment variables during container initialization.

Step 4: Connecting Metabase to ClickHouse

Once your containers are healthy and running, navigate to http://your-vps-ip:3000 to initiate the Metabase setup wizard. Follow these essential steps to connect the components:

  1. Create your administrator account and select your language preference.
  2. When prompted to add your data, choose ClickHouse from the database dropdown list. (Note: If ClickHouse is not available natively in your Metabase version, you may need to add the official ClickHouse Metabase driver JAR file to the Metabase plugins directory before starting the container).
  3. Input the connection details: Host (use the Docker service name or internal IP), Port (8123), Database Name, Username, and Password.
  4. Save the connection and allow Metabase to perform its initial schema sync.

Best Practices for Data Pipeline and Schema Design

To maximize the efficiency of your newly deployed system, your data pipeline and database schema must align with ClickHouse's design principles. Consider the following best practices:

  • Leverage the ReplacingMergeTree Engine: ClickHouse handles updates differently than traditional databases. Use the ReplacingMergeTree engine to handle duplicate data or data updates efficiently without incurring heavy performance penalties.
  • Batch Ingestion: Never insert data row-by-row. ClickHouse is designed for large batch inserts (minimum 1,000 to 10,000 rows per batch). Utilize ETL tools like Airflow, Vector, or custom Python scripts to batch your business data before pushing it to ClickHouse.
  • Optimize Sorting Keys: Define your ORDER BY keys carefully based on the columns most frequently filtered or aggregated in your Metabase dashboards (e.g., date, region, or product category).

Securing Your Business Intelligence System

Data security is paramount when exposing a BI system on a public VPS. Implement these critical security measures before rolling out the platform to users:

  • Implement a Reverse Proxy: Use Nginx, Caddy, or Traefik in front of Metabase to manage SSL/TLS certificates (via Let's Encrypt), ensuring all traffic is encrypted over HTTPS.
  • Firewall Configuration: Use UFW (Uncomplicated Firewall) to block external access to ports 8123, 9000, and 5432. Only ports 80 (HTTP) and 443 (HTTPS) should be accessible to the public web.
  • Role-Based Access Control (RBAC): Within Metabase, group users by department (e.g., Marketing, Finance, Executive) and restrict database permissions so users only see the data relevant to their roles.

Conclusion

Building an advanced business analytics system using Metabase and ClickHouse on a VPS offers the ideal balance of performance, affordability, and customization. By shifting analytical workloads away from operational databases to a columnar model, you ensure that your business reporting remains lightning-fast even as your operations scale. Implementing this modern data architecture empowers your organization to uncover deep insights, democratize data access, and make agile, data-backed decisions without the burden of prohibitive licensing costs.

Building an Advanced Business Intelligence System: Deploying Metabase with ClickHouse on a VPS | DPTCloud