Quick start

From finding an extension to a running custom Keycloak image in three steps.

  1. 1

    Find an extension

    Browse the registry. On each extension's Overview tab, the Install section shows the exact Dockerfile to copy — with the correct image reference and version already filled in.

  2. 2

    Paste into your Dockerfile

    Copy the snippet from the extension page and use it as your Dockerfile. To add more extensions, duplicate the COPY --from= line — one per extension, before the RUN kc.sh build step.

    FROM quay.io/keycloak/keycloak AS builder
    COPY --from=kcer.dev/providers/keycloak-home-idp-discovery:v26.1.1 /providers/ /opt/keycloak/providers/
    RUN /opt/keycloak/bin/kc.sh build
    
    FROM quay.io/keycloak/keycloak
    COPY --from=builder /opt/keycloak/ /opt/keycloak/
    ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]
    CMD ["start", "--optimized"]
  3. 3

    Build and run

    Run docker build .. Extensions are baked in at build time — your running container has no dependency on the registry. To upgrade an extension, change the image tag in the COPY --from= line and rebuild.