Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set default theme Keycloak 17

Tags:

keycloak

I´m migrating to Keycloak 17 but I´m struggling with the custom themes.

On my previous version (16.1.1) I was able to set the default theme with the KEYCLOAK_DEFAULT_THEME env variable, which pointed to my custom theme.

Now i´m still able to load the themes correctly (They appear on the web console), but v17 it´s not responding to this env.

I found a way to set up the welcome theme on startup with:

kc.sh start --spi-theme-welcome-theme=custom

but this option doesn´t work for other kind of themes like login or admin.

Is there any other env or flag that i can use on startup?

like image 994
PedroArs99 Avatar asked Nov 30 '25 03:11

PedroArs99


2 Answers

You can still use it via ENV, but you have to set KC_SPI_THEME_DEFAULT. Additionally, you may have to start Keycloak with the --auto-build option.

like image 127
O. Schnieders Avatar answered Dec 03 '25 02:12

O. Schnieders


If you start your server with kc.sh start --spi-theme-default=custom-theme, then it should use the supplied custom theme, according to: https://github.com/keycloak/keycloak/blob/bfce612641a70e106b20b136431f0e4046b5c37f/services/src/main/java/org/keycloak/theme/DefaultThemeManager.java#L57

This worked for me with Keycloak 18.

like image 21
maveonair Avatar answered Dec 03 '25 01:12

maveonair



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!