# Keycloak does not work with Spring Boot in docker compose

**URL:** <https://forum.keycloak.org/t/keycloak-does-not-work-with-spring-boot-in-docker-compose/24910>\
**Category:** Miscellanaeous\
**Created:** [March 6, 2024, 11:32am UTC](https://forum.keycloak.org/t/keycloak-does-not-work-with-spring-boot-in-docker-compose/24910 "2024-03-06T11:32:06Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ThoreKr](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/thorekr/32/7713_2.png) [@ThoreKr](https://forum.keycloak.org/u/ThoreKr)\
**Post date:** [March 6, 2024, 1:50pm UTC](https://forum.keycloak.org/t/keycloak-does-not-work-with-spring-boot-in-docker-compose/24910/2 "2024-03-06T13:50:57Z")

</div>

Surprisingly similar to [My keycloak integration with spring worked perfectly when keycloak is in docker-compose and project running locally ! but got error 401 when both worked on dokcer compose](https://forum.keycloak.org/t/my-keycloak-integration-with-spring-worked-perfectly-when-keycloak-is-in-docker-compose-and-project-running-locally-but-got-error-401-when-both-worked-on-dokcer-compose/24884) are you using some kind of shared source which contains the same incorrect information?

Your compose file can’t work, does keycloak even start? The environment variables still to refer to the wildfly distribution, which is deprecated since version 18. You have to use the new environment variables to configure the database connection.

Next, keycloak doesn’t use the auth subpath any more.

Lastly, if you have separate containers, one container can’t reach the other one via localhost, try using `keycloak:8080` to connect to keycloak.

However, you might encounter connection issues if your browser gets involved.

---

_[View the full topic](https://forum.keycloak.org/t/keycloak-does-not-work-with-spring-boot-in-docker-compose/24910)._
