2.7. Start and configure the Keycloak server
Put the realm configuration file on the classpath (
target/classesdirectory) so that it gets imported automatically when running in dev mode. You do not need to do this if you have already built a complete solution, in which case, this realm file is added to the classpath during the build.注記Do not start the Keycloak server when you run the application in dev mode;
Dev Services for Keycloakwill start a container. For more information, see the Run the application in dev mode section.To start a Keycloak server, you can use Docker to run the following command:
docker run --name keycloak -e KC_BOOTSTRAP_ADMIN_USERNAME=admin -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin -p 8180:8080 quay.io/keycloak/keycloak:{keycloak.version} start-dev-
Where the
keycloak.versionis set to version26.1.3or later.
-
Where the
- You can access your Keycloak server at localhost:8180.
To access the Keycloak Administration console, log in as the
adminuser by using the following login credentials:-
Username:
admin -
Password:
admin
-
Username:
- Import the realm configuration file from the upstream community repository to create a new realm.
For more information, see the Keycloak documentation about creating and configuring a new realm.