Custom theme jar deployment

When creating and deploying a custom theme jar to the standalone/deployments folder I’m running into an issue where the themes are not available.

I have followed the guide in Server Developer Guide and the final step of : “To deploy the archive to Keycloak simply drop it into the standalone/deployments/ directory of Keycloak and it will be automatically loaded.” seems a little vague as to what happens next.

Upon deploy of the theme I’m getting the following

I can also see the mounted themes within the keycloak-16.1.0\standalone\tmp\vfs\temp\tempxxx\contentxxx looking at the content file whilst the server is running so I’m certain that my themes exist along with the META-INF/keycloak-themes.json file.

An example of my keycloak-themes.json file is provided

{
  "themes": [
    {
      "name": "customThemeOne",
      "types": [
        "login"
      ]
    },
    {
      "name": "customThemeTwo",
      "types": [
        "login"
      ]
    }
  ]
}

Any help or information would be greatly appreciated.

I’ve just made a COPY of the themes directories into the Dockerfile and it worked

and get a look at Dockerized setup with custom theme

I am running into a similar problem on Linux using a docker container.

The issue is that I provide the jar file using a bind that results in the file having the owner and group set to what they are on the host (which does not have a keycloak user - I use the latest and unaltered image from keycloak/keycloak)

Keycloak server in the container cannot see that file as it likely runs under user keycloak.

I can always go into the container and manually change the owner and group but I want to automate the deployment.

Still trying to figure out a solution and if I find one I’ll post here.

So I could not identify a solution where I could completely automate the process without using a Dockerfile.

So I decided to not adopt the recommended production solution and instead did a bind mount of the host theme directory to /opt/keycloak/themes in the container. That seems to be working.

Interestingly I suspect that this issue can be avoided with podman. But alas Synology does not have a package for podman yet. I may build that when I am done with my current project.

I am sure I’ll be back with other keycloak questions…

In the meantime many thanks to the community for your excellent help and collaboration!