Step by Step Guide to Setup Keycloak on Local Machine

Anamol Soman
Webtips
Published in
2 min readNov 1, 2021

Step by step guide to setup and configure the keycloak on the local machine

I’m Anamol Soman and I’m a web developer. In this blog, we are going to learn how to setup the keycloak step by step on your local machine. Let's get started

What is Keycloak

Keycloak is an open-source software product to allow single sign-on with Identity and Access Management aimed at modern applications and services. There is no need to have your own rest API to handle the authentication and user management like key features, keycloak does all this for us, we just need to connect it with our front end and configure the keycloak admin panel

Installation

There are multiple ways to install the keycloak, the first one is using the zip/tar file and another one is using the docker. In this tutorial, we are going to see both the ways to install the keycloak

Installation by Tar/Zip file

  • Download the keycloak [zip|tar.gz] from keycloak downloads
  • Place the file in a directory you want
  • unzip the file in that directory,
##  Command For Linux/Unix ##$ unzip keycloak-15.0.2.zip
or
$ tar -xvzf keycloak-15.0.2.tar.gz
## Command For Windows ##> Expand-Archive -Path 'C:Downloads\keycloak-15.0.2.zip' -DestinationPath 'C:\Downloads'
  • Install the JDK if it's not installed in your system
## Check if JDK is available or not ##java --version## Install the JDK ##sudo apt-get install default-jdk -y
  • Go to the bin directory and run a standalone boot script
## Linux / Unix ##$ cd bin
$ ./standalone.sh
## Windows ## ...\bin\standalone.bat
  • Got to this Url and if you see the admin page means you have successfully setup the keycloak on your local machine

Installation Using Docker

The docker installation is pretty simple just follow below steps

  • Install docker (If not installed in your system)
  • Run this command and it will pull the keycloak and create a docker container
sudo docker run -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin jboss/keycloak
  • Go to this URL to check if it's installed or not

Conclusion

In this blog, we have learned how to install the keycloak on a local machine using two different methods. In the next blog, we will see how to configure the keycloak admin panel. After following this blog if you face any issue then you can ask me in the comment section I will try my best to help you out

“If you enjoyed my content, consider supporting my work by buying me a coffee on Ko-fi. Your contribution fuels my creativity and helps me keep producing quality content. Every coffee is deeply appreciated! Thanks for being an awesome supporter! Buy a Coffee

Thank you

--

--

Anamol Soman
Webtips
Writer for

Experienced frontend developer with 5 years of proficiency in creating responsive and user-friendly web applications.