Keycloak 8: User with username ‘admin’ already added

Just to clarify the other answers. I had the same issue. What helped for me was:

  1. stop all containers
  2. comment out the two relevant lines

    version: "3"
    
    services:
      keycloak:
        image: quay.io/keycloak/keycloak:latest
        environment:
          # KEYCLOAK_USER: admin
          # KEYCLOAK_PASSWORD: pass
          ...
    
  3. start all containers;

  4. wait until keycloak container has successfully started
  5. stop all containers, again
  6. comment back in the two lines from above

    version: "3"
    
    services:
      keycloak:
        image: quay.io/keycloak/keycloak:latest
        environment:
          KEYCLOAK_USER: admin
          KEYCLOAK_PASSWORD: pass
          ...
    
  7. start all containers

This time (and subsequent times) it worked. Keycloak was running and the admin user was registered and working as expected.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)