Skip to content

Set up CEDAR realm

Keycloak groups the settings and users of an organization under realms.

Setting up a realm is not trivial, so instead of guiding the user through the UI of Keycloak, we created a CEDAR realm that can be imported into Keycloak easily.

The CEDAR Keycloak realm can be found in the ${CEDAR_HOME}/cedar-util/keycloak/realm/ directory.

Import CEDAR realm

You will need the MySql server running for this step. Check if it is already available using cedarss:


Importing a realm is done by starting Keycloak in the import mode

cd ${CEDAR_HOME}/cedar-util/keycloak/realm/
  -Dkeycloak.migration.action=import \
  -Dkeycloak.migration.provider=singleFile \
  -Dkeycloak.migration.file=keycloak-realm.CEDAR.development.20201020.json \

Please monitor the log output for anomalies. Not that this importation process can take several minutes so please wait until it has finished.

Once the logs stopped, and you see the following line:

HH:MM:SS,SSS INFO  [] (Controller Boot Thread) WFLYSRV0051: Admin console listening on

please stop Keycloak using one Ctrl + C.

Start Keycloak in regular mode

You can start Keycloak from now on by executing:


Check Keycloak status


You should see the following line in the output:

| Keycloak                   | Running | httpResponse| 8080| HTTP/1.1\s200\sOK |

Stop Keycloak

If you need to stop Keycloak, do that by:


The script starts with kill to emphasize that actually the process is killed.

Export CEDAR realm

Export CEDAR realm

If at any moment you need to back up your realm, and you do not wish or cannot perform a full database export, you can export the realm as a JSON file.

This file will contain your realm settings, your users, roles and credentials.

It will not contain any logs or historical data.

to export the file, you will need to stop Keycloak, export the data, and then start it again.

  -Dkeycloak.migration.action=export \
  -Dkeycloak.migration.provider=singleFile \
  -Dkeycloak.migration.realmName=CEDAR \
Stop Keycloak using one Ctrl + C.