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?
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?
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
(..)
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:
In this case, the Keycloak version is 21.0.1.
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
(..)
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
Starting of Keycloak 24 you can use
/opt/keycloak/bin/kc.sh --version
© 2022 - 2024 — McMap. All rights reserved.