Keycloak on Railway

Open-source identity and access management with SSO, OIDC and SAML, running with Postgres on Railway.

Official site · License: Apache-2.0 · 12 Railway templates

Deploy Keycloak on RailwayCompare templates

Keycloak is an open-source identity and access management server. It provides single sign-on, OAuth 2.0 and OpenID Connect, and SAML 2.0 for your applications, with user federation, social login and multi-factor authentication.

Teams use it as a self-hosted alternative to hosted identity providers such as Auth0 or Okta, keeping realms, users and sessions in their own Postgres database. Common uses are SSO for internal tools, social login, LDAP or Active Directory federation, and protecting APIs with access tokens.

Keycloak is released under the Apache License 2.0.

What Keycloak can do

  • Single sign-on over OpenID Connect and SAML 2.0
  • Social login and identity brokering
  • LDAP and Active Directory federation
  • Multi-factor authentication with OTP, WebAuthn and passkeys
  • Realms for separating tenants
  • Admin console and admin API

What people use it for

  • SSO for internal tools and dashboards
  • Self-hosted login for a SaaS product
  • Social login for web apps
  • Protecting APIs with OAuth 2.0 tokens

Videos

Getting Started With Keycloak in 2026 (free Identity Server alternative) · Milan Jovanović
Keycloak Is AWESOME! Single Sign On Made Easy! · Jim's Garage
What Is Keycloak? Open Source Identity and Access Management · wiggitywhitney

Running Keycloak on Railway

The Railway template builds an optimized Keycloak 26 image and runs it with a Railway Postgres database. The hostname follows Railway's public domain, proxy headers are trusted, and an initial admin password is generated. Sessions are stored in Postgres, so restarts do not log users out. Keycloak is a Java server, so cost is driven mainly by the memory the JVM needs and the Postgres volume.

Keycloak templates on Railway

Keycloak 26 Identity and SSO ServerMaintained by Tracklayer
Keycloak is an open-source identity and access management server offering single sign-on, OAuth 2.0 / OpenID Connect and SAML 2.0, user federation, social login and multi-factor au
1 deployments
Deploy
Keycloak by beuz's Projects
[2026-11-04] Keycloak with keywind theme + Apple & Discord providers
754 deployments
Deploy
Keycloak Identity Management | Open-Source Alternative to Auth0 by an independent creator
Self Host Keycloak: SSO, MFA, LDAP federation, OIDC on Railway
66 deployments
Deploy
Keycloak by an independent creator
Keycloak — enterprise identity and access management with SSO and SAML
8 deployments
Deploy
PhaseTwo Keycloak by an independent creator
Keycloak with extensions for orgs, events, themes, and more.
8 deployments
Deploy
Authelia | Lightweight Open Source Keycloak Alternative by an independent creator
Self-Host Authelia - SSO, TOTP, WebAuthn, OpenID Connect, forward auth
7 deployments
Deploy
KEYCLOAK by an independent creator
Auth0 Alternative. Open-source SSO, OIDC and SAML identity server
4 deployments
Deploy
Keycloak by an independent creator
Keycloak 26 SSO and identity server (OIDC, SAML), production mode, Postgres
1 deployments
Deploy
Keycloak by an independent creator
Single sign-on and identity on Postgres 17, admin created on first boot
1 deployments
Deploy
Keycloak — Self-Hosted Auth0 Alternative with SSO by an independent creator
Self-host Keycloak: SSO, OIDC, SAML. No per-MAU fees. Apple & Discord login
1 deployments
Deploy
Keycloak | (Just Updated) Auth0 Alternative With A Working Admin Login by an independent creator
Keycloak 26 SSO with an admin login that exists. Postgres, prebuilt, pinned
0 deployments
Deploy
Keycloak 26.8.2 by an independent creator
Keycloak SSO server (Auth0 alternative): OIDC, SAML, MFA, LDAP on Postgres
0 deployments
Deploy

Tracklayer templates are listed first. Other Keycloak templates follow, ordered by total deployments on Railway. How this works.

Deployment numbers as of 2026-11-20.

Questions about Keycloak

How do I log in for the first time?

Open /admin on your domain and sign in with KC_BOOTSTRAP_ADMIN_USERNAME (default admin) and the generated KC_BOOTSTRAP_ADMIN_PASSWORD. Keycloak treats it as temporary, so create a permanent admin in the master realm and delete the temporary one.

What is my issuer URL?

https://your-domain/realms/your-realm. Apps in the same Railway project can use the private address keycloak.railway.internal:8080 for discovery and tokens.

Do password reset e-mails work?

Keycloak sends mail over SMTP only, and Railway allows outbound SMTP on the Pro plan. On other plans, reset and verification e-mails need a relay reachable from Railway.

Can I run more than one replica?

Set KC_CACHE=ispn first so nodes cluster through the database. Never run more than one replica with the default local cache.

How do I upgrade Keycloak?

Back up Postgres, change the KEYCLOAK_VERSION variable and deploy; Keycloak migrates its schema on start.

Guides

Tracklayer maintains the templates marked as such; Keycloak is a trademark of its owners and this site is not affiliated with them.