How to Install Metabase Business Intelligence on Docker

How to Install Metabase Business Intelligence on Docker

Bitnesia Software Mar 25, 2026 161 ID

In the current era of big data, data is a company’s most valuable asset. However, raw data piling up in databases is useless without proper visualization. Companies need Business Intelligence (BI) tools to turn numbers into actionable insights. The challenge is that many BI tools on the market are expensive, complex, and require deep technical expertise just to create a single chart.

This is why Metabase has become a favorite among startups to enterprise companies. Metabase democratizes data access, allowing anyone, from the CEO to operational staff to ask questions of their data and get visual answers in seconds.

What Is Metabase?

Metabase is the fastest and easiest-to-install open-source Business Intelligence (BI) tool. Metabase serves as a visual interface connecting you to various databases (such as PostgreSQL, MySQL, MongoDB, BigQuery, and others). Broadly speaking, Metabase covers two main functions:

  1. Business Intelligence (BI): Metabase allows internal teams to create dashboards, track KPIs, and explore data without needing to write complex SQL syntax (although an SQL editor is still available for power users). The basic concept centers on “Questions” (queries about data), “Visualizations” (charts), and “Collections” (dashboard groupings).
  2. Embedded Analytics: Metabase allows application developers to embed interactive charts and dashboards directly into their own applications or products.

Key Features of Metabase

Why is Metabase so popular in the developer and data analyst communities? Here are its key features:

  • Visual Query Builder: A “drag-and-drop” feature that allows non-technical users to join, filter, and aggregate data without touching SQL code.
  • SQL Editor: For data analysts, an advanced SQL editor is available with variable and snippet features for complex queries.
  • Interactive Dashboards: Combine various charts on one screen with interactive filters that can change the entire data view in real-time.
  • Alerts & Pulses: Get automatic notifications via Email or Slack when specific metrics reach a threshold or send periodic reports.
  • Data Dictionary: Document the meaning of every table and column so the team has a shared understanding of data definitions.

Metabase Open Source Edition

Metabase offers an Open Source Edition that is completely free. This version is very powerful and sufficient for most business needs. With this version, you get core BI features, self-hosting capabilities with unlimited users, and full control over your data as it runs on your own infrastructure.

Self-Hosted Metabase Guide with Docker

The best, cleanest, and easiest way to run Metabase in a production environment is using Docker.

In this guide, we will use a production-ready configuration where Metabase’s internal database (which stores user accounts, dashboards, and configurations) uses PostgreSQL, rather than the default H2 database which is prone to data loss if the container is removed.

System Requirements

Metabase is Java-based, so it requires sufficient memory.

  • RAM: Minimum 2 GB (4 GB recommended for smooth performance).
  • CPU: 2 vCPU.
  • Software: Docker & Docker Compose.
  • This tutorial uses the Ubuntu LTS operating system.

Install Docker

Ensure your system is up to date and install Docker using the installer script:

apt update 
apt upgrade -y
curl -fsSL https://get.docker.com | sh

Project Directory Preparation

Create a specific folder to store Metabase configurations and data:

mkdir metabase-docker
cd metabase-docker

Create Docker Compose File

Create a docker-compose.yml file to define the Metabase service and the PostgreSQL database.

nano docker-compose.yml

Fill it with the following configuration. This configuration connects Metabase to a separate PostgreSQL container for secure metadata storage:

services:
  metabase:
    image: metabase/metabase:latest
    container_name: metabase
    hostname: metabase
    volumes:
      - /dev/urandom:/dev/random:ro
    ports:
      - 3000:3000
    environment:
      MB_DB_TYPE: postgres
      MB_DB_DBNAME: metabaseappdb
      MB_DB_PORT: 5432
      MB_DB_USER: metabase
      MB_DB_PASS: mysecretpassword
      MB_DB_HOST: postgres
    networks:
      - metanet1
    healthcheck:
      test: curl --fail -I http://localhost:3000/api/health || exit 1
      interval: 15s
      timeout: 5s
      retries: 5
    depends_on:
      - postgres

  postgres:
    image: postgres:16
    container_name: postgres
    hostname: postgres
    environment:
      POSTGRES_USER: metabase
      POSTGRES_DB: metabaseappdb
      POSTGRES_PASSWORD: mysecretpassword
    volumes:
      - ./pg_data:/var/lib/postgresql/data
    networks:
      - metanet1

networks:
  metanet1:
    driver: bridge

Run Metabase

Execute the following command to download images and run the services in the background:

docker compose up -d

Wait a few minutes when running for the first time as Metabase needs to initialize the database schema.

Configure Nginx Reverse Proxy

To make Metabase accessible using a domain (e.g., analytics.yourdomain.com) instead of just an IP address, use Nginx.

Install Nginx:

apt install nginx -y

Create a server block configuration file:

nano /etc/nginx/sites-available/metabase.conf

Fill it with the following configuration:

server {
    listen 80;
    server_name analytics.yourdomain.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Enable the configuration and restart Nginx:

sudo ln -s /etc/nginx/sites-available/metabase.conf /etc/nginx/sites-enabled/
sudo systemctl restart nginx

Install certbot:

apt install certbot python3-certbot-nginx -y 

Request SSL:

sudo certbot --non-interactive \
-m [email protected] \
--agree-tos \
--no-eff-email \
--nginx -d analytics.yourdomain.com \
--redirect

Access Metabase

After installation is complete, open your browser and access https://analytics.yourdomain.com. The next step is to create an administrator account and connect to your database.

Conclusion

Metabase is a smart solution for organizations wanting to build a data-driven culture without expensive license fees. With self-hosted capabilities using Docker, you gain full control over data privacy and infrastructure flexibility. Whether you are a startup founder wanting to track user growth, or an engineer wanting to provide dashboards for the marketing team, Metabase is the elegant bridge between raw data and strategic business decisions.

Help me create more! Your donations go directly toward better equipment and research for future tutorials.

Support future guides

Related Posts