Self-host Keycloak on a VPS
An open-source identity and access management server with SSO, OAuth2, and SAML support.
levelrail-cli templates deploy keycloak --name my-keycloakSpecification
- Status
- Verified on arm64 with image tag 26.1
- Category
- Security
- Services
- keycloak
- Ports
- 8080
- Volumes
- 1
- Memory
- about 1 GiB
- arm64
- tested
- amd64
- image published
- Settings to fill in
- none
- License
- Permissive license, Apache-2.0
About Keycloak
An open-source identity and access management server with SSO, OAuth2, and SAML support. Runs as a single container from the keycloak image, listening on port 8080 and keeps its data in named volumes.
What it deploys
Keycloak runs as one service in a single Compose app, listening on port 8080, with 1 named volume mount.
| Service | Image | Tag | Ports | Volumes |
|---|---|---|---|---|
| keycloak | quay.io/keycloak/keycloak | 26.1 | 8080 | keycloak_data -> /opt/keycloak/data |
Before you install
- CPU architecture. arm64 listed. Every image lists linux/arm64 in its registry manifest. That is a manifest fact, not proof the app runs on Arm.
- Verified. Verified on arm64 with image tag 26.1. Verified means our CI ran this exact image version and it answered on its health path. Evidence
- Host ports. It publishes port 8080 directly on the host, so open them in the VPS firewall only if you want that.
Settings and environment
You do not have to fill in anything. 2 secrets are generated at deploy and stored encrypted. Values are never shown here.
| Service | Variable | Value |
|---|---|---|
| keycloak | KC_BOOTSTRAP_ADMIN_PASSWORD | Generated at deploy |
| keycloak | KC_BOOTSTRAP_ADMIN_USERNAME | Generated at deploy |
| keycloak | KC_HEALTH_ENABLED | Preset by the template |
| keycloak | KC_HOSTNAME | Preset by the template |
| keycloak | KC_HTTP_ENABLED | Preset by the template |
| keycloak | KC_LEGACY_OBSERVABILITY_INTERFACE | Preset by the template |
| keycloak | KC_PROXY_HEADERS | Preset by the template |
Install Keycloak on a VPS
-
Install Levelrail on a fresh VPS
Run this as root on a Linux server (amd64 or arm64) with ports 80 and 443 reachable. The installer prints a setup link.
curl -fsSL https://levelrail.com/install.sh | sudo sh -
Sign in
Open the setup link, choose a password, then log the CLI in. The CLI install command is
curl -fsSL https://levelrail.com/install-cli.sh | shif the machine does not have it. See Getting started.levelrail-cli login --device -
Read the template
Shows the entry, including its full compose.yaml.
levelrail-cli templates get keycloak -
Deploy it
This deploys the template compose file as an app. The app name defaults to the template id; --name sets another.
levelrail-cli templates deploy keycloak --name my-keycloak
Without a domain the app gets an sslip.io address. You can also deploy it from the dashboard: Apps, New app, Browse templates, then Keycloak.
Docs and upstream
More in Security
- Keycloak (Postgres)Keycloak backed by Postgres instead of its default embedded database, for a real multi-instance setup.
- InfisicalAn open-source secrets manager to centralize API keys, database credentials, and app config.
- lldapA lightweight LDAP server with a friendly web UI, built for homelab and small-team authentication.
- LogtoModern, developer-first customer identity: sign-in experiences, social login, and OIDC without the plumbing.
- OAuth2 ProxyReverse proxy that puts an OAuth2 or OIDC login in front of any upstream. The install form carries oauth2-proxy.cfg as an editable file with a generated cookie secret, so it starts without extra flags.
- One-Time SecretShare a password or API key through a link that self-destructs after the first view, backed by Redis.