Chapter 1. Getting Started
Get started with Red Hat build of Keycloak on a physical or virtual server.
1.1. Meet the prerequisites Copy linkLink copied to clipboard!
Certain prerequisites exist before you can install Red Hat build of Keycloak.
- Make sure your machine or container platform can provide sufficient memory and CPU for your desired usage of Red Hat build of Keycloak. See Concepts for sizing CPU and memory resources for more on how to get started with production sizing.
- Make sure you have OpenJDK 25 installed.
1.2. Download Red Hat build of Keycloak Copy linkLink copied to clipboard!
Red Hat build of Keycloak is available for download on the Red Hat website.
Procedure
- Download Red Hat build of Keycloak from the Red Hat website and extract it.
-
After extracting this file, look for a directory that is named
rhbk-26.6.7.
1.3. Start Red Hat build of Keycloak Copy linkLink copied to clipboard!
You start the server on the system where you installed it.
Procedure
-
From a terminal, open the
rhbk-26.6.7directory. Enter the following command:
On Linux, run:
bin/kc.sh start-devOn Windows, run:
bin\kc.bat start-devUsing the
start-devoption, you are starting Red Hat build of Keycloak in development mode. In this mode, you can try out Red Hat build of Keycloak for the first time to get it up and running quickly. This mode offers convenient defaults for developers, such as for developing a new Red Hat build of Keycloak theme.
By default, Red Hat build of Keycloak in development mode on Windows Subsystem For Linux the server binds to all network addresses (0.0.0.0). This means your Red Hat build of Keycloak instance may be accessible from other machines on your network, not just from your local machine.
1.4. Create an admin user Copy linkLink copied to clipboard!
Red Hat build of Keycloak has no default admin user. You need to create an admin user before you can start Red Hat build of Keycloak.
Procedure
- Open http://localhost:8080/.
- Fill in the form with your preferred username and password.
1.5. Log in to the Admin Console Copy linkLink copied to clipboard!
With the initial admin account, you can log in to the Admin Console, where you manage users and applications.
Procedure
- Go to the Red Hat build of Keycloak Admin Console.
- Log in with the username and password you created earlier.
1.6. Create a realm Copy linkLink copied to clipboard!
A realm in Red Hat build of Keycloak is equivalent to a tenant. Each realm allows an administrator to create isolated groups of applications and users. Initially, Red Hat build of Keycloak includes a single realm, called master. Use this realm only for managing Red Hat build of Keycloak and not for managing any applications.
Procedure
- Open the Red Hat build of Keycloak Admin Console.
- Click Manage realms in the left column.
- Click Create realm.
-
Enter
myrealmin the Realm name field. Click Create.
Figure 1.1. Add realm
1.7. Create a user Copy linkLink copied to clipboard!
Initially, the realm has no users. Use these steps to create a user:
Procedure
- Verify that you are still in the myrealm realm, which is next to Current realm.
- Click Users in the left-hand menu.
- Click Create new user.
Fill in the form with the following values:
-
Username:
myuser - First name: any first name
- Last name: any last name
-
Username:
Click Create.
Figure 1.2. Create user
To set the initial password for this users
- Click Credentials at the top of the page.
- Fill in the Set password form with a password.
Toggle Temporary to Off so that the user does not need to update this password at the first login.
Figure 1.3. Set password
1.8. Log in to the Account Console Copy linkLink copied to clipboard!
To verify this user is configured correctly, you can now log in to the Account Console.
Procedure
- Open the Red Hat build of Keycloak Account Console.
Log in with
myuserand the password you created earlier.As a user in the Account Console, you can manage your account including modifying your profile, adding two-factor authentication, and including identity provider accounts.
1.9. Secure the first application Copy linkLink copied to clipboard!
To secure the first application, you start by registering the application with your Red Hat build of Keycloak instance:
Procedure
- Open the Red Hat build of Keycloak Admin Console.
- Click myrealm next to Current realm.
- Click Clients.
- Click Create client
Fill in the form with the following values:
-
Client type:
OpenID Connect Client ID:
myclientFigure 1.4. Add client
-
Client type:
- Click Next.
- Confirm that Standard flow is enabled.
- Click Next.
Make these changes under Login settings.
-
Set Valid redirect URIs to
https://www.keycloak.org/app/* -
Set Web origins to
https://www.keycloak.org
-
Set Valid redirect URIs to
Click Save.
Figure 1.5. Update client
To confirm the client was created successfully, you can use the SPA testing application on the Keycloak website.
- Open https://www.keycloak.org/app/.
- Click Save to use the default configuration.
- Click Sign in to authenticate to this application using the Red Hat build of Keycloak server you started earlier.
1.10. Taking the next step Copy linkLink copied to clipboard!
Before you run Red Hat build of Keycloak in production, consider the following actions:
- Switch to a production ready database such as PostgreSQL.
- Configure SSL with your own certificates.
- Switch the admin password to a more secure password.
For more information, see the Server Configuration Guide.