I cannot login to keycloak in the initial setup. I managed to run the server via /standalone.sh -b=0.0.0.0 command and when accessing it via http://x.x.x.x:8080 the login page doesn't allow me to login with admin/admin username and password. any hint is highly apreciated.
keycloak initial login does not work with admin username and password
37.9k Views Asked by Soheila DehghanZadeh AtThere are 3 best solutions below

In order to create the initial administrator user you need to use add-user-keycloak.sh
(.bat) script located in keycloak/bin
with all other scripts. Run it before starting/restarting the server, so Keycloak could pick up the user:
$ ./add-user-keycloak.sh -u admin -p password
.
$ ./add-user-keycloak.sh --help
will show you all the available options.

According to the latest keycloak documentation (today) there are two procedures for creating the first administrator credentials:
Creating the account on the local host
If your server is accessible from localhost, perform these steps. Procedure:
- In a web browser, go to the http://localhost:8080 URL.
- Supply a username and password that you can recall in the Welcome page
Creating the account remotely
If you cannot access the server from a localhost address, or just want to start Keycloak from the command line, use the KEYCLOAK_ADMIN and KEYCLOAK_ADMIN_PASSWORD environment variables to create an initial admin account.
For example:
export KEYCLOAK_ADMIN=<username>
export KEYCLOAK_ADMIN_PASSWORD=<password>
bin/kc.[sh|bat] start
If you are someone who have setup KeyCloak in Kubernetes then we can port-forward and access the localhost:8080/auth that is how I did the initial admin user setup.