Self-host Keycloak with Levelrail

Verified

An open-source identity and access management server with SSO, OAuth2, and SAML support.

  • AuthorkeycloakVerified by Levelrail
  • LicenceApache-2.0
  • Memory1 GiB
  • Archarm64
  • Services1

How to self-host Keycloak

  1. Pull the images

    One image is pulled on your server.

    Show images
    • quay.io/keycloak/keycloak:26.1
  2. Create the app

    One service starts in a single Compose app, with 1 named volume mount for your data, on port 8080.

  3. Fill in the secrets

    2 secrets are generated and stored encrypted, 5 settings are preset, you do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

Keycloak requirements

Memory
About 1 GiB
Architectures
amd64 image published, arm64 tested
Ports
8080
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
Apache-2.0, permissive license
  • Verified. Verified on arm64 with image tag 26.1. Our CI ran this exact image version and it answered on its health path. Evidence
  • Host ports. It publishes port 8080 on the host, so open them in the VPS firewall only if you want that.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Keycloak. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the Keycloak docs page.

Deploy Keycloak your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy Keycloak from the CLI

levelrail-cli templates deploy keycloak --name my-keycloak

Deploy Keycloak with the API

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/keycloak/deploy

Keycloak configuration

Keycloak services

ServiceImagePortsVolumes
keycloak quay.io/keycloak/keycloak:26.1 8080 keycloak_data -> /opt/keycloak/data

Keycloak environment variables

VariableServiceValue
KC_BOOTSTRAP_ADMIN_PASSWORD keycloak Generated at deploy
KC_BOOTSTRAP_ADMIN_USERNAME keycloak Generated at deploy
KC_HEALTH_ENABLED keycloak Preset by the template
KC_HOSTNAME keycloak Preset by the template
KC_HTTP_ENABLED keycloak Preset by the template
KC_LEGACY_OBSERVABILITY_INTERFACE keycloak Preset by the template
KC_PROXY_HEADERS keycloak Preset by the template

Ports and volumes

Ports
8080
Volumes
1 named mount: keycloak_data -> /opt/keycloak/data

Keycloak FAQ

How much memory does Keycloak need?

The catalog lists about 1 GiB of memory for Keycloak.

Does Keycloak run on arm64?

For Keycloak, arm64 is tested; amd64 is image published.

What licence is Keycloak under?

Keycloak is licensed under Apache-2.0, which is permissive, with few conditions on reuse.

Does Keycloak need configuration before it starts?

No. The template fills in its own defaults and generates secrets at deploy time.

Which ports does Keycloak use?

Keycloak listens on port 8080 inside the stack.

Where does Keycloak keep its data?

In a named volume: keycloak_data mounted at /opt/keycloak/data.

Can I deploy Keycloak on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id keycloak for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image quay.io/keycloak/keycloak:26.1 is what you deploy there.

levelrail-cli templates deploy keycloak --name my-keycloak