---
title: "Deploy PhaseTwo Keycloak"
description: "Keycloak with extensions for orgs, events, themes, and more."
category: "Authentication"
url: https://railway.com/deploy/phasetwo-keycloak
---

# Deploy PhaseTwo Keycloak

Keycloak with extensions for orgs, events, themes, and more.

**[Deploy PhaseTwo Keycloak on Railway](https://railway.com/template/phasetwo-keycloak)**

- **Creator:** Nuovar
- **Category:** Authentication
- **Total deploys:** 8

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17

### PhaseTwo Keycloak

- **Image:** quay.io/phasetwo/phasetwo-keycloak
- **Start command:** `/opt/keycloak/bin/kc.sh --verbose start --spi-email-template-provider=freemarker-plus-mustache --spi-email-template-freemarker-plus-mustache-enabled=true --spi-theme-cache-themes=false`
- **Health check:** /auth/health
- **Public domain:** Yes

## Documentation

# Deploy and Host PhaseTwo Keycloak on Railway

PhaseTwo Enhanced Keycloak is a custom build of Keycloak including all of PhaseTwo's extensions, including:
- Organizations
- Events
- Magic Link
- Themes
- Admin UI
- Admin Portal
- IdP Wizards

Adding extensive multi-tenancy, audit logging, self-service features to Keycloak.

For more information, view https://phasetwo.io/docs/introduction/open-source/

## About Hosting PhaseTwo Keycloak

To host PhaseTwo keycloak, simply deploy the template and login. By default, your Keycloak instance will be configured with the default username `admin` and password `railway`, but you can change this default use by editing the `KC_BOOTSTRAP_ADMIN_` environment variables before deploy.

After deploying your instance, create a new admin user and delete the bootstrap account, and enable the PhaseTwo extensions by going to your realm settings and switching the admin theme to `phasetwo.v2`.

## Common Use Cases

- Multi-Tenant Authentication
- Single Sign-On

## Dependencies for PhaseTwo Keycloak Hosting

- Postgres

### Deployment Dependencies

https://github.com/p2-inc/phasetwo-containers

## Why Deploy PhaseTwo Keycloak 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 PhaseTwo Keycloak 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.


## Similar templates

- [Keycloak](https://railway.com/deploy/mSwigX) — Keycloak template with keywind theme + apple and discord providers
- [lua-protector](https://railway.com/deploy/lua-protector) — Test deployed my project first
- [bknd](https://railway.com/deploy/p4nTYL) — Feature-rich yet lightweight backend

Open this page in a browser: https://railway.com/deploy/phasetwo-keycloak
