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?
Asked
Active
Viewed 7,736 times
4
-
1Hi there. The quality of this question is quite low. Please read the guide "how do I ask a good question?" and improve yours: https://stackoverflow.com/help/how-to-ask – the hand of NOD Feb 28 '20 at 07:15
2 Answers
5
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"

Yuriy P
- 1,330
- 9
- 16
-
1@Madeo, just double check and it works fine. And this is just instruction from an official page [jboss/keycloak](https://hub.docker.com/r/jboss/keycloak/) – Yuriy P Jun 16 '21 at 08:25
-
This answer is outdated, [Replacement for add-user-keycloak.sh | Github](https://github.com/keycloak/keycloak/discussions/10302) - Apparently the `add-user-keycloak.sh` bin is no longer available since Keycloak 17. – Adrian Moisa Aug 27 '23 at 16:54