Contents
Keycloak is a server that handles user login on behalf of your applications. Instead of building a login form and password storage into every app, you hand authentication to Keycloak.
This review is for developers who want to learn how authentication works by trying it, and for administrators who want to centralize login. After reading it, you can do the following:
- Start Keycloak in development mode on your own computer
- Create a realm, a user, and a client, and sign in to a test app
- Know what to reconfigure before you use Keycloak in production
What Keycloak is
Keycloak is open source software released under the Apache License 2.0. It is a CNCF (Cloud Native Computing Foundation) project and was accepted on April 10, 2023 at the Incubating maturity level.
What Keycloak does
The official site lists these main features:
- Single sign-on (SSO): After one login, users can open other apps that use Keycloak without logging in again. Logout also applies to all of those apps at once.
- Standard protocols: It supports OpenID Connect, OAuth 2.0, and SAML 2.0.
- Identity brokering: You can add social login, or connect existing OpenID Connect and SAML 2.0 identity providers, from the admin console.
- User federation: It connects to existing LDAP or Active Directory servers so their users can log in.
- Admin and account consoles: Administrators manage users and applications. Users update their own profile and password and set up two-factor authentication.
- Fine-grained authorization: When roles are not enough, you can define policies to manage permissions.
For two-factor authentication, the Server Administration Guide describes one-time passwords (OTP) from an authenticator app and passkeys (WebAuthn).
Basic terms
These definitions follow “Core concepts and terms” in the Server Administration Guide.
| Term | Meaning |
|---|---|
| Realm | Manages a set of users, credentials, roles, and groups. Realms are isolated from one another and only authenticate their own users |
| Client | Something that asks Keycloak to authenticate a user. Usually an application or service you want to protect |
| User | Someone who can log in to your system |
| Role | A type or category of user, such as admin or user. Apps often grant permissions per role |
| Credentials | Data used to verify a user’s identity, such as passwords and one-time passwords |
The built-in master realm is for managing Keycloak itself. The official guide tells you to create a separate realm for your applications.
Trying it safely: development mode on your own computer
The official Getting started guides cover Docker and OpenJDK (unzip and run). This section follows the Docker guide. Run it only on your own computer.
-
On a computer with Docker installed, run the following command.
26.8.1was the version when this review was written. Check the Getting started page for the current version.docker run -p 127.0.0.1:8080:8080 -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:26.8.1 start-devBecause of
127.0.0.1, only your own computer can connect. The admin username and password are bothadmin. This is for practice, so do not expose it. -
Open
http://localhost:8080/adminin a browser and log in asadmin. -
In the left column, click Manage realms, then Create realm, and create a realm named
myrealm. -
Under Users, click Create new user and create
myuser. Set a password under Credentials and turn Temporary off. -
Open
http://localhost:8080/realms/myrealm/accountand log in asmyuser. This is the Account Console for users. -
Under Clients, click Create client. Set Client type to
OpenID Connectand Client ID tomyclient. Set Valid redirect URIs tohttps://www.keycloak.org/app/*and Web origins tohttps://www.keycloak.org, then save. -
Open the official test app at
https://www.keycloak.org/app/, click Save, then Sign in. If your own Keycloak login page appears, you have walked through an SSO flow.
Without Docker, follow the OpenJDK guide: unzip the distribution and run bin/kc.sh start-dev on Linux or bin\kc.bat start-dev on Windows. In that case you create the admin user the first time you open http://localhost:8080/.
Why not to use start-dev in production
start-dev is development mode. According to the official documentation, development mode sets these defaults:
- HTTP is enabled
- Strict hostname resolution is disabled
- The cache is local to one instance (no distributed cache for high availability)
- Theme and template caching are disabled
Production mode starts with bin/kc.[sh|bat] start. It follows a “secure by default” principle: HTTP is disabled, and a hostname and HTTPS/TLS setup are expected. Without them, Keycloak shows an error on purpose and does not start.
The official documentation also warns that in development mode on Windows Subsystem for Linux (WSL), the server binds to all network addresses (0.0.0.0) by default. Other machines on your network may be able to reach it, so take care when you try it in WSL.
What you need to run it
| Item | Details |
|---|---|
| Java | OpenJDK 17, 21, or 25 (all LTS). OpenJDK 25 is suggested for production |
| Official container image | Published on Quay.io. It uses OpenJDK 21 |
| Where it runs | Linux or Windows servers, Docker or Podman, Kubernetes (OpenShift) |
| Database | In production, use a supported version of PostgreSQL, MySQL, MariaDB, Microsoft SQL Server, Oracle, or another supported database |
The full list of supported versions is on the Supported Configurations page.
What to do in production
The official “Configuring Keycloak for production” guide covers these points:
- Use HTTPS: Keycloak exchanges sensitive data, so protect all communication with TLS.
- Set the hostname: Decide the public hostname that applications use.
- Keep the admin console off the public internet: Expose the Administration REST API and console on a different hostname or context path than the login pages. Block REST APIs that should not be public at the reverse proxy.
- Use a reverse proxy: The “Configuring a reverse proxy” guide lists which paths to expose and which to hide.
- Use a production-grade database: Configure one of the supported databases.
- Run more than one instance: A typical production setup runs two or more instances so users can still log in if one goes down.
Following security updates
Keycloak publishes vulnerability information, with severity, in the Security Advisories of its GitHub repository. New releases are also announced in the News section of the official site. If you run Keycloak yourself, check both regularly and apply updates.
The security policy explains how to report a vulnerability. Vulnerabilities in the Keycloak codebase go to a dedicated email address, not to a public issue.
Cautions
- The
admin/adminaccount from Getting started is for practice. Do not use it anywhere other people can reach. - Do not test or probe login pages or admin consoles of Keycloak servers you do not manage without permission.
- Before going to production, check production mode with
startand work through the production points above.
Read next
Sources
- Keycloak official site (features)www.keycloak.org
- Official repository (README)github.com/keycloak/keycloak
- License (LICENSE.txt)github.com/keycloak/keycloak/blob/main/LICENSE.txt
- CNCF: Keycloak project pagewww.cncf.io/projects/keycloak/
- Getting started: Dockerwww.keycloak.org/getting-started/getting-started-docker
- Getting started: OpenJDKwww.keycloak.org/getting-started/getting-started-zip
- Supported configurations (Java versions and more)www.keycloak.org/server/supported-configurations
- Configuring Keycloak (development and production mode)www.keycloak.org/server/configuration
- Configuring Keycloak for productionwww.keycloak.org/server/configuration-production
- Server Administration Guide: Core concepts and termswww.keycloak.org/docs/latest/server_admin/index.html
- Security policywww.keycloak.org/security
- GitHub security advisoriesgithub.com/keycloak/keycloak/security/advisories
Checked on 2026-10-25
Similar tools
Wazuh
Impact Local onlyA free security platform (SIEM/XDR) that collects logs, configuration, and vulnerability data from agents on your endpoints and shows it all in one dashboard.
- Purpose
- Defense
- Type
- Self-hosted server
- Difficulty
- Advanced
- License
- CopyleftGPL-2.0(一部の構成要素は Apache-2.0)
- Category
- Vulnerability scanning / Forensics
ZAP
Impact Can harm othersA free web app scanner that sits between your browser and a web app, records the traffic, and looks for vulnerabilities. Formerly OWASP ZAP, now ZAP by Checkmarx.
- Purpose
- Audit
- Type
- Desktop app
- Difficulty
- Intermediate
- License
- PermissiveApache-2.0
- Category
- Web security / Vulnerability scanning