Metabase: BI Analytics Tool
Metabase is an open-source business intelligence tool. Teams can quickly explore and visualize data through its interface without SQL knowledge.
Metabase provides many chart types and connects to different databases. These features support enterprise data analysis.
The template defaults to metabase/metabase:v0.64.1.x. Use the single METABASE_IMAGE setting to override the full image reference. On 2026-10-08, the tag resolved to 0.64.1.1; validation on PostgreSQL 18.6 covered upgrading a restored metadata database, login, and querying an existing saved question.
Quick Start
Pigsty provides a Docker Compose configuration file for Metabase in the software template directory:
Review and modify the .env configuration file:
Before starting, create a dedicated metabase database and dbuser_metabase role matching the .env connection settings. Do not share the Pigsty CMDB database.
Start the service:
Access Metabase:
- Default URL: http://mtbs.pigsty
- Alternate URL: http://10.10.10.10:9004
- First-time access requires initial setup
Management Commands
Use these Makefile commands to manage Metabase:
Connect to PostgreSQL
Metabase can connect to PostgreSQL databases managed by Pigsty.
During Metabase initialization or when adding a database, select “PostgreSQL” and enter the connection information:
After connecting, Metabase scans the database schema automatically. You can then create questions and dashboards.
Features
- No SQL Required: Build queries through visual interface
- Rich Chart Types: Line, bar, pie, map charts, and more
- Interactive Dashboards: Create interactive data dashboards
- Auto Refresh: Schedule data and dashboard updates
- Permission Management: Fine-grained user and data access control
- SQL Mode: Advanced users can write SQL directly
- Embedding: Embed charts into other applications
- Alerting: Automatic notifications on data changes
Configuration
Metabase configuration is in the .env file:
Recommended: Use a dedicated PostgreSQL database for storing Metabase metadata.
Data Persistence
Metabase metadata (users, questions, dashboards, etc.) is stored in the configured database.
The template uses external PostgreSQL by default and does not configure a persistent /data/metabase directory for H2. Its /api/health check covers both the application and metadata database. Wait for healthy status during initial migrations.
Upgrading from Metabase 63 to 64 automatically migrates the metadata database. Back it up and record the old image digest first, then test on a restored copy. Rollback requires the matching database backup and old image; replacing the image alone does not undo database migrations. See the upgrade guide.
Performance Optimization
- Use PostgreSQL: Allocate separate resources for the metadata database and monitor its workload
- Increase Memory: Pass
JAVA_OPTSexplicitly in Compose’senvironmentto tune JVM memory; adding it to.envalone does not pass it into the container - Database Indexes: Create indexes for frequently queried fields
- Result Caching: Enable Metabase query result caching
- Scheduled Updates: Set reasonable dashboard auto-refresh frequency
Security Recommendations
- Change Default Credentials: Modify metadata database username and password
- Enable HTTPS: Configure SSL certificates for production
- Configure Authentication: Enable SSO or LDAP authentication
- Restrict Access: Limit access through firewall
- Regular Backups: Back up the Metabase metadata database
Related Links
- Metabase Website: https://metabase.com/
- Documentation: https://www.metabase.com/docs/
- GitHub Repository: https://github.com/metabase/metabase
- Pigsty Software Template: https://github.com/pgsty/pigsty/tree/main/app/metabase
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)