C8 docker web-modeler-webapp authentication issue

Hi,

I’m trying to setup C8.7 in via docker-compose, acquired via https://github.com/camunda/camunda-distributions/releases/download/docker-compose-8.7/docker-compose-8.7.zip

.env changes:

Image versions

renovate: datasource=docker depName=camunda/zeebe

CAMUNDA_ZEEBE_VERSION=8.7.10

renovate: datasource=docker depName=camunda/operate

CAMUNDA_OPERATE_VERSION=8.7.10

renovate: datasource=docker depName=camunda/tasklist

CAMUNDA_TASKLIST_VERSION=8.7.10

renovate: datasource=docker depName=camunda/connectors-bundle

CAMUNDA_CONNECTORS_VERSION=8.7.7

renovate: datasource=docker depName=camunda/optimize

CAMUNDA_OPTIMIZE_VERSION=8.7.7

renovate: datasource=docker depName=camunda/identity

CAMUNDA_IDENTITY_VERSION=8.7.5

renovate: datasource=docker depName=camunda/web-modeler-restapi

CAMUNDA_WEB_MODELER_VERSION=8.7.8

renovate: datasource=docker depName=elasticsearch

ELASTIC_VERSION=8.17.9

renovate: datasource=docker depName=bitnamilegacy/keycloak

KEYCLOAK_SERVER_VERSION=26.3.1

renovate: datasource=docker depName=axllent/mailpit

MAILPIT_VERSION=v1.26.2
POSTGRES_VERSION=17.5-bookworm
HOST=xxx.xxx.lan
KEYCLOAK_HOST=xxx.xxx.lan

both HOST and KEYCLOAK_HOST are setup for the local domain of the server running docker.

The issue I see is if I navigate to http://xxx.xxx.lan:8070/ (Web Modeler webapp), then it does forward to Identity and tries to log ‘demo’ user in, but the redirect_uri is for some reason wrongly ‘redirect_uri=http://localhost:8070/login-callback’, namely this:

http://xxx.xxx.lan:18080/auth/realms/camunda-platform/protocol/openid-connect/auth?client_id=web-modeler&redirect_uri=http%3A%2F%2Flocalhost%3A8070%2Flogin-callback&response_type=code&scope=openid+email+profile&state=53477bac5bc34358b603256269e9b03a&code_challenge=MNV2m01OS6d0vTjPy7mVU-z60WBYzo1SJBtRMXt1Iwc&code_challenge_method=S256&response_mode=query

The docker-compose.yaml file does include the environment variable KEYCLOAK_INIT_WEBMODELER_ROOT_URL: http://${HOST}:8070 by default.
I do see in Identity the application of Web Modeler configured with Redirect URIs http://xxx.xxx.lan:8070/login-callback

I would suspect that the web-modeler-webapp service is the culprit… In the YAML file is hardcoding the ‘SERVER_URL’ to ‘http://localhost:8070’, instead of SERVER_URL to http://${HOST}:8070.

Would you be able to confirm?
If this is the problem, would it be possible to dynamically set the web-modeler-webapp’s SERVER_URL environment variable?

Hi there! :waving_hand:

You’ve correctly identified the issue! This is indeed a known limitation with the official Camunda 8.7 Docker Compose distribution.

The Problem

You’re absolutely right that the web-modeler-webapp service has the SERVER_URL hardcoded to http://localhost:8070 instead of using the ${HOST} variable. This causes authentication redirect URIs to use localhost even when you’ve configured your HOST and KEYCLOAK_HOST variables to use your custom domain (xxx.xxx.lan).

The Solution

To fix this, you need to manually modify the docker-compose.yaml file to use the HOST variable for the SERVER_URL environment variable in the web-modeler-webapp service.

Find the web-modeler-webapp service in your docker-compose.yaml and change:

environment:
  SERVER_URL: "http://localhost:8070"

To:

environment:
  SERVER_URL: "http://${HOST}:8070"

Why This Happens

The official Docker Compose distribution is designed primarily for local development with localhost, and there’s no built-in mechanism for dynamic HOST variable substitution in the SERVER_URL configuration. This is a known limitation mentioned in the community discussions.

Important Notes

  • The SERVER_URL must exactly match the redirect URI registered in your Keycloak client
  • Since you already have KEYCLOAK_INIT_WEBMODELER_ROOT_URL: http://${HOST}:8070 configured, your Keycloak should already have the correct redirect URI (http://xxx.xxx.lan:8070/login-callback)
  • After making this change, restart your Docker Compose stack

References

This should resolve your authentication redirect issue! Let me know if you need any clarification or run into other problems after making this change.

Thanks, (La)zee-bot!

I think the ‘Why This Happens’ is not true. There is a built-in mechanism for dynamic HOST variable via env file, it is just not working out of the box. ALL environment variables/config in the yaml file would need to be set dynamically, where it NEEDS to be set to the HOST and stay localhost or docker container name.

I think the ‘known limitation’ is an overstatement too, especially if there is no link provided, which proves that it is in the docs…