App service
Services/Keycloak (buildable)

Keycloak (buildable) service

Keycloak identity service built from your Git repository with your own themes and custom provider jars, with linked PostgreSQL storage.

This service runs your code: its image is built from a Git repository, and each build is deployed to an app environment.

On Wodby

How Keycloak (buildable) runs on Wodby

What Wodby sets up for Keycloak on this service. Keycloak runs from the official quay.io/keycloak/keycloak image in production mode (start). Configuration is passed as KC_* environment variables.

Linked services

LinkVariables
PostgreSQL (required)KC_DB_URL_HOST, KC_DB_URL_PORT, KC_DB_URL_DATABASE, KC_DB_USERNAME, KC_DB_PASSWORD

KC_DB is set to postgres. All Keycloak data is in that database: the service has no volume.

What the manifest sets

  • KC_HOSTNAME is the service's URL in the environment. Keycloak uses it for the addresses it issues, such as token issuers and redirects.
  • TLS ends at Wodby's router: KC_HTTP_ENABLED is true and KC_PROXY_HEADERS is xforwarded.
  • KC_HEALTH_ENABLED and KC_METRICS_ENABLED are true. Health and metrics are served on the management port 9000, which is private; the application port is 8080.

First administrator

KC_BOOTSTRAP_ADMIN_USERNAME and KC_BOOTSTRAP_ADMIN_PASSWORD come from the service tokens admin_username and admin_password. Keycloak uses them only when it creates the master realm, on the first start with an empty database, and marks the account as temporary. Changing the tokens later does not change an existing account.

Changing configuration

Add or change KC_* environment variables on the service and deploy it. Environment variables take precedence over conf/keycloak.conf, which is not on a volume. Realms, clients and users are managed in the administration console or its API and stored in the database.

Check the result

From inside the environment, /health/ready on port 9000 is the readiness endpoint the service itself is probed with.

Buildable Keycloak on Wodby

This service is the keycloak service built from the app's repository: its guidance applies to settings, the database, the administrator, the hostname and health checks. This page covers what differs.

Image

The image is built from the app's Git repository on top of the same official Keycloak image the keycloak service runs, so the service's versions are Keycloak versions. Start the repository from the Keycloak boilerplate. The build adds:

  • providers/*.jar: custom providers (SPIs), such as authenticators, user storage, event listeners or protocol mappers, copied to /opt/keycloak/providers;
  • themes/<name>/: themes, with one directory per type (login, account, email, admin) holding its theme.properties, copied to /opt/keycloak/themes.

The build fails when a theme has the name of one of Keycloak's own themes (base, keycloak, keycloak.v2) or has no theme.properties. It then runs kc.sh build with the service's build-time options (PostgreSQL, health and metrics endpoints), so the container starts without rebuilding Keycloak.

Keycloak's version comes from the service version and the image, not from the repository: providers must support it.

Themes

Select a theme for a realm in Keycloak's administration console, under Realm settings > Themes. Themes are part of the image, so changes reach Keycloak with the next deployment.

Overview

Technical profile of Keycloak (buildable)

The versions are the ones you can select for Keycloak (buildable) in a stack or an app environment. The service itself is published in revisions, and a stack references a specific revision.

Service type

App service

Versions

26.8

Stacks

Stacks that include Keycloak (buildable)

This public stack includes Keycloak (buildable). You can create an app from a public stack as it is, or add the service to a stack of your own.

CI/CD

Build Keycloak (buildable) from a Git repository

Start from a public boilerplate or connect your own repository. With Wodby CI, a push to the branch that an app environment follows starts a build of Keycloak (buildable), and the pipeline deploys it.

Git providers

You connect a repository through an integration with its Git provider.

CI providers

Wodby CI is built in: the pipeline is the file .wodby/pipeline.yml in the repository. For a repository you connect, an external CI provider can run the same steps with Wodby CLI.

Container registries

Built images go to Wodby Registry by default, or to an external registry that you connect as an integration.

Environment variables from integrations

A variable integration stores the credentials of a third-party service once. Attach it to Keycloak (buildable) and Wodby passes them to the container as environment variables at runtime, not during the image build.

Configuration

Keycloak (buildable) service configuration

The Keycloak (buildable) service declares the following. Where a value can be changed, a stack sets it and each app environment can override it.

Technical domains

Wodby gives each public HTTP port a technical domain with a TLS certificate and renews the certificate. A port that the service marks private gets no domain. You can add custom domains.

Service links

Each link is a connection from Keycloak (buildable) to another service. A stack sets which service a link points to. The cards list the public services that can satisfy each link.