How to set a PostgreSQL as a primary DB instead of H2

This tutorial is intended for those, who followed "Getting started" tutorial to run IdM as a local demo (for Linux server).

It is not recommended for production use!!!

1) Authentication method properly set in "pg_hba.conf" to be able to CzechIdM to connect.


2) DB dedicated to CzechIdM with proper owner - ideally named "czechidm"


3) PostgreSql up and running - check with

systemctl status postgresql.service -l

1) Download jdbs postgresql driver for tomcat and place it into tomcat /lib


2) In tomcat /bin create "" file with

JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Djavax.servlet.request.encoding=UTF-8 -Djava.util.Arrays.useLegacyMergeSort=true"

thus you specify spring profile as "dev"

3) Check file "/webapps/idm/WEB-INF/classes/" in tomcat. There credentials must be set for the tomcat to connect to PostgreSQL, for example


If idm wasn't deployed yet (folder idm doesn't exist). The file ** will be available in idm.war file. "idm.war/webapps/idm/WEB-INF/classes/".

4) Now you can start tomcat as usual (

Be aware that this tutorial only shows quick solution to set connection to postgreSQL. It is for testing purposes only and not for production use
If you upgrade to new version of czechidm - thus tomcat make changes in "webapps/idm" directory, you lost the configuraction set in this tutorial. So do not deploy to tomcat unless you backup files mensioned in this tutorial!
For files,, and must be setup permissions for read and execute for user that will execute commands for startup and end tomcat - IdM application.
  • by kopro