Production
Use this page as the operational checklist for a production-grade self-hosted deployment.
Deployment Model
- Run the official image
ghcr.io/juspay/superposition:latest. - Put the app behind HTTPS before exposing it outside a private network.
- Keep PostgreSQL shared across all replicas.
- Use a shared Redis instance if you enable
REDIS_URLand run multiple replicas. - Set a unique
WORKER_IDfor each running replica.
The application is mostly stateless, so horizontal scaling is straightforward as long as replicas share the same PostgreSQL database and Redis cache.
Security
- Do not expose deployments with
AUTH_PROVIDER=DISABLEDto the public internet. - Prefer OIDC for authentication on public or team-facing environments.
- Use Casbin if you need workspace and organisation-level authorization rules.
- Set
MASTER_ENCRYPTION_KEYbefore creating workspaces if you plan to use encrypted secrets. - Store production secret material in AWS KMS for
APP_ENV=PROD, or in your platform secret manager if you are running a plain-env self-hosted mode.
Database And Networking
- Create an empty PostgreSQL database and initialize the global schema before starting the app:
export DB_USER=superposition
export DB_PASSWORD='<database-password>'
export DB_HOST='postgres.example.com:5432'
export DB_NAME=superposition
export DATABASE_URL="postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}"
psql "$DATABASE_URL" -f superposition.sql
- Initialize the global schema with
superposition.sqlbefore starting a new deployment. - Run the latest
superposition.sqlagainst the target database before an upgrade. - Keep regular PostgreSQL backups and test restore procedures.
- Size
MAX_DB_CONNECTION_POOL_SIZE * replicasto fit your PostgreSQL capacity. - Treat Redis as an optimization, not a source of truth.
Upgrades
Use this sequence for production upgrades:
- Back up PostgreSQL.
- Review release notes for migration or environment changes.
- Run the latest
superposition.sqlagainst the target database. - Roll out the new Superposition image.
- Check
GET /health. - For existing workspaces, run the workspace schema migration endpoint when the
release changes
workspace_template.sql.
Workspace schema migration example:
curl -X POST "https://superposition.example.com/workspaces/<workspace>/db/migrate" \
-H "x-org-id: <organisation-id>"
Repeat the workspace migration for each workspace that should receive the new template changes.
Health And Operations
- Use
GET /healthfor load balancer and readiness checks. - Expect structured JSON logs through
RUST_LOGand the tracing subscriber. - If you use multiple replicas, verify each replica gets a unique
WORKER_ID. - Monitor PostgreSQL, Redis, and app pool saturation separately.
- Keep the admin UI and API on the same deployment surface unless you are intentionally fronting them with separate infrastructure.
For Helm-based cluster rollouts, see Kubernetes.