Skip to main content
Docker is the recommended way to deploy SuperTokens Core. This guide covers Docker deployment, configuration, and best practices.

Official Docker Images

SuperTokens provides official Docker images for each database type:
  • supertokens/supertokens-postgresql - PostgreSQL backend
  • supertokens/supertokens-mysql - MySQL backend
  • supertokens/supertokens-mongodb - MongoDB backend (Enterprise)
Docker Hub: https://hub.docker.com/u/supertokens

Quick Start

PostgreSQL

MySQL

Verify Installation

Docker Compose Examples

Complete Stack with PostgreSQL

docker-compose.yml:

Complete Stack with MySQL

Production-Ready Configuration

.env file:

Environment Variables

All configuration options can be set via environment variables:

Core Settings

Database

Security

Tokens

Password Hashing

Logging

Telemetry

Volume Mounts

Custom Configuration File

Persistent Logs

Docker Commands

Start Services

View Logs

Check Health

Restart Services

Stop and Remove

Update Images

Multi-Container Scaling

Horizontal Scaling with Docker

nginx.conf for load balancing:

Docker Swarm Deployment

Deploy:

Kubernetes Deployment

For Kubernetes, use Helm charts or kubectl:

Security Best Practices

Use Secrets Management

Non-Root User

SuperTokens images run as non-root user supertokens by default.

Read-Only Root Filesystem

Network Isolation

Monitoring with Docker

Health Checks

Resource Monitoring

Integration with Prometheus

See Monitoring guide for detailed setup.

Troubleshooting

Container Won’t Start

Database Connection Issues

Performance Issues

Reset Everything

Next Steps