How to Install Keycloak on Windows for Local Authentication

Posted by

Step 1: Install Java JDK

  • Keycloak requires Java (JDK 17 or newer).
  • Download from Adoptium Temurin or Oracle.
  • After install, set the JAVA_HOME environment variable.
    Confirm by running java -version in Command Prompt.

Step 2: Download and Extract Keycloak

  • Get the Quarkus (.zip) distribution from the Keycloak release page.
  • Extract it to a folder, e.g., C:\keycloak\

Step 3: Start XAMPP and MySQL

  • Open XAMPP and Start Apache and MySQL.
  • Create a database for Keycloak (example: keycloak_db) using phpMyAdmin.

Step 4: Configure Keycloak to Use XAMPP Database (optional but recommended)

  • In C:\keycloak\conf\keycloak.conf add:textdb=mariadb db-url=jdbc:mariadb://localhost:3306/keycloak_db db-username=root db-password=YOUR_PASSWORD If using XAMPP’s MariaDB with socket, see for unix_socket setup.
  • Copy the MariaDB JDBC driver (mariadb-java-client-*.jar) to C:\keycloak\providers if not included.

Step 5: Start Keycloak

  • Open Command Prompt.
  • Go to C:\keycloak\bin
  • For first run, set admin username and password:textset KEYCLOAK_ADMIN=admin set KEYCLOAK_ADMIN_PASSWORD=admin123 kc.bat start-dev
  • Wait for “Keycloak started” message.

Step 6: Access Keycloak Console

Notes

  • XAMPP is only needed for MySQL/MariaDB.
    Keycloak runs as its own server and does not “install inside” XAMPP.
  • For production, run Keycloak as a Windows service (nssm can help; see ), and use secure passwords.
  • Official guides:
    Keycloak Docs
    Step-by-step Windows

Leave a Reply

0
Would love your thoughts, please comment.x
()
x