Skip to content

Deploying a Superset App

Introduction

Apache Superset is an open-source data exploration and visualization platform. Deploying Superset with a Dockerfile on Klutch.sh provides reproducible builds, managed secrets, and persistent storage—all configured from klutch.sh/app. This guide covers installation, Dockerfile setup, environment variables, storage, Nixpacks overrides, and sample checks to verify your deployment.


Prerequisites

  • A Klutch.sh account (sign up)
  • A GitHub repository containing your Superset Dockerfile (GitHub is the only supported git source)
  • External PostgreSQL (metadata) and Redis (cache/celery)
  • Domain and TLS for secure access

Architecture and ports

  • Superset serves HTTP on internal port 8088. Choose HTTP traffic and set the internal port to 8088.
  • Persistent storage is required for logs and local artifacts; primary metadata lives in Postgres and Redis.

Repository layout

superset/
├── Dockerfile # Must be at repo root for auto-detection
└── README.md

Keep secrets out of Git; store them in Klutch.sh environment variables.


Installation (local) and starter commands

Build and run locally (ensure Postgres/Redis are reachable):

Terminal window
docker build -t superset-local .
docker run -p 8088:8088 \
-e SUPERSET_SECRET_KEY=$(openssl rand -hex 32) \
-e SUPERSET_CONFIG_PATH=/app/pythonpath/superset_config.py \
-e DATABASE_URL=postgresql+psycopg2://user:pass@localhost:5432/superset \
-e REDIS_URL=redis://localhost:6379/0 \
superset-local

Dockerfile for Superset (production-ready)

Place this at the repo root; Klutch.sh auto-detects Dockerfiles.

FROM apache/superset:latest
ENV SUPERSET_HOME=/app
ENV SUPERSET_PORT=8088
EXPOSE 8088
CMD ["/usr/bin/run-server.sh"]

Notes:

  • Pin to a specific tag (e.g., apache/superset:3.0.1) for stability.
  • Ensure run-server.sh is present in the base image; adjust if you use a custom entrypoint.

Environment variables (Klutch.sh)

Set these before deploying:

  • PORT=8088
  • SUPERSET_PORT=8088
  • SUPERSET_SECRET_KEY=<secure-random-hex>
  • DATABASE_URL=postgresql+psycopg2://<user>:<password>@<host>:5432/<db>
  • REDIS_URL=redis://<host>:6379/0
  • Optional: SUPERSET_CONFIG_PATH=/app/pythonpath/superset_config.py if you ship custom config

If deploying without the Dockerfile and relying on Nixpacks:

  • NIXPACKS_START_CMD=/usr/bin/run-server.sh

Attach persistent volumes

Add storage in Klutch.sh (path and size only):

  • /app/superset_home — logs, local artifacts, and any custom config.

Ensure the path is writable inside the container.


Deploy Superset on Klutch.sh (Dockerfile workflow)

  1. Push your repository—with the Dockerfile at the root—to GitHub.
  2. Open klutch.sh/app, create a project, and add an app.
  3. Select HTTP traffic and set the internal port to 8088.
  4. Add the environment variables above (DB, Redis, secret key, optional config path).
  5. Attach a volume at /app/superset_home sized for logs and local artifacts.
  6. Deploy. Access Superset at https://example-app.klutch.sh and finish the initial setup.

Sample checks

Landing page:

Terminal window
curl -I https://example-app.klutch.sh

API status (requires auth; replace credentials/token):

Terminal window
curl -u admin:admin https://example-app.klutch.sh/health

Health checks and production tips

  • Add an HTTP readiness probe to /health.
  • Keep Postgres/Redis credentials and SUPERSET_SECRET_KEY in Klutch.sh secrets; rotate regularly.
  • Pin image versions and test upgrades in staging before production rollout.
  • Back up Postgres; persist /app/superset_home if you store custom config or logs there.

Superset on Klutch.sh delivers reproducible Docker builds, managed secrets, and persistent storage—without extra YAML or CI steps. Configure ports, env vars, and storage, then launch your analytics platform.