Skip to content
Star
478
Star
478

Metabase

This guide shows you how to work with Metabase locally using Docker Compose, PostgreSQL, and SQLAlchemy. This lab demonstrates how to insert data into a PostgreSQL database and explore it using Metabase.

  1. Setup Environment:

    Open VS Code in the project folder and execute this command in the Command Palette:

    Terminal window
    > Dev Containers: Reopen in Container
  2. Start Infrastructure: Launch Metabase and PostgreSQL:

    Terminal window
    docker compose up -d
  3. Run the Example:

    Terminal window
    python main.py
  1. Open the Metabase UI:
    Terminal window
    http://localhost:3000
  2. Complete the initial setup and create an admin account.
  3. Connect PostgreSQL using the credentials defined in .env (METABASE_DB, METABASE_USER, METABASE_PASSWORD, POSTGRES_HOST, POSTGRES_PORT).
  4. Explore the products table and create visualizations.
Terminal window
docker compose down -v
IssueSolution
Port 3000 or 5432 in useChange the port mapping in docker-compose.yml and restart.
Metabase not loadingWait for initialization — check logs: docker compose logs -f metabase (look for “Initialization COMPLETE”).
Connection RefusedEnsure both containers are running: docker ps
Module Not FoundReinstall dependencies: pip3 install uv && uv sync