### reference https://www.keycloak.org/getting-started/getting-started-zip 1. Download the latest released [keycloak-12.0.4](https://github.com/keycloak/keycloak/releases/download/12.0.4/keycloak-12.0.4.tar.gz) as it on our Downloads folder 2. Extracting Keycloak .tar file ```bash bboy:~$ pwd /home/bboy bboy:~$ cd /opt/ bboy:/opt$ sudo tar -xzf /home/bboy/Downloads/keycloak-12.0.4.tar.gz ``` 3. Add some needed environmental variables namely; 1. export JBOSS_HOME=/opt/keycloak-12.0.4 2. export JAVA=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/bin/java * Open new terminal window and follow the commands below; ```bash bboy:~$ cd /usr/lib/jvm/ bboy:/usr/lib/jvm$ sudo nano /etc/bash.bashrc ``` * Add below entries at end of the file ```bash export JBOSS_HOME=/opt/keycloak-12.0.4 export JAVA=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/bin/java ``` * Close and save by; Ctrl+X > Y > Enter * Apply the changes ```bash bboy:/usr/lib/jvm$ source /etc/bash.bashrc ``` 4. Run Keycloak ```bash bboy:/usr/lib/jvm$ cd /opt/keycloak-12.0.4/ bboy:/opt/keycloak-12.0.4$ bin/standalone.sh ``` 5. Add user to Keycloak (uadmin:upassword1) ```bash bboy:/opt/keycloak-12.0.4$ bin/add-user.sh What type of user do you wish to add? a) Management User (mgmt-users.properties) b) Application User (application-users.properties) (a): a Enter the details of the new user to add. Using realm 'ManagementRealm' as discovered from the existing property files. Username : uadmin Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file. - The password should be different from the username - The password should not be one of the following restricted values {root, admin, administrator} - The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s) Password : upassword1 WFLYDM0102: Password should have at least 1 non-alphanumeric symbol. Are you sure you want to use the password entered yes/no? yes Re-enter Password : upassword1 What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]: admin About to add user 'uadmin' for realm 'ManagementRealm' Is this correct yes/no? yes Added user 'uadmin' to file '/opt/keycloak-12.0.4/standalone/configuration/mgmt-users.properties' Added user 'uadmin' to file '/opt/keycloak-12.0.4/domain/configuration/mgmt-users.properties' Added user 'uadmin' with groups admin to file '/opt/keycloak-12.0.4/standalone/configuration/mgmt-groups.properties' Added user 'uadmin' with groups admin to file '/opt/keycloak-12.0.4/domain/configuration/mgmt-groups.properties' Is this new user going to be used for one AS process to connect to another AS process? e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls. yes/no? yes To represent the user add the following to the server-identities definition bboy:/opt/keycloak-12.0.4$ ```