Metabase logoBusiness Intelligence

Metabase

A self-hosted business intelligence tool for creating charts and dashboards from databases without writing code.

Review notes

Defaults to H2 embedded database. Switch to PostgreSQL for production stability.

Deployment guide

Run a simple Docker container. Use PostgreSQL as the Metabase application database for production.

  1. Create a data directory for Metabase.
  2. Run the container with environment variables for database backend.
  3. Access the web UI at port 3000 and complete the setup wizard.
  4. Connect data sources (PostgreSQL, MySQL, etc.) for querying.
  5. Create questions and dashboards, set permissions for the team.
Backup:Back up the Metabase application database (PostgreSQL). All dashboards and questions are stored there.

Copy and run on your server

Use each block separately: save the compose file, or copy the bash script to create it and start the container.

docker-compose.ymlyaml
services:
  metabase:
    image: metabase/metabase:latest
    container_name: metabase
    environment:
      MB_DB_TYPE: postgres
      MB_DB_HOST: postgres
      MB_DB_PORT: "5432"
      MB_DB_DBNAME: metabase
      MB_DB_USER: metabase
      MB_DB_PASS: CHANGEME_db_password # CHANGE THIS
    ports:
      - "3000:3000"
    depends_on:
      - postgres
    restart: unless-stopped

  postgres:
    image: postgres:16-alpine
    container_name: metabase_postgres
    environment:
      POSTGRES_USER: metabase
      POSTGRES_PASSWORD: CHANGEME_db_password # CHANGE THIS
      POSTGRES_DB: metabase
    volumes:
      - ./postgres:/var/lib/postgresql/data
    restart: unless-stopped
setup.shbash
#!/usr/bin/env bash
set -euo pipefail

sudo mkdir -p /opt/metabase
sudo chown "$USER":"$USER" /opt/metabase
cd /opt/metabase

cat > docker-compose.yml <<'COMPOSE'
services:
  metabase:
    image: metabase/metabase:latest
    container_name: metabase
    environment:
      MB_DB_TYPE: postgres
      MB_DB_HOST: postgres
      MB_DB_PORT: "5432"
      MB_DB_DBNAME: metabase
      MB_DB_USER: metabase
      MB_DB_PASS: CHANGEME_db_password # CHANGE THIS
    ports:
      - "3000:3000"
    depends_on:
      - postgres
    restart: unless-stopped

  postgres:
    image: postgres:16-alpine
    container_name: metabase_postgres
    environment:
      POSTGRES_USER: metabase
      POSTGRES_PASSWORD: CHANGEME_db_password # CHANGE THIS
      POSTGRES_DB: metabase
    volumes:
      - ./postgres:/var/lib/postgresql/data
    restart: unless-stopped
COMPOSE

docker compose up -d
echo "Metabase is running on http://SERVER_IP:3000"

Stack

ClojureJavaDocker