Deploy Kanidm
Kanidm identity server: passkeys, OAuth2/OIDC SSO and LDAP
Just deployed
/data
Deploy and Host Kanidm on Railway
Kanidm is an open-source identity management server written in Rust. It keeps your users and groups in one place and signs them in to your apps and machines with passkeys, TOTP and passwords, acting as an OAuth2/OpenID Connect provider, a read-only LDAP server and a RADIUS backend. It is a lighter alternative to Keycloak or FreeIPA.
About Hosting Kanidm
Kanidm is a single Rust binary with an embedded database, so it needs no separate database service, just persistent storage. The hard part is TLS: Kanidm only serves HTTPS, refuses to start without a certificate, and needs its domain and origin set correctly for passkeys and OAuth2 to work. This template runs Kanidm 1.12.1 behind a small Caddy proxy, so Railway's edge serves the public certificate while Kanidm keeps an internal self-signed one. Data, nightly online backups and the config live on a volume. On first boot the two admin accounts get random passwords, printed once in the deploy logs. You manage users with the kanidm CLI, and people sign in at /ui.
Common Use Cases
- Single sign-on (OAuth2/OpenID Connect) for self-hosted apps such as Grafana, Nextcloud, Immich, Gitea or Outline
- Passkey and TOTP sign-in for a team or family, with self-service credential reset links
- A central user directory for Linux servers (SSH keys, PAM) and LDAP-only apps
Dependencies for Kanidm Hosting
- A Railway volume mounted at
/data(included) - The Kanidm client tools on your computer, to manage people, groups and OAuth2 clients
Deployment Dependencies
- Kanidm documentation: https://kanidm.github.io/kanidm/stable/
- Kanidm 1.12.1 release: https://github.com/kanidm/kanidm/releases/tag/v1.12.1
- Template source: https://github.com/aalfath/kanidm-railway-template
Implementation Details
After the first deploy, open the deploy logs and copy the idm_admin password (shown once). Then, on your computer:
kanidm login -H https://YOUR-DOMAIN -D idm_admin
kanidm person create alice "Alice" -H https://YOUR-DOMAIN -D idm_admin
kanidm person credential create-reset-token alice -H https://YOUR-DOMAIN -D idm_admin
Lost an admin password? Run railway ssh -- kanidmd recover-account idm_admin (or admin).
KANIDM_DOMAIN defaults to the service's Railway domain. To use your own domain, add it in Railway, set KANIDM_DOMAIN to it and redeploy before you create users: changing the domain later breaks passkeys and OAuth2 tokens and needs kanidmd domain rename. LDAPS is off; set KANIDM_LDAPBINDADDRESS=0.0.0.0:3636 and add a TCP proxy to port 3636 to try it.
Why Deploy Kanidm on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Kanidm on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content

