'Can't create initial admin user in keycloak

it shows an error "we are sorry an internal error occurred" while entered username password and confirm password. How can i create initial admin user?



Solution 1:[1]

If you are running Keycloak in docker container then you can define admin name and password during startup:

docker run --name keycloak -p 8080:8080 -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin jboss/keycloak

Otherwise, you can add the user as follows (this actually what is done in docker container behind the scenes):

/opt/jboss/keycloak/bin/add-user-keycloak.sh --user "$KEYCLOAK_USER" --password "$KEYCLOAK_PASSWORD"

Solution 2:[2]

The admin console is available at:

http://localhost:8080/admin

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yuriy P
Solution 2 Basil