
Deploy SuperTokens Core Auth
SuperTokens auth core on PostgreSQL with a required, generated API key
Data
PostgreSQL
Just deployed
/var/lib/postgresql
Auth
SuperTokens
Just deployed
Deploy and Host SuperTokens Core Auth on Railway
SuperTokens is open-source authentication. Its core service stores users, password hashes and sessions, and your backend calls it through a SuperTokens SDK for Node.js, Python or Go to sign users up and in (email and password, passwordless codes, social providers) and to create, verify, refresh and revoke sessions.
About Hosting SuperTokens Core Auth
The template runs SuperTokens core 12.5.0 from the official supertokens/supertokens-postgresql image and PostgreSQL 18, both pinned by digest. PostgreSQL is private and keeps everything on a 5 GB volume; the core is public over HTTPS so a backend anywhere can reach it, or a backend in the same project can use the private address. Every core API except health checks and the public signing keys requires the generated API key, and the core refuses to start without one, so no deployment runs an open auth server. The template runs only the Apache-2.0 core; SuperTokens' paid features (account linking, multi-tenancy, MFA, SAML, OAuth2 provider) stay disabled.
Why Deploy SuperTokens Core Auth on Railway
Railway gives the core an HTTPS domain, private networking to PostgreSQL, a persistent volume, generated secrets and health-checked deploys. The core reconnects to PostgreSQL after restarts, and users, sessions and signing keys survive redeploys because they live in the database.
Common Use Cases
- Add email and password, passwordless or social sign-in to a web or mobile app without a hosted auth vendor
- Run session management (rotating refresh tokens, revocation) for an API backend
- Self-host the auth core for staging or a small production app while keeping user data in your own database
Dependencies for SuperTokens Core Auth Hosting
The deployment uses SuperTokens core (source) and PostgreSQL.
Deployment Dependencies
- SuperTokens core 12.5.0 with its PostgreSQL plugin
- PostgreSQL 18 with a 5 GB Railway volume
- A backend that uses a SuperTokens SDK, configured with the core's URL and the
API_KEYSvalue from the SuperTokens service variables
Template Content
SuperTokens
supertokens/supertokens-postgresql:12.5.0PostgreSQL
postgres:18.7-alpine
