Install the Dapr CLI

The Dapr CLI is the main tool you’ll be using for various Dapr related tasks. You can use it to run an application with a Dapr sidecar, as well as review sidecar logs, list running services, and run the Dapr dashboard. The Dapr CLI works with both self-hosted and Kubernetes environments.

You can learn more about the CLI and available commands in the CLI reference docs.

Step 1: Run the installation script

Begin by downloading and installing the latest version of the Dapr CLI:

This command installs the latest linux Dapr CLI to /usr/local/bin:

  1. wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash

This Command Prompt command installs the latest windows Dapr cli to C:\dapr and adds this directory to User PATH environment variable.

  1. powershell -Command "iwr -useb https://raw.githubusercontent.com/dapr/cli/master/install/install.ps1 | iex"

This command installs the latest darwin Dapr CLI to /usr/local/bin:

  1. curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | /bin/bash

Or you can install via Homebrew:

  1. brew install dapr/tap/dapr-cli

Each release of Dapr CLI includes various OSes and architectures. These binary versions can be manually downloaded and installed.

  1. Download the desired Dapr CLI from the latest Dapr Release
  2. Unpack it (e.g. dapr_linux_amd64.tar.gz, dapr_windows_amd64.zip)
  3. Move it to your desired location.
    • For Linux/MacOS - /usr/local/bin
    • For Windows, create a directory and add this to your System PATH. For example create a directory called C:\dapr and add this directory to your User PATH, by editing your system environment variable.

Step 2: Verify the installation

You can verify the CLI is installed by restarting your terminal/command prompt and running the following:

  1. dapr

The output should look like this:

  1. ____/ /___ _____ _____
  2. / __ / __ '/ __ \/ ___/
  3. / /_/ / /_/ / /_/ / /
  4. \__,_/\__,_/ .___/_/
  5. /_/
  6. ===============================
  7. Distributed Application Runtime
  8. Usage:
  9. dapr [command]
  10. Available Commands:
  11. completion Generates shell completion scripts
  12. components List all Dapr components. Supported platforms: Kubernetes
  13. configurations List all Dapr configurations. Supported platforms: Kubernetes
  14. dashboard Start Dapr dashboard. Supported platforms: Kubernetes and self-hosted
  15. help Help about any command
  16. init Install Dapr on supported hosting platforms. Supported platforms: Kubernetes and self-hosted
  17. invoke Invoke a method on a given Dapr application. Supported platforms: Self-hosted
  18. list List all Dapr instances. Supported platforms: Kubernetes and self-hosted
  19. logs Get Dapr sidecar logs for an application. Supported platforms: Kubernetes
  20. mtls Check if mTLS is enabled. Supported platforms: Kubernetes
  21. publish Publish a pub-sub event. Supported platforms: Self-hosted
  22. run Run Dapr and (optionally) your application side by side. Supported platforms: Self-hosted
  23. status Show the health status of Dapr services. Supported platforms: Kubernetes
  24. stop Stop Dapr instances and their associated apps. . Supported platforms: Self-hosted
  25. uninstall Uninstall Dapr runtime. Supported platforms: Kubernetes and self-hosted
  26. Flags:
  27. -h, --help help for dapr
  28. --version version for dapr
  29. Use "dapr [command] --help" for more information about a command.

Next step: Initialize Dapr »

Last modified February 16, 2021: Merge pull request #1235 from dapr/update-v0.11 (b4e9fbb)