Self-host SuperTokens with Levelrail

A self-hosted authentication backend with session management, social login, and passwordless, backed by Postgres.

  • Authorsupertokens
  • LicenceApache-2.0
  • Memory256 MiB
  • Archarm64
  • Services2

How to self-host SuperTokens

  1. Pull the images

    2 images are pulled on your server.

    Show images
    • postgres:16-alpine
    • registry.supertokens.io/supertokens/supertokens-postgresql:latest
  2. Create the app

    2 services start in a single Compose app, with 1 named volume mount for your data, on port 3567.

  3. Fill in the secrets

    3 secrets are generated and stored encrypted, 2 settings are preset, you do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

SuperTokens requirements

Memory
About 256 MiB
Architectures
amd64 image published, arm64 image published
Ports
3567
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
Apache-2.0, permissive license
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
  • Host ports. It publishes port 3567 on the host, so open them in the VPS firewall only if you want that.
  • Review. Image is not pinned to a version tag, so a redeploy can pull different code (registry.supertokens.io/supertokens/supertokens-postgresql:latest).

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then SuperTokens. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the SuperTokens docs page.

Deploy SuperTokens your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy SuperTokens from the CLI

levelrail-cli templates deploy supertokens --name my-supertokens

Deploy SuperTokens with the API

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/supertokens/deploy

SuperTokens configuration

SuperTokens services

ServiceImagePortsVolumes
postgres postgres:16-alpine none supertokens_postgres_data -> /var/lib/postgresql/data
supertokens registry.supertokens.io/supertokens/supertokens-postgresql:latest 3567 none

SuperTokens environment variables

VariableServiceValue
POSTGRES_DB postgres Preset by the template
POSTGRES_PASSWORD postgres Generated at deploy
POSTGRES_USER postgres Preset by the template
API_KEYS supertokens Generated at deploy
POSTGRESQL_CONNECTION_URI supertokens Generated at deploy

Ports and volumes

Ports
3567
Volumes
1 named mount: supertokens_postgres_data -> /var/lib/postgresql/data

SuperTokens FAQ

How much memory does SuperTokens need?

The catalog lists about 256 MiB of memory for SuperTokens across its 2 services.

Does SuperTokens run on arm64?

For SuperTokens, an arm64 image is published; amd64 is image published.

What licence is SuperTokens under?

SuperTokens is licensed under Apache-2.0, which is permissive, with few conditions on reuse.

Does SuperTokens need configuration before it starts?

No. The template fills in its own defaults and generates secrets at deploy time.

Which database does SuperTokens bundle?

The template includes Postgres, running as its own service.

Which ports does SuperTokens use?

SuperTokens listens on port 3567 inside the stack.

Where does SuperTokens keep its data?

In a named volume: supertokens_postgres_data mounted at /var/lib/postgresql/data.

Can I deploy SuperTokens on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for SuperTokens, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image postgres:16-alpine, registry.supertokens.io/supertokens/supertokens-postgresql:latest is what you deploy there.

levelrail-cli templates deploy supertokens --name my-supertokens