Metabase Analytics Platform
Metabase BI tool with PostgreSQL backend for self-service analytics.
[i]Overview
Metabase is an open-source business intelligence platform that transforms raw data into interactive dashboards, reports, and visualizations without requiring SQL knowledge. Created in 2015, Metabase democratizes data analytics by providing a user-friendly interface that enables non-technical users to explore data, create charts, and build comprehensive dashboards through intuitive drag-and-drop functionality. Its self-service approach eliminates the bottleneck of waiting for technical teams to generate reports, empowering business users to answer their own questions with data.
This configuration pairs Metabase with PostgreSQL as its application database, creating a robust analytics platform where PostgreSQL stores Metabase's metadata, user accounts, dashboard definitions, and cached query results. PostgreSQL's advanced SQL capabilities, ACID compliance, and excellent performance characteristics make it an ideal backend for Metabase's complex metadata operations and concurrent user sessions. The combination leverages PostgreSQL's reliability for storing critical business intelligence configurations while Metabase connects to your various data sources for analysis.
This stack serves organizations seeking to implement self-service business intelligence without the complexity and cost of enterprise BI solutions like Tableau or Power BI. Small to medium businesses, startups with growing data needs, and teams requiring quick insights from multiple databases will find this combination particularly valuable. The setup provides enterprise-grade analytics capabilities while maintaining the flexibility to scale and integrate with existing data infrastructure.
[*]Key Features
- [+]Interactive dashboard builder with 40+ visualization types including maps, funnels, and pivot tables
- [+]SQL query interface with visual query builder for users without SQL expertise
- [+]Automated email and Slack alerts based on data thresholds and schedules
- [+]Multi-database connectivity supporting MySQL, PostgreSQL, MongoDB, BigQuery, and 20+ other sources
- [+]User permission system with collection-based access control and row-level security
- [+]Embedded analytics with signed embedding for integrating dashboards into applications
- [+]PostgreSQL-powered metadata storage ensuring ACID compliance for user configurations and cached results
- [+]Mobile-responsive dashboards accessible on tablets and smartphones
[#]Common Use Cases
- [1]SaaS companies tracking key metrics like MRR, churn rate, and user engagement across multiple databases
- [2]E-commerce businesses monitoring sales performance, inventory levels, and customer behavior analytics
- [3]Marketing teams analyzing campaign performance, lead conversion rates, and ROI across advertising platforms
- [4]Operations teams creating real-time dashboards for monitoring system performance and business KPIs
- [5]Financial reporting and budget tracking with automated monthly and quarterly report generation
- [6]Customer success teams monitoring product usage, support ticket trends, and user satisfaction metrics
- [7]Startups needing affordable business intelligence without licensing costs of enterprise BI tools
[!]Prerequisites
- [!]Minimum 2GB RAM recommended for concurrent users and dashboard rendering performance
- [!]Port 3000 available for Metabase web interface access
- [!]Basic understanding of your data sources and connection credentials for database setup
- [!]10GB+ disk space for PostgreSQL data storage and Metabase query caching
- [!]Network access to external databases you plan to connect for analysis
- [!]Docker and Docker Compose installed with ability to run persistent containers
[!]
WARNING: For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
[$]docker-compose.yml
[docker-compose.yml]
1services: 2 postgres: 3 image: postgres:16-alpine4 container_name: metabase-postgres5 restart: unless-stopped6 environment: 7 POSTGRES_USER: ${POSTGRES_USER:-metabase}8 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-metabase}9 POSTGRES_DB: ${POSTGRES_DB:-metabase}10 volumes: 11 - postgres_data:/var/lib/postgresql/data12 networks: 13 - metabase-network1415 metabase: 16 image: metabase/metabase:latest17 container_name: metabase18 restart: unless-stopped19 ports: 20 - "${METABASE_PORT:-3000}:3000"21 environment: 22 MB_DB_TYPE: postgres23 MB_DB_DBNAME: ${POSTGRES_DB:-metabase}24 MB_DB_PORT: 543225 MB_DB_USER: ${POSTGRES_USER:-metabase}26 MB_DB_PASS: ${POSTGRES_PASSWORD:-metabase}27 MB_DB_HOST: postgres28 depends_on: 29 - postgres30 networks: 31 - metabase-network3233volumes: 34 postgres_data: 3536networks: 37 metabase-network: 38 driver: bridge[$].env Template
[.env]
1# Metabase2METABASE_PORT=30003POSTGRES_USER=metabase4POSTGRES_PASSWORD=metabase5POSTGRES_DB=metabase[i]Usage Notes
- [1]Metabase at http://localhost:3000
- [2]Complete setup wizard on first run
- [3]Connect your data sources in settings
- [4]Create dashboards with drag-and-drop
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
postgres
postgres:
image: postgres:16-alpine
container_name: metabase-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-metabase}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-metabase}
POSTGRES_DB: ${POSTGRES_DB:-metabase}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- metabase-network
metabase
metabase:
image: metabase/metabase:latest
container_name: metabase
restart: unless-stopped
ports:
- ${METABASE_PORT:-3000}:3000
environment:
MB_DB_TYPE: postgres
MB_DB_DBNAME: ${POSTGRES_DB:-metabase}
MB_DB_PORT: 5432
MB_DB_USER: ${POSTGRES_USER:-metabase}
MB_DB_PASS: ${POSTGRES_PASSWORD:-metabase}
MB_DB_HOST: postgres
depends_on:
- postgres
networks:
- metabase-network
[>]Quick Start
[terminal]
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 postgres:5 image: postgres:16-alpine6 container_name: metabase-postgres7 restart: unless-stopped8 environment:9 POSTGRES_USER: ${POSTGRES_USER:-metabase}10 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-metabase}11 POSTGRES_DB: ${POSTGRES_DB:-metabase}12 volumes:13 - postgres_data:/var/lib/postgresql/data14 networks:15 - metabase-network1617 metabase:18 image: metabase/metabase:latest19 container_name: metabase20 restart: unless-stopped21 ports:22 - "${METABASE_PORT:-3000}:3000"23 environment:24 MB_DB_TYPE: postgres25 MB_DB_DBNAME: ${POSTGRES_DB:-metabase}26 MB_DB_PORT: 543227 MB_DB_USER: ${POSTGRES_USER:-metabase}28 MB_DB_PASS: ${POSTGRES_PASSWORD:-metabase}29 MB_DB_HOST: postgres30 depends_on:31 - postgres32 networks:33 - metabase-network3435volumes:36 postgres_data:3738networks:39 metabase-network:40 driver: bridge41EOF4243# 2. Create the .env file44cat > .env << 'EOF'45# Metabase46METABASE_PORT=300047POSTGRES_USER=metabase48POSTGRES_PASSWORD=metabase49POSTGRES_DB=metabase50EOF5152# 3. Start the services53docker compose up -d5455# 4. View logs56docker compose logs -f[>]One-Liner
Run this command to download and set up the recipe in one step:
[terminal]
1curl -fsSL https://docker.recipes/api/recipes/metabase-analytics/run | bash[?]Troubleshooting
- [!]Metabase shows 'Database connection failed' on startup: Check PostgreSQL container is fully initialized before Metabase starts, increase depends_on or add health checks
- [!]Out of memory errors during large query execution: Increase Docker container memory limits and adjust MB_JETTY_MAXTHREADS environment variable
- [!]Slow dashboard loading with multiple charts: Enable Metabase query caching and consider upgrading PostgreSQL shared_buffers configuration
- [!]Setup wizard redirects to localhost instead of server IP: Set MB_SITE_URL environment variable to your server's actual hostname or IP address
- [!]PostgreSQL connection pool exhausted errors: Adjust MB_DB_CONNECTION_TIMEOUT and ensure PostgreSQL max_connections setting accommodates concurrent users
Community Notes
Loading...
Loading notes...
## Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
## Components
metabasepostgresql
## Tags
#metabase#bi#analytics#dashboard#visualization
## Category
Database StacksShortcuts: C CopyF FavoriteD Download