# Creating custom theme in keycloak-x

**URL:** <https://forum.keycloak.org/t/creating-custom-theme-in-keycloak-x/7896>\
**Category:** Miscellanaeous\
**Created:** [March 12, 2021, 7:35am UTC](https://forum.keycloak.org/t/creating-custom-theme-in-keycloak-x/7896 "2021-03-12T07:35:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jntn](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/jntn/32/2595_2.png) [@jntn](https://forum.keycloak.org/u/jntn)\
**Post date:** [March 12, 2021, 7:35am UTC](https://forum.keycloak.org/t/creating-custom-theme-in-keycloak-x/7896/1 "2021-03-12T07:35:54Z")

</div>

Hello!

I found out about keycloak-x and am very exited about the possibilities. Everything is working fine, but I can’t for the life of me figure out how to create a custom theme.

I read something about creating a theme jar and putting it in the providers directory, but I am unsure how to do that.

Have anyone else experimented with this?

---

<div class="post-metadata">

**Author:** ![ygtysr](https://avatars.discourse-cdn.com/v4/letter/y/f07891/32.png) [@ygtysr](https://forum.keycloak.org/u/ygtysr)\
**Post date:** [April 19, 2021, 6:45pm UTC](https://forum.keycloak.org/t/creating-custom-theme-in-keycloak-x/7896/2 "2021-04-19T18:45:35Z")

</div>

Hi @jntn ,  
Did you tried to build server with;  
_mvn -Pdistribution -pl distribution/server-x-dist/ -am -Dmaven.test.skip clean install_

After the successfully build you can find the distribution in; _{Keycloak}/distribution/server-x-dist/target_

Greetings,  
Yigit

---

<div class="post-metadata">

**Author:** ![firefox](https://avatars.discourse-cdn.com/v4/letter/f/9de053/32.png) [@firefox](https://forum.keycloak.org/u/firefox)\
**Post date:** [April 20, 2021, 5:28am UTC](https://forum.keycloak.org/t/creating-custom-theme-in-keycloak-x/7896/3 "2021-04-20T05:28:43Z")

</div>

try this [Themes | keycloak-documentation](https://wjw465150.gitbooks.io/keycloak-documentation/content/server_development/topics/themes.html)  
once the zip is created extract it to the themes folder in the keycloak

---

<div class="post-metadata">

**Author:** ![iudex](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/iudex/32/2907_2.png) [@iudex](https://forum.keycloak.org/u/iudex)\
**Post date:** [April 20, 2021, 2:21pm UTC](https://forum.keycloak.org/t/creating-custom-theme-in-keycloak-x/7896/4 "2021-04-20T14:21:57Z")

</div>

Oh wow, @firefox 's linked gitbook docs do indeed say

> create a ZIP archive with the theme resources

This could have save me loads of time… But I only found [the official docs](https://www.keycloak.org/docs/latest/server_development/#deploying-themes) which say

> create a JAR archive with the theme resources

So I dug up [keycloakify](https://github.com/InseeFrLab/keycloakify) and copied their process of creating a jar.

It boils down to:

- Having a `theme` folder and `META-INF/keycloak-themes.json` in the current folder, according to [the docs](https://www.keycloak.org/docs/latest/server_development/#deploying-themes)
- creating `./src/main/resources/` and moving the `theme` and `META-INF` folder in there
- creating a `pom.xml` in `./` like:

```auto
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.example.theme</groupId>
	<artifactId>foo</artifactId>
	<version>0.0.1</version>
	<name>foo</name>
	<description />
</project>

```

- running `mvn package` in `./`

The jar will end up in `./target`, eg. `./target/foo-0.0.1.jar` 🎉

While I only deployed the JAR to a normal keycloak instance (by copying it to `/opt/jboss/keycloak/standalone/deployments`)  
the [blog post introducing keycloak-x](https://www.keycloak.org/2020/12/first-keycloak-x-release.adoc) says:

> The `providers` directory is where you should deploy your JAR files with your custom providers or themes jar.

I hope this helps anyone, and fully expect myself to stumble across this exact post next time i have to touch keycloak themes 😅

---

<div class="post-metadata">

**Author:** ![tekgainers](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/tekgainers/32/3144_2.png) [@tekgainers](https://forum.keycloak.org/u/tekgainers)\
**Post date:** [May 16, 2021, 1:11pm UTC](https://forum.keycloak.org/t/creating-custom-theme-in-keycloak-x/7896/5 "2021-05-16T13:11:46Z")

</div>

Anyone successful in creating custom themes in Keycloak-X? I tried all the things but still no luck.

1. As per the documentation (though it is for Keycloak not Keycloak-X), we can just copy the mytheme content in themes folder and this WORKS. Tested the same in Traditional Keycloak.
2. As mentioned by @iudex, created the jar file and put it in providers folder. Restarted ketcloak-x, but no luck.

---

<div class="post-metadata">

**Author:** ![Paul6552](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/paul6552/32/3146_2.png) [@Paul6552](https://forum.keycloak.org/u/Paul6552)\
**Post date:** [May 17, 2021, 8:40am UTC](https://forum.keycloak.org/t/creating-custom-theme-in-keycloak-x/7896/6 "2021-05-17T08:40:22Z")

</div>

I am doing the same like tekgainers. We copy our themes only in the themes folder and it works. I never understood why someone is doing the extra effort to create a jar and copy it anywhere. It is faster and easier to copy only the themes into the theme folder instead of creating every time a jar file.

---

<div class="post-metadata">

**Author:** ![tekgainers](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/tekgainers/32/3144_2.png) [@tekgainers](https://forum.keycloak.org/u/tekgainers)\
**Post date:** [May 18, 2021, 6:34pm UTC](https://forum.keycloak.org/t/creating-custom-theme-in-keycloak-x/7896/7 "2021-05-18T18:34:23Z")

</div>

For those who are using/ playing around with Keycloak.X. Custom themes is working with jar file. I was missing the below step and hope someone will find it useful:  
Step 1: Put the jar in the provider folder.  
Step 2: Run the following command “kc.bat config” for windows and “kc.sh config” for linux  
Step 3: Start Keycloak.X

@Paul6552 - Are you using Keycloak.X? Copying themes folder works perfectly in Keycloak and not in Keycloak.X. Let me know if only themes folder copying works for you in Keycloak.X.

---

<div class="post-metadata">

**Author:** ![Paul6552](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/paul6552/32/3146_2.png) [@Paul6552](https://forum.keycloak.org/u/Paul6552)\
**Post date:** [May 31, 2021, 1:20pm UTC](https://forum.keycloak.org/t/creating-custom-theme-in-keycloak-x/7896/8 "2021-05-31T13:20:20Z")

</div>

Sry I only saw “Creating custom theme in keycloak” missed the X.

Why isn`t it working anymore in keycloak X to copy themes folder? Why do we have to make a jar file? Isn`t it easier only to copy the files in the theme folder and finished?

---

<div class="post-metadata">

**Author:** ![haseeb](https://avatars.discourse-cdn.com/v4/letter/h/e56c9b/32.png) [@haseeb](https://forum.keycloak.org/u/haseeb)\
**Post date:** [June 6, 2023, 7:34am UTC](https://forum.keycloak.org/t/creating-custom-theme-in-keycloak-x/7896/10 "2023-06-06T07:34:11Z")

</div>

@tekgainers Thanks brother, that thing also worked for me.

Step 1: Put the jar in the provider folder.  
Step 2: Run the following command “kc.bat config” for windows and “kc.sh config” for linux  
Step 3: Start Keycloak.X
