Skip to main content

Self-Hosting

Phase Two publishes the same Keycloak image that runs our managed clusters, so you can run it on your own infrastructure. Organizations self-host when they have compliance, data residency, or network requirements that a managed service can't meet, or when they ship Keycloak inside their own product to customer sites.

If you don't have one of those requirements, the managed service is usually less work. See Managed vs Self-Hosted for a side-by-side comparison, and Pricing for support options when you self-host.

What is in the image​

The image is quay.io/phasetwo/phasetwo-keycloak. It is Keycloak built from the p2-inc/keycloak fork, which differs from upstream only in adding CockroachDB support, plus the Phase Two extensions:

ComponentWhat it doesSource
OrganizationsMulti-tenant organizations, roles, invitations, and domains, with APIsp2-inc/keycloak-orgs
EventsEvent listeners, including webhooksp2-inc/keycloak-events
Magic LinkPasswordless login by email link or codep2-inc/keycloak-magic-link
ThemesLogin, email, and admin theme customization, including the phasetwo-ui admin themep2-inc/keycloak-themes
Admin PortalSelf-service portal for users and organization adminsp2-inc/phasetwo-admin-portal
IdP WizardsGuided SSO and directory sync setupp2-inc/idp-wizard
SCIM ServerSCIM 2.0 user and group provisioningp2-inc/keycloak-scim-server
Atomic Auth FlowsCreate and change authentication flows in a single API callp2-inc/keycloak-atomic-auth-flows
User MigrationMigrate users from a legacy system on first logindaniel-frak/keycloak-user-migration
Apple Identity ProviderSign in with Appleklausbetz/apple-identity-provider-keycloak

The image itself is built in the open at p2-inc/phasetwo-containers, which is also where to report image issues. For licensing, see Open Source.

What stays with the managed service​

Self-hosting gives you the server and the extensions. These are part of the managed service and are not in the image:

  • The dashboard for creating clusters and realms, custom domains, IP restrictions, logs, metrics, and environment variables
  • Operation of the database, backups, and monitoring
  • Version upgrades, security patching, and capacity planning
  • The uptime SLA on Premium and Enterprise clusters

Where to start​

Before going live, work through the Keycloak Production Readiness Checklist. Every server-level item in it applies when you self-host.