Metabase: BI Analytics Tool
Metabase is a fast, easy-to-use open-source business intelligence tool that lets your team explore and visualize data without SQL knowledge.
Metabase provides a friendly user interface with rich chart types and supports connecting to various databases, making it an ideal choice for enterprise data analysis.
Quick Start
Pigsty provides a Docker Compose configuration file for Metabase in the software template directory:
Review and modify the .env configuration file:
Start the service:
Access Metabase:
- Default URL: http://metabase.pigsty
- Alternate URL: http://10.10.10.10:3001
- First-time access requires initial setup
Management Commands
Pigsty provides convenient 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 successful connection, Metabase will automatically scan the database schema, and you can start creating 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 beautiful 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.
If using H2 database (default), data is saved in the /data/metabase directory. Using PostgreSQL as the metadata database is strongly recommended for production environments.
Performance Optimization
- Use PostgreSQL: Replace the default H2 database
- Increase Memory: Add JVM memory with
JAVA_OPTS=-Xmx4g - 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)