Levelrail
Skip to content

Self-host SuperTokens with Docker ​

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

This page describes the Levelrail template for SuperTokens (Security). It deploys the services below as one Docker Compose app on your own server.

Project site: https://supertokens.com/docs/.

Recommended memory: about 256 MiB.

Services, ports and volumes ​

ServiceImageContainer portsVolumes
postgrespostgres:16-alpinenone
supertokens_postgres_data -> /var/lib/postgresql/data
supertokensregistry.supertokens.io/supertokens/supertokens-postgresql:latest3567none

Environment variables ​

ServiceVariableValue
postgresPOSTGRES_DBPreset in the template
postgresPOSTGRES_PASSWORDGenerated at deploy
postgresPOSTGRES_USERPreset in the template
supertokensAPI_KEYSPreset in the template
supertokensPOSTGRESQL_CONNECTION_URIGenerated at deploy

Passwords and keys marked as generated are created for you when the app is deployed and stored as secrets. Values are not shown here.

Deploy SuperTokens with Levelrail ​

In the dashboard, open Apps, choose New app, then Browse templates, and select SuperTokens. Review the Compose body and deploy.

With the CLI:

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

See Service template catalog for how templates work, and Getting started if you have not installed Levelrail yet.

More Security templates ​

All templates are listed in the self-host gallery.

Released under the Apache 2.0 License.