Skip to main content

Configuration Reference

Keycloak environment variables

These environment variables are passed to the Keycloak container. In a Docker Compose setup they go in .env; in Kubernetes they are set in the Helm values and stored in Kubernetes Secrets.

Core configuration

VariableRequiredDefaultDescription
KC_HOSTNAMEYesPublic hostname of the Keycloak server, e.g. auth.clickid.eu. Used in token issuers and redirect URLs.
KC_HTTP_ENABLEDNofalseSet to true if TLS is terminated upstream (nginx, load balancer). Required when running behind a reverse proxy.
KC_PROXYNononeSet to edge if TLS terminates at the ingress (most Kubernetes setups), or reencrypt if end-to-end TLS.
KC_LOG_LEVELNoINFOLog verbosity. Values: DEBUG, INFO, WARN, ERROR. Use DEBUG only for troubleshooting — very verbose.
KC_HEALTH_ENABLEDNotrueExpose /health and /health/ready endpoints. Required by the Helm chart's liveness/readiness probes.
KC_METRICS_ENABLEDNofalseExpose /metrics endpoint in Prometheus format.

Database

VariableRequiredDefaultDescription
KC_DBYespostgresDatabase vendor. Only postgres is supported by ClickID.
KC_DB_URLYesFull JDBC URL, e.g. jdbc:postgresql://localhost:5432/keycloak.
KC_DB_USERNAMEYesPostgreSQL username.
KC_DB_PASSWORDYesPostgreSQL password. Store in a Secret, not in plain config.
KC_DB_POOL_MIN_SIZENo5Minimum JDBC connection pool size.
KC_DB_POOL_MAX_SIZENo20Maximum JDBC connection pool size. Increase for high traffic.

Admin credentials (bootstrap only)

These are used only for the initial admin account creation. After first startup, use the Keycloak Admin UI or Admin API to manage admin accounts.

VariableRequiredDescription
KC_BOOTSTRAP_ADMIN_USERNAMEYes (first run)Initial Keycloak admin username.
KC_BOOTSTRAP_ADMIN_PASSWORDYes (first run)Initial Keycloak admin password. Change immediately after first login.

Sector-ID Mapper

VariableRequiredDescription
SECTOR_ID_PEPPERYesHMAC-SHA256 key for sector-ID derivation. Must be identical across all cluster nodes. Never change after users exist. Generate with openssl rand -base64 32.

The Sector-ID Mapper SPI reads this as KC_SPI_SECTOR_ID_PEPPER internally (the mapper configuration in the realm JSON references ${env.KC_SPI_SECTOR_ID_PEPPER}).

Email (SMTP)

VariableRequiredDefaultDescription
KC_SMTP_FROMNoFrom address for outbound email, e.g. noreply@clickid.eu.
KC_SMTP_HOSTNoSMTP server hostname.
KC_SMTP_PORTNo587SMTP port. Use 465 for SMTPS, 587 for STARTTLS.
KC_SMTP_USERNoSMTP authentication username.
KC_SMTP_PASSWORDNoSMTP authentication password.
KC_SMTP_SSLNofalseSet to true for SMTPS (port 465).
KC_SMTP_STARTTLSNotrueSet to true for STARTTLS (port 587).

In local development, all email is caught by Mailhog — no SMTP configuration is needed.


SP Portal environment variables

The SP Portal is a Nuxt 3 application. These variables configure its connection to Keycloak and control authentication.

VariableRequiredDescription
NUXT_AUTH_SECRETYesSecret key for NextAuth/nuxt-auth session encryption. Generate with openssl rand -base64 32. Rotate with care — rotating invalidates all active SP Portal sessions.
NUXT_KEYCLOAK_ISSUERYesKeycloak OIDC issuer URL for the SP Portal's own authentication. E.g. https://auth.clickid.eu/realms/clickid.
NUXT_KEYCLOAK_CLIENT_IDYesOIDC client ID for the SP Portal app in Keycloak. Default: sp-portal.
NUXT_KEYCLOAK_CLIENT_SECRETYesOIDC client secret for the SP Portal. Store in a Secret.
NUXT_KC_ADMIN_URLYesKeycloak Admin REST API base URL. E.g. https://auth.clickid.eu.
NUXT_KC_ADMIN_CLIENT_IDYesClient ID with admin privileges for realm management. Default: sp-portal-admin.
NUXT_KC_ADMIN_CLIENT_SECRETYesClient secret for the admin client. Store in a Secret.
NUXT_KC_SANDBOX_REALMNoName of the sandbox realm. Default: clickid-sandbox.
NUXT_KC_LIVE_REALMNoName of the live realm. Default: clickid.
NUXT_SECTOR_ID_PEPPERNoIf set, the SP Portal can display sector-ID derivation examples in the UI. Should match the IdP pepper. Handle with care.
NUXT_PUBLIC_KEYCLOAK_URLYesPublic-facing Keycloak URL shown in the portal UI and used for metadata URL generation. E.g. https://auth.clickid.eu.

Helm values reference

The Helm chart exposes these key values. Set them in a values.yaml file or via --set flags.

Keycloak

ValueTypeDefaultDescription
keycloak.replicasinteger1Number of Keycloak pod replicas. Set to 2 or more for HA.
keycloak.hostnamestringPublic hostname, e.g. auth.clickid.eu. Mapped to KC_HOSTNAME.
keycloak.admin.usernamestringadminBootstrap admin username.
keycloak.admin.passwordstringBootstrap admin password. Stored in a Kubernetes Secret.
keycloak.db.passwordstringPostgreSQL password. Stored in a Kubernetes Secret.
keycloak.sectorIdPepperstringSector-ID HMAC key. Stored in a Kubernetes Secret.
keycloak.existingSecretstring""Name of an existing Kubernetes Secret containing all Keycloak credentials. Use with External Secrets Operator. If set, individual credential values are ignored.
keycloak.image.repositorystringghcr.io/clickid/keycloakContainer image repository.
keycloak.image.tagstringlatestContainer image tag. Pin this in production.
keycloak.resources.requests.memorystring768MiKeycloak memory request.
keycloak.resources.limits.memorystring1.5GiKeycloak memory limit.
keycloak.ingress.enabledbooltrueCreate an Ingress resource for Keycloak.
keycloak.ingress.annotationsmap{}Ingress annotations, e.g. cert-manager.io/cluster-issuer.

SP Portal

ValueTypeDefaultDescription
spPortal.hostnamestringPublic hostname, e.g. portal.clickid.eu.
spPortal.authSecretstringNUXT_AUTH_SECRET value. Stored in a Kubernetes Secret.
spPortal.keycloak.clientSecretstringOIDC client secret. Stored in a Kubernetes Secret.
spPortal.keycloakAdmin.clientSecretstringAdmin client secret. Stored in a Kubernetes Secret.
spPortal.image.repositorystringghcr.io/clickid/sp-portalContainer image repository.
spPortal.image.tagstringlatestContainer image tag.
spPortal.ingress.enabledbooltrueCreate an Ingress resource for the SP Portal.
spPortal.ingress.annotationsmap{}Ingress annotations.

PostgreSQL

The embedded PostgreSQL is provided by the Bitnami PostgreSQL subchart.

ValueTypeDefaultDescription
postgresql.enabledbooltrueDeploy the embedded PostgreSQL. Set to false to use an external database.
postgresql.auth.databasestringkeycloakDatabase name.
postgresql.auth.usernamestringkeycloakDatabase username.
postgresql.auth.passwordstringDatabase password.
postgresql.primary.persistence.sizestring8GiPVC size for PostgreSQL data.
External database

For production at scale, consider using an external managed PostgreSQL (e.g. AWS RDS, Azure Database for PostgreSQL, or a self-hosted Patroni cluster) with postgresql.enabled=false and configuring keycloak.db.* values manually.