Finding the location of the keycloak.conf file when running Keycloak in a Docker container

mich0w0h

mich0w0h

Posted on November 1, 2023

Finding the location of the keycloak.conf file when running Keycloak in a Docker container

I'm currently reading the book "Keycloak - Identity and Access Management for Modern Applications" and am on chapter 9, "Configuring Keycloak for Production."

To work with this chapter, I chose to run Keycloak on a Docker container from several options.

In that section, it is required to edit the keycloak.conf file. The book instructs to look for the file at $KC_HOME/conf/keycloak.conf, where $KC_HOME is only set for installing Keycloak rather than running it on Docker.

As someone who is new to Docker, I had to check where I could find the keycloak.conf file. Here's what I learned:

By default, the working directory of the Docker container created by the Keycloak image is /opt/keycloak/. The docker exec command enables us to connect there.

Now I could find the keycloak.conf under /opt/keycloak/conf/.

$ docker exec <DOCKER_CONTAINER_NAME> ls /opt/keycloak/conf

cache-ispn.xml
keycloak.conf
README.md
Enter fullscreen mode Exit fullscreen mode

I hope this helps!

References

đź’– đź’Ş đź™… đźš©
mich0w0h
mich0w0h

Posted on November 1, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related