Keycloak custom theme build and run in Windows
To build and run a custom theme in Keycloak, you’ll need to follow these steps:
1. Set up a Keycloak development environment:
- Download and install Keycloak. You can find the latest version on the Keycloak website.
- Extract the downloaded package to a directory on to your local machine.
- Open the command prompt and navigate to the Keycloak installation directory.
- Inside the Keycloak installation directory, navigate to the providers directory.
2.Place your custom-theme.jar file in the providers directory
Place your custom-theme.jar file in providers folder , navigate to the bin folder and then run the following command on command prompt
kc.sh build
once the build is completed then run
kc.bat start-dev
then keycloak server will start →
. Open http://localhost:8080/
Note: In case if you want to run the keycloak with different port (for Ex:9090) using CLI , then run the above command as below
kc.bat start-dev --http-port 9090
. Login as a admin and password as a admin
. Go to Relam settings , click on themes menu
. Select the Login theme dropdown and select the custom-theme from the list.
.Logout and Restart the server and check for the customised login theme .
3.changes to custom-theme
.if you make any changes to custom-theme then follow the steps
mvn clean install
then
mvn package
after package take the custom-theme.jar from target folder and follow the steps 2