init CLI command reference

    Install Dapr on supported hosting platforms.

    Self hosted environment

    Install Dapr by pulling container images for Placement, Redis and Zipkin. By default these images are pulled from Docker Hub. To switch to Dapr Github container registry as the default registry, set the DAPR_DEFAULT_IMAGE_REGISTRY environment variable value to be GHCR. To switch back to Docker Hub as default registry, unset this environment variable.

    1. dapr init

    You can also specify a specific runtime version. Be default, the latest version is used.

    You can also install Dapr with a particular image variant, for example: .

    1. dapr init --image-variant mariner

    Dapr can also run Slim self-hosted mode without Docker.

    1. dapr init -s

    In an offline or airgap environment, you can and use this to install Dapr instead of pulling images from the network.

    1. dapr init -s --from-dir <path-to-installer-bundle-directory>

    You can also specify a private registry to pull container images from. These images need to be published to private registries as shown below to enable Dapr CLI to pull them successfully via the dapr init command -

    1. Dapr runtime container image(dapr) (Used to run Placement) - dapr/dapr:
    2. Redis container image(rejson) - dapr/3rdparty/rejson
    3. Zipkin container image(zipkin) - dapr/3rdparty/zipkin

      This command resolves the complete image URI as shown below -

      1. Placement container image(dapr) - docker.io/username/dapr/dapr:
      2. Redis container image(rejson) - docker.io/username/dapr/3rdparty/rejson
      3. zipkin container image(zipkin) - docker.io/username/dapr/3rdparty/zipkin

      You can specify a different container runtime while setting up Dapr. If you omit the --container-runtime flag, the default container runtime is Docker.

      1. dapr init --container-runtime podman

      Kubernetes environment

      1. dapr init -k

      You can also specify a specific runtime version.

      1. dapr init -k --runtime-version 1.4.0

      Use the --set flag to configure a set of during Dapr installation to help set up a Kubernetes cluster.

      1. dapr init -k --set global.tag=1.0.0 --set dapr_operator.logLevel=error

      You can also specify a private registry to pull container images from. As of now dapr init -k does not use specific images for sentry, operator, placement and sidecar. It relies on only Dapr runtime container image dapr for all these images.

      Scenario 1 : dapr image hosted directly under root folder in private registry -

      1. dapr init -k --image-registry docker.io/username

      Scenario 2 : dapr image hosted under a new/different directory in private registry -

        Last modified October 8, 2022: Support for alternative container runtimes - Podman (#2745) (54b783ad)