Unable to bring up keycloak instance in local using below command
docker run --name keycloak-local bitnami/keycloak:20.0.5-debian-11-r1
Please find the error details
keycloak 09:26:46.21
keycloak 09:26:46.22 Welcome to the Bitnami keycloak container
keycloak 09:26:46.22 Subscribe to project updates by watching https://github.com/bitnami/containers
keycloak 09:26:46.22 Submit issues and feature requests at https://github.com/bitnami/containers/issues
keycloak 09:26:46.22
keycloak 09:26:46.22 INFO ==> ** Starting keycloak setup **
keycloak 09:26:46.23 INFO ==> Validating settings in KEYCLOAK_* env vars...
keycloak 09:26:46.26 INFO ==> Trying to connect to PostgreSQL server postgresql...
cannot resolve host "postgresql": lookup postgresql on 192.168.65.7:53: read udp 172.17.0.2:46446->192.168.65.7:53: i/o time
The reasons is bitnami/keycloak looking for default database(PostgreSQL) connection.
So you needs to run both docker images(keycloak and postgresql) by docker compose from here
version: '2'
services:
postgresql:
image: docker.io/bitnami/postgresql:15
environment:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes
- POSTGRESQL_USERNAME=bn_keycloak
- POSTGRESQL_DATABASE=bitnami_keycloak
volumes:
- 'postgresql_data:/bitnami/postgresql'
keycloak:
image: docker.io/bitnami/keycloak:24
depends_on:
- postgresql
ports:
- "8080:8080"
volumes:
postgresql_data:
driver: local
By launching docker-compose v2.0 at the same directory of docker-compose.yml file.
I changed port forwarding port from 80 to 8080 in line 18 of docker-compose.yml
If you want to stick with specific Key cloak version, replace line 14
image: bitnami/keycloak:24.0.4-debian-12-r1
docker compose up
Default Admin Credential in here documentation
Acess the Keycloak by Browser
localhost:8080
And Login with default credential.
KEYCLOAK_ADMIN_USER: Administrator default user. Default: user
KEYCLOAK_ADMIN_PASSWORD: Administrator default password. Default: bitnami
You can see Keycloak master page fter success to login as master admin.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With