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

Your email address will not be published. Required fields are marked *

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