Issue with Initial admin user

I am not able to set the KEYCLOAK_ADMIN and KEYCLOAK_ADMIN_PASSWORD from cli to initiate the initial admin user.

What is your startup command? How are you starting Keycloak and setting the environment variables?

set KEYCLOAK_ADMIN=admin
set KEYCLOAK_ADMIN_PASSWORD=admin
./kc.bat build
./kc.bat start-dev or start

I’m not super familiar with Windows, but I think there is probably some kind of process forking, and the set command is insufficient for getting it to the process space where Keycloak is executing. Have you tried setx KEYCLOAK_ADMIN admin instead?

yeah setx also tried,
can you tell me for redhat linux, if you don’t familiar with windows, for windows UI is fine, for linux need to set through cli only

KEYCLOAK_ADMIN=admin KEYCLOAK_ADMIN_PASSWORD=admin ./bin/kc.sh start-dev

Thank you so much It worked,
Do you have any template to create a service file for keycloak to run it as a service in redhat linux? please.

Hi
Can you tell me what should i have to do if i need keycloak logs to be logged?

I have tried the env vars above on my linux server and cannot login with them when I goto the admin login. I’ve tried on both version 18 and version 20. can someone please help?