Change Login Theme in Keycloak Docker Image

Austin Cunningham
Keycloak
Published in
2 min readMay 18, 2020

I was asked a question around how to change the theme in the Keycloak docker image and I had never tried it. So it was worth a blog. First pull the original image

docker pull jboss/keycloak

Then start the image

Login to the container with the CONTAINER ID

docker exec -it 47dd5c82b073 bin/bash

Create a directory for your theme in the container

mkdir /opt/jboss/keycloak/themes/raincatcher-theme

I blogged about creating a custom theme here so I have a git repo with a theme, so I cloned it to my local machine

git clone https://github.com/austincunningham/raincatcher-keycloak-theme.git

Copied the contents of the theme directory from my local machine to the new directory on the running container

docker cp raincatcher-keycloak-theme/. 47dd5c82b073:/opt/jboss/keycloak/themes/raincatcher-theme

Restart the container

docker restart 47dd5c82b073

You should be able to select the image from the drop down once the container restarts

Exit the docker exec

So that it , you will need to build a new image from the container and tag and push the image to save your changes.

Sign up to discover human stories that deepen your understanding of the world.

Keycloak
Keycloak

Published in Keycloak

Open Source Identity Solution for Applications, Services and APIs

Responses (1)

What are your thoughts?

Thanks for the post!
I would like to add that it might be a lot easier to just mount the /opt/jboss/keycloak/themes/raincatcher-theme directory to the docker container, so it won't be required to create an entirely new docker image.

1