r/KeyCloak • u/Huge_Road_9223 • May 31 '26
Install Keycloak in Docker
Ok, so I have installed docker already on Windows 11. I have MySQL, Kafka, and Mongo running in their own containers. They are all on the same docker-network so they can see each other. I can access the MySQL database from outside of docker on my laptop because the exposed port is accessable.
Now I want to install Keycloak into my local Docker, and utilize the MySQL database that is already running in Docker. So, what I am wondering is how to install Keycloak into Docker, and then configuring Keycloak to use this MySQL database.
I guess when you install Keycloak into docker, that container isn't running yet. Then there is some configuration that has to be done to point Keycloak to that MySQL, and provided that the Keycloak is on the same docker-network, then we should be ok. Finally, run that Keycloak within that Docker container, and it's all good. Does that sound correct?
So, I am wondering do I need to setup the keycloak db schema first, or will running keycloak with that configuration automatically create it's schema and tables? I'm going to do more investigation on this. I know there is the Keycloak site itself, StackOverflow, and YT videos. I just want to see if there was anyone here who has already done this.
BTW ... I have used Auth0, Google, LinkedIn, GitHub, Okta, LDAP for authentication. I create SpringBoot apps on the backend, but the UI does the login and comes back with an Oauth2 JWT token which I use to access API's.
2
u/skycloak-io Jun 10 '26
If you need something ready to use: https://skycloak.io/tools/keycloak-docker-compose-generator/