docker.recipes

Apache Superset BI Platform

intermediate

Apache Superset for data exploration and visualization with Redis and PostgreSQL.

Overview

Apache Superset is a modern, enterprise-ready business intelligence web application that enables data exploration and visualization at scale. Originally developed by Airbnb and now an Apache Software Foundation project, Superset provides a rich set of data visualizations, an intuitive interface for exploring and visualizing datasets, and enterprise-grade authentication with integration to major authentication providers. It supports dozens of databases out of the box and can handle datasets of any size through its SQL Lab interface and visualization builder. This stack combines Superset with PostgreSQL as the metadata database and Redis for caching and session management. PostgreSQL stores Superset's application metadata, user permissions, dashboard configurations, and query results, while Redis accelerates performance by caching database queries, storing user sessions, and managing Celery task queues for asynchronous operations. This architecture ensures Superset can handle concurrent users efficiently while maintaining fast dashboard load times and responsive data exploration. Data teams, business analysts, and organizations seeking to democratize data access will benefit from this deployment. The PostgreSQL backend provides ACID compliance and reliability for storing critical dashboard configurations and user management data, while Redis ensures sub-millisecond response times for cached queries and session data. This combination is ideal for companies transitioning from proprietary BI tools like Tableau or PowerBI to open-source alternatives, or organizations building their first comprehensive data visualization platform.

Key Features

  • Rich visualization library with 40+ chart types including time-series, geospatial maps, and custom D3.js visualizations
  • SQL Lab interface for advanced data exploration with syntax highlighting, query history, and result export capabilities
  • Role-based access control with row-level security and column-level permissions for enterprise data governance
  • PostgreSQL metadata store ensuring ACID compliance for dashboard configurations and user management data
  • Redis-powered query result caching reducing database load and improving dashboard performance by up to 90%
  • Native database connectivity supporting 30+ data sources including Snowflake, BigQuery, MySQL, and Elasticsearch
  • Drag-and-drop dashboard builder with responsive layouts and embedded analytics capabilities
  • Asynchronous query execution using Redis-backed Celery queues for handling long-running analytical queries

Common Use Cases

  • 1Business intelligence platform for mid-size companies replacing expensive proprietary tools like Tableau or QlikView
  • 2Self-service analytics environment enabling non-technical users to create dashboards from existing data warehouses
  • 3Data exploration hub for data science teams analyzing large datasets stored in cloud data warehouses
  • 4Executive reporting system displaying KPIs and business metrics with automated refresh schedules
  • 5Customer-facing embedded analytics for SaaS applications requiring white-label dashboard functionality
  • 6Financial reporting and compliance dashboards with role-based access for different organizational levels
  • 7Marketing analytics platform connecting to Google Analytics, Facebook Ads, and CRM systems for unified reporting

Prerequisites

  • Minimum 4GB RAM recommended (2GB for Superset, 1GB for PostgreSQL, 512MB for Redis)
  • Port 8088 available for Superset web interface access
  • Docker Engine 20.10+ and Docker Compose 2.0+ for container orchestration
  • Basic SQL knowledge for connecting data sources and creating custom queries in SQL Lab
  • Understanding of your target database connection parameters (host, port, credentials) for data source configuration
  • 10GB+ available disk space for PostgreSQL metadata storage and Redis persistence

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-alpine
4 container_name: superset-postgres
5 restart: unless-stopped
6 environment:
7 POSTGRES_USER: ${POSTGRES_USER:-superset}
8 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-superset}
9 POSTGRES_DB: ${POSTGRES_DB:-superset}
10 volumes:
11 - postgres_data:/var/lib/postgresql/data
12 networks:
13 - superset-network
14
15 redis:
16 image: redis:alpine
17 container_name: superset-redis
18 restart: unless-stopped
19 volumes:
20 - redis_data:/data
21 networks:
22 - superset-network
23
24 superset:
25 image: apache/superset:latest
26 container_name: superset
27 restart: unless-stopped
28 ports:
29 - "${SUPERSET_PORT:-8088}:8088"
30 environment:
31 SUPERSET_SECRET_KEY: ${SUPERSET_SECRET_KEY:-changeme}
32 DATABASE_URL: postgresql://${POSTGRES_USER:-superset}:${POSTGRES_PASSWORD:-superset}@postgres:5432/${POSTGRES_DB:-superset}
33 REDIS_URL: redis://redis:6379/0
34 depends_on:
35 - postgres
36 - redis
37 networks:
38 - superset-network
39
40volumes:
41 postgres_data:
42 redis_data:
43
44networks:
45 superset-network:
46 driver: bridge

.env Template

.env
1# Apache Superset
2SUPERSET_PORT=8088
3SUPERSET_SECRET_KEY=your-secret-key-change-me
4POSTGRES_USER=superset
5POSTGRES_PASSWORD=superset
6POSTGRES_DB=superset

Usage Notes

  1. 1Superset at http://localhost:8088
  2. 2Initialize: docker exec superset superset-init
  3. 3Create admin: superset fab create-admin
  4. 4Connect databases via UI

Individual Services(3 services)

Copy individual services to mix and match with your existing compose files.

postgres
postgres:
  image: postgres:16-alpine
  container_name: superset-postgres
  restart: unless-stopped
  environment:
    POSTGRES_USER: ${POSTGRES_USER:-superset}
    POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-superset}
    POSTGRES_DB: ${POSTGRES_DB:-superset}
  volumes:
    - postgres_data:/var/lib/postgresql/data
  networks:
    - superset-network
redis
redis:
  image: redis:alpine
  container_name: superset-redis
  restart: unless-stopped
  volumes:
    - redis_data:/data
  networks:
    - superset-network
superset
superset:
  image: apache/superset:latest
  container_name: superset
  restart: unless-stopped
  ports:
    - ${SUPERSET_PORT:-8088}:8088
  environment:
    SUPERSET_SECRET_KEY: ${SUPERSET_SECRET_KEY:-changeme}
    DATABASE_URL: postgresql://${POSTGRES_USER:-superset}:${POSTGRES_PASSWORD:-superset}@postgres:5432/${POSTGRES_DB:-superset}
    REDIS_URL: redis://redis:6379/0
  depends_on:
    - postgres
    - redis
  networks:
    - superset-network

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 postgres:
5 image: postgres:16-alpine
6 container_name: superset-postgres
7 restart: unless-stopped
8 environment:
9 POSTGRES_USER: ${POSTGRES_USER:-superset}
10 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-superset}
11 POSTGRES_DB: ${POSTGRES_DB:-superset}
12 volumes:
13 - postgres_data:/var/lib/postgresql/data
14 networks:
15 - superset-network
16
17 redis:
18 image: redis:alpine
19 container_name: superset-redis
20 restart: unless-stopped
21 volumes:
22 - redis_data:/data
23 networks:
24 - superset-network
25
26 superset:
27 image: apache/superset:latest
28 container_name: superset
29 restart: unless-stopped
30 ports:
31 - "${SUPERSET_PORT:-8088}:8088"
32 environment:
33 SUPERSET_SECRET_KEY: ${SUPERSET_SECRET_KEY:-changeme}
34 DATABASE_URL: postgresql://${POSTGRES_USER:-superset}:${POSTGRES_PASSWORD:-superset}@postgres:5432/${POSTGRES_DB:-superset}
35 REDIS_URL: redis://redis:6379/0
36 depends_on:
37 - postgres
38 - redis
39 networks:
40 - superset-network
41
42volumes:
43 postgres_data:
44 redis_data:
45
46networks:
47 superset-network:
48 driver: bridge
49EOF
50
51# 2. Create the .env file
52cat > .env << 'EOF'
53# Apache Superset
54SUPERSET_PORT=8088
55SUPERSET_SECRET_KEY=your-secret-key-change-me
56POSTGRES_USER=superset
57POSTGRES_PASSWORD=superset
58POSTGRES_DB=superset
59EOF
60
61# 3. Start the services
62docker compose up -d
63
64# 4. View logs
65docker 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/superset-bi-platform/run | bash

Troubleshooting

  • Superset fails to start with 'database connection error': Run docker exec superset superset db upgrade to initialize the PostgreSQL metadata database schema
  • Login page shows 'Invalid login credentials' after setup: Execute docker exec -it superset superset fab create-admin to create the initial admin user account
  • Dashboards load slowly or timeout: Increase Redis memory allocation and verify Redis connectivity with docker exec superset-redis redis-cli ping
  • PostgreSQL connection refused errors: Check that POSTGRES_USER and POSTGRES_PASSWORD environment variables match between postgres and superset services
  • Superset shows blank page or JavaScript errors: Clear browser cache and ensure SUPERSET_SECRET_KEY environment variable is set to a secure random string
  • Query results not caching properly: Verify Redis service health and check Superset cache configuration in superset_config.py for proper Redis URL format

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

Ad Space