
Deploy Casdoor
Casdoor 4.9 identity provider with OAuth 2.0, OIDC, SAML and a web UI.
casdoor
Just deployed
Just deployed
/var/lib/postgresql/data
Deploy and Host Casdoor on Railway
Casdoor is an open-source identity and access management platform with a web UI. It acts as an OAuth 2.0, OIDC, SAML, CAS and LDAP provider, supports social logins, MFA, passkeys and user management, and includes Casbin-based permissions. SDKs are available for Go, Java, Node.js, Python, PHP, .NET and frontend frameworks.
About Hosting Casdoor
This template deploys Casdoor v4.9.0 from the official image with a Railway Postgres database. On first start the well-known default admin password 123 is replaced with a generated one, so the instance is never exposed with it. The OIDC issuer is your Railway domain, and the discovery document works out of the box. Casdoor listens on the public domain and the private network, so backend services can call its API internally. It is light enough for the Hobby plan. Back up Postgres regularly, since it holds your users and applications.
Common Use Cases
- Single sign-on for internal tools and customer-facing apps
- An OIDC provider for apps that support generic OAuth login
- Central user management with social login and MFA
Dependencies for Casdoor Hosting
casbin/casdoor:4.9.0(official image)- Railway Postgres (
ghcr.io/railwayapp-templates/postgres-ssl:18) with a volume
Deployment Dependencies
Implementation Details
| Service | Image | Networking | Storage |
|---|---|---|---|
| casdoor | casbin/casdoor:4.9.0 | public domain on 8000; private | none (state in Postgres) |
| Postgres | Railway Postgres 18 | private only | volume |
Log in at https:// as admin with CASDOOR_ADMIN_PASSWORD, then create an organization and application. OIDC discovery:
curl https:///.well-known/openid-configuration
| Variable | Default | Purpose |
|---|---|---|
CASDOOR_ADMIN_PASSWORD | generated | Replaces the default 123 on first start |
origin | https:// | Public URL and OIDC issuer |
driverName / dataSourceName | Postgres references | Database |
Notes:
- The password is only replaced while
admin/123still works; change it later in the UI. - Casdoor reads lowercase variables such as
originandrunmodedirectly; keep their names.
This is a community-maintained deployment package and does not imply affiliation with or endorsement by the Casdoor project or its maintainers.
Why Deploy Casdoor 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 Casdoor 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

