How can I know the Keycloak version?
Asked Answered
T

4

9

In the older KeyCloak versions, we could use:

/opt/jboss/keycloak/bin/standalone.sh -version

This would print the version info.

But in newer versions it seems that this standalone.sh is removed.

How can I get the version in newer versions?

Trifoliate answered 20/2, 2023 at 6:4 Comment(0)
H
8

You can do:

cat version.txt 

in the root folder that contains Keycloak.

Or

./bin/kc.sh --version

and get as an output for example:

Keycloak 20.0.3
(..)
Hoff answered 20/2, 2023 at 7:49 Comment(0)
U
17

You can view the version in the UI as well. You need to select the "master" realm first and then click on the Keycloak logo in the top-left corner. It will show something like this:

Screenshot of the server info of Keycloak

In this case, the Keycloak version is 21.0.1.

Unicef answered 9/5, 2023 at 6:10 Comment(0)
H
8

You can do:

cat version.txt 

in the root folder that contains Keycloak.

Or

./bin/kc.sh --version

and get as an output for example:

Keycloak 20.0.3
(..)
Hoff answered 20/2, 2023 at 7:49 Comment(0)
S
0

In bash I get the local (i.e. installed) version from version.txt with:

localKeycloak=`cat /opt/keycloak/version.txt | cut -d ' ' -f 4`

(you may need to change /opt/keycloak according to to the actual folder in your system)

then I check the latest version on GitHub with:

latestKeycloak=`curl -sL https://api.github.com/repos/keycloak/keycloak/releases/latest | jq -r .name`

(You'll need to install jq if not already present in your system). You can then use the two versions in a shell script to do do something like sending an email, etc.

if [ "${localKeycloak}" = "${latestKeycloak}" ]
then
    echo "Keycloak installed version (${localKeycloak}) equals latest version online (${latestKeycloak})."
    # do something
else
    echo "Keycloak new version available: ${latestKeycloak}"
    # do something else
fi
Sapindaceous answered 8/4, 2023 at 7:49 Comment(0)
B
0

Starting of Keycloak 24 you can use

/opt/keycloak/bin/kc.sh --version
Blindage answered 30/8 at 20:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.