docker-compose.yml for Keycloak

Last Updated on

This post provides another basic docker-compose.yml .This time is to create a Keycloak container with an initial user account.

Tested with:

  1. Docker for Windows
  2. Jboss/keycloak
  3. Windows 10


How to Use

Open a Windows Command Line prompt and cd to the directory where the docker-compose.yml file is. Then, run the following commands

1. Pull the image from Docker Hub to the local machine.

2. Create and Run a Keycloak container

3. Access Keycloak Web console

Access http://localhost:8080 .

Change Ports

In case we wish to change to entry port to something other than 8080, simply uncomment the commented lines. Then, comment out - 8080:8080. -Djboss.socket.binding.port-offset=200  changes the port to Keycloak port to 8280  (from 8080 + 200).


Karl San Gabriel

Professional Software Developer