Keycloak X preview with PostgreSQL Database

Hello,

I try to deploy the new Keycloak X preview version with a postgresql database (13).

I have modified the keycloak.propreties like following :

# Default and non-production grade database vendor
db=postgres

# Default, and insecure, and non-production grade configuration for the development profile
%dev.http.enabled=true
%dev.db.username = keycloak
%dev.db.password = keycloak0
%dev.cluster=local
%dev.spi.theme.cache-themes=false
%dev.spi.theme.cache-templates=false
%dev.spi.theme.static-max-age=-1

# Metrics and healthcheck are disabled by default
metrics.enabled=false

# Themes
spi.theme.folder.dir=${kc.home.dir:}/themes

# Logging configuration. INFO is the default level for most of the categories
quarkus.log.level = DEBUG
quarkus.log.category.“org.jboss.resteasy.resteasy_jaxrs.i18n”.level=WARN
quarkus.log.category.“org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup”.level=WARN

I have the following error : Cause: : java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432/keycloak

There is however the .jar in the keycloak config files …
Am I missing something?

Thank you in advance

How do you start Keycloak.X? Did you run kc.sh config before starting it? Or do you use the —auto-config option? The db` property is a build-time property, it has to be configured before running KC.X or it has to be started with the auto-config option.

1 Like

Hello ,

I used the following command: ./kc.sh config --db=postgres

I restarted the keycloak after, it works !

Thank you !