Metabase Setup: From Install to First DashboardMetabase is an open-source business intelligence (BI) tool that makes analytics accessible to non-technical users while still offering power users the flexibility they need. This guide walks you step-by-step from installation to creating your first dashboard. It covers system requirements, installation options, database connections, basic querying, visualizations, and sharing. By the end you’ll have a functioning Metabase instance and a dashboard you can build on.
Before you start — prerequisites and planning
- System requirements: Metabase runs on the JVM and needs Java 11+ (if using the JAR), recommended 1–2 GB RAM for small teams, and more for production.
- Data source: Decide which database(s) you’ll connect (Postgres, MySQL, Snowflake, BigQuery, SQLite, etc.). Ensure network access and a read-only user if possible.
- Deployment choice: Quick local test vs. production deployment. For production consider Docker, Kubernetes, or a managed service and a persistent application database (Postgres recommended).
- Security & backups: Plan HTTPS, authentication (LDAP/SSO if needed), and backups for Metabase application DB and any config files.
Installation options
1) Docker (recommended for most)
Docker provides isolation and reproducibility.
Basic docker-compose example:
version: '3' services: metabase: image: metabase/metabase:latest ports: - "3000:3000" environment: - MB_DB_TYPE=postgres - MB_DB_HOST=db - MB_DB_PORT=5432 - MB_DB_DBNAME=metabase - MB_DB_USER=metabase_user - MB_DB_PASS=metabase_password depends_on: - db db: image: postgres:13 environment: POSTGRES_DB: metabase POSTGRES_USER: metabase_user POSTGRES_PASSWORD: metabase_password volumes: - ./metabase-db:/var/lib/postgresql/data
Start with: docker-compose up -d
2) Jar file (quick local run)
Download metabase.jar from Metabase site and run:
java -jar metabase.jar
Visit http://localhost:3000
3) Cloud / Managed
Use Metabase Cloud or host on cloud VMs/containers (AWS, GCP, Azure). Managed options reduce operational overhead.
4) Kubernetes / Helm
For scalable production deployments, use the official Helm chart or a custom manifest with a dedicated Postgres and persistent volumes.
Initial setup and admin account
- Open Metabase in your browser (default http://localhost:3000).
- Create the initial admin user (email, password).
- Configure basic settings: site name, instance timezone, SMTP for alerting if needed.
- Connect a persistent application database (if not done via environment variables). Postgres is recommended over H2 for production.
Connecting your data source
- In the Admin Panel → Databases → Add database.
- Choose the type (Postgres, MySQL, etc.), fill host, port, database name, username, password.
- Set the data model options:
- Schema visibility (restrict to relevant schemas).
- Sync and scan frequency: Sync imports table/field metadata; scanning determines field types and values.
- Save and wait for sync/scan to complete.
Tips:
- Use a read-only user for analytics.
- For large datasets, increase sync intervals and use table-level exclusions to avoid heavy scans.
- For warehouses (BigQuery, Snowflake), consider using query caching and warehouse-specific integrations.
Understanding Metabase basics
- Question: A single query or visualization built with the query builder or SQL editor.
- Dashboard: A collection of questions (cards) arranged on a canvas.
- Collections: Organize dashboards, questions, and pulses (alerts).
- Segment & Metric: Reusable definitions for common filters or measures.
- Pulses: Scheduled reports delivered via email or Slack.
Creating your first question
Option A — Using the GUI query builder (recommended for beginners)
- Click “Ask a question” → Simple question.
- Select your table.
- Choose filter(s), summarise by field, and pick visualization type (Table, Bar, Line, Pie, etc.).
- Save the question with a descriptive name and collection.
Example: Count of orders per day
- Table: orders
- Summarize → Count of rows
- Group by → Created_at → by day
- Visualization → Line chart
Option B — Using SQL
- Click “Ask a question” → Native query.
- Write SQL and run.
- Use variables for interactive filters: {{start_date}} with type = Date.
- Visualize the result and save.
Example SQL:
SELECT date_trunc('day', created_at) AS day, count(*) AS orders FROM orders WHERE created_at >= {{start_date}} GROUP BY 1 ORDER BY 1;
Building your first dashboard
- Create a new dashboard (New → Dashboard).
- Add your saved questions (cards) by clicking “Add” → Existing question.
- Arrange and resize cards; add text boxes for context.
- Add filters to the dashboard:
- Date filters, category filters, and hook them to cards by mapping dashboard filter to question field.
- Use dashboard settings to adjust refresh intervals and permissions.
Practical layout example:
- Top row: KPI cards (Total Users, New Signups today, Revenue today).
- Middle: Time series for key metrics (signups, revenue trends).
- Bottom: Table or top-N lists (top products, regions).
Sharing, permissions, and embedding
- Sharing:
- Direct link to dashboard (requires login unless public sharing enabled).
- Public embedding: Create a public sharing link or use signed embedding for secure external embeds.
- Permissions:
- Use Collections and Group-level permissions to restrict access to specific dashboards/questions.
- Admins can define metadata editing vs data viewing rights.
- Embedding:
- Signed embedding requires an embedding secret in admin settings; used for secure web app integration.
Alerts, pulses, and subscriptions
- Pulses: Set up scheduled snapshots of questions and send to email or Slack.
- Alerts: Set threshold-based notifications on question visualizations to trigger messages when metrics cross a value.
- Configure SMTP/Slack in Admin → Notifications.
Performance and maintenance tips
- Use a dedicated Postgres instance for Metabase application metadata (avoid H2 in production).
- Allocate sufficient memory to Metabase (JVM options) for large data volumes.
- Tune sync/scan frequency and exclude very large tables from scans.
- Use query results caching and database optimizations (indexes) for expensive queries.
- Monitor logs and set up alerting for instance health.
Troubleshooting common issues
- Slow dashboards: investigate slow SQL, add indexes, or materialize expensive queries in the database.
- Missing fields/incorrect types: re-sync the database schema; add custom field types if needed.
- Permissions problems: check Collection and Group permissions; confirm user roles.
- Email alerts not sending: verify SMTP settings and firewall access.
Example workflow: From zero to dashboard in 30 minutes
- Deploy Metabase via Docker (10 min).
- Create admin account and connect a test Postgres (5–10 min).
- Ask a simple question (count orders by day) using GUI (5 min).
- Save question and create dashboard; add the question and a KPI card (5–10 min).
- Share with a teammate or set up a pulse (2–5 min).
Further reading and next steps
- Configure SSO (Google/Okta/SAML) for enterprise authentication.
- Build derived tables or use database views for complex metrics.
- Explore Metabase embedding for customer-facing analytics.
- Automate backups for both application DB and Metabase configs.
If you want, I can provide a ready-to-run docker-compose tuned for production, example SQL for common ecommerce metrics, or step-by-step screenshots for the GUI. Which would you prefer?
Leave a Reply