---
title: "Deploy Apache Superset + Postgres/Redis"
description: "Apache Superset BI with Postgres, Redis, and persistent volumes."
category: "Analytics"
url: https://railway.com/deploy/apache-superset-postgresredis
---

# Deploy Apache Superset + Postgres/Redis

Apache Superset BI with Postgres, Redis, and persistent volumes.

**[Deploy Apache Superset + Postgres/Redis on Railway](https://railway.com/template/apache-superset-postgresredis)**

- **Creator:** leodev
- **Category:** Analytics
- **Total deploys:** 1

## Template content

### postgres

- **Image:** postgres:17-alpine

### redis

- **Image:** redis:7-alpine
- **Start command:** `/bin/sh -c 'exec redis-server --appendonly yes --dir /data --requirepass "$REDIS_PASSWORD"'`

### superset

- **Image:** apache/superset:5.0.0-dev
- **Start command:** `/bin/sh -lc '
set -eu

mkdir -p /app/superset_home
cat >/app/superset_home/superset_config.py <<PY
import os

database_dialect = os.environ.get("DATABASE_DIALECT", "postgresql+psycopg2")
database_user = os.environ["DATABASE_USER"]
database_password = os.environ["DATABASE_PASSWORD"]
database_host = os.environ.get("DATABASE_HOST", "postgres.railway.internal")
database_port = os.environ.get("DATABASE_PORT", "5432")
database_db = os.environ.get("DATABASE_DB", "superset")

SQLALCHEMY_DATABASE_URI = f"{database_dialect}://{database_user}:{database_password}@{database_host}:{database_port}/{database_db}"
SECRET_KEY = os.environ["SUPERSET_SECRET_KEY"]
ENABLE_PROXY_FIX = True
PREFERRED_URL_SCHEME = "https"

redis_host = os.environ.get("REDIS_HOST", "redis.railway.internal")
redis_port = os.environ.get("REDIS_PORT", "6379")
redis_password = os.environ["REDIS_PASSWORD"]
redis_cache_db = int(os.environ.get("REDIS_CACHE_DB", "2"))
redis_celery_db = os.environ.get("REDIS_CELERY_DB", "0")
redis_results_db = os.environ.get("REDIS_RESULTS_DB", "1")

CACHE_CONFIG = {
    "CACHE_TYPE": "RedisCache",
    "CACHE_DEFAULT_TIMEOUT": 300,
    "CACHE_KEY_PREFIX": "superset_",
    "CACHE_REDIS_HOST": redis_host,
    "CACHE_REDIS_PORT": int(redis_port),
    "CACHE_REDIS_PASSWORD": redis_password,
    "CACHE_REDIS_DB": redis_cache_db,
}
DATA_CACHE_CONFIG = CACHE_CONFIG
FILTER_STATE_CACHE_CONFIG = CACHE_CONFIG
EXPLORE_FORM_DATA_CACHE_CONFIG = CACHE_CONFIG

class CeleryConfig:
    broker_url = f"redis://:{redis_password}@{redis_host}:{redis_port}/{redis_celery_db}"
    result_backend = f"redis://:{redis_password}@{redis_host}:{redis_port}/{redis_results_db}"

CELERY_CONFIG = CeleryConfig
PY

export SUPERSET_CONFIG_PATH=/app/superset_home/superset_config.py
/app/.venv/bin/superset db upgrade
/app/.venv/bin/superset fab create-admin \
  --username "$SUPERSET_ADMIN_USERNAME" \
  --firstname "$SUPERSET_ADMIN_FIRSTNAME" \
  --lastname "$SUPERSET_ADMIN_LASTNAME" \
  --email "$SUPERSET_ADMIN_EMAIL" \
  --password "$SUPERSET_ADMIN_PASSWORD" || true
/app/.venv/bin/superset init

exec /app/.venv/bin/gunicorn \
  --bind "0.0.0.0:${PORT:-8088}" \
  --workers "${SUPERSET_WEBSERVER_WORKERS:-2}" \
  --timeout "${SUPERSET_WEBSERVER_TIMEOUT:-120}" \
  "superset.app:create_app()"
'`
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host Apache Superset + Postgres/Redis on Railway

Self-host Apache Superset, an open-source Tableau alternative, with Postgres metadata storage, Redis cache, persistent volumes, and generated admin credentials.

## About Hosting Apache Superset + Postgres/Redis on Railway

- `superset`: public Superset web service with Gunicorn on port `8088`
- `postgres`: private metadata database
- `redis`: private cache service
- Generated secret key, admin password, database password, and Redis password
- `/health` healthcheck
- No example-data bloat by default

## Why Deploy Apache Superset + Postgres/Redis on Railway

The source and published-template validation completed on 2026-05-23, and cleanup removed the source/test projects after verification. The template avoids SQLite metadata storage and keeps Postgres/Redis private.

## Common Use Cases

- Internal BI dashboards
- SQL exploration
- Lightweight open-source Tableau/Looker evaluation
- Teams that want a persistent Superset metadata database on Railway

## Dependencies for Apache Superset + Postgres/Redis Hosting

Superset depends on Postgres for metadata, Redis for cache, a generated secret key, a generated admin account, and persistent writable paths for the app and cache service.

### Deployment Dependencies

- `SUPERSET_SECRET_KEY`: generated Superset secret
- `SUPERSET_ADMIN_USERNAME`: initial admin username
- `SUPERSET_ADMIN_PASSWORD`: generated initial admin password
- `DATABASE_URL`: private Postgres metadata connection
- `REDIS_URL`: private Redis cache connection
- `PORT`: Railway public routing port for Superset

## After Deploy

1. Open the Superset public URL.
2. Sign in with the generated admin credentials.
3. Add database connections from inside Superset.
4. Keep Postgres and Redis private.

## Support Checklist

If a deploy fails, include `superset`, `postgres`, and `redis` deployment IDs, `/health` output, and logs mentioning migrations, secret key, or admin bootstrap.


## Similar templates

- [Matomo Analytics + MariaDB](https://railway.com/deploy/matomo-analytics-mariadb) — Privacy-friendly analytics with MariaDB and persistent volumes.
- [Bugsink](https://railway.com/deploy/bugsink) — Self-hosted Error Tracking. Sentry-SDK compatible
- [SubTrackr](https://railway.com/deploy/bscottsubtrackr) — Self-hosted Subscription Tracker

Open this page in a browser: https://railway.com/deploy/apache-superset-postgresredis
