Can't create initial admin user in keycloak

Viewed 4363

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?

2 Answers

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"

The admin console is available at:

http://localhost:8080/admin
Related