Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

cli

> 编程语言
Open source

Command-line tools for Dapr.

354 stars0 likes1 views
WebsiteGitHub

About

Command-line tools for Dapr.

Dapr CLI

The Dapr CLI allows you to setup Dapr on your local dev machine or on a Kubernetes cluster, provides debugging support, launches and manages Dapr instances.

Getting started

Prerequisites

On default, during initialization the Dapr CLI will install the Dapr binaries as well as setup a developer environment to help you get started easily with Dapr. This environment uses Docker containers, therefore Docker needs to be installed. If you prefer to run Dapr without this environment and no dependency on Docker, after installation of the CLI make sure to follow the instructions to initialize Dapr using slim init.

Note, if you are a new user, it is strongly recommended to install Docker and use the regular init command.

  • Install Docker

Note: On Windows, Docker must be running in Linux Containers mode

Installing Dapr CLI

Using script to install the latest release

Windows

Install the latest windows Dapr CLI to $Env:SystemDrive\dapr and add this directory to User PATH environment variable. Use -DaprRoot [path] to change the default installation directory

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

Linux

Install the latest linux Dapr CLI to /usr/local/bin

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

MacOS

Install the latest darwin Dapr CLI to /usr/local/bin

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

From the Binary Releases

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

  1. Download the Dapr CLI
  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 path, by editing your system environment variable.

From the MSI Package (windows)

Install windows Dapr CLI using MSI package.

  1. Download the MSI Package
  2. Run dapr.msi to install Dapr CLI on your system

NOTE: The default installation directory is set to $Env:SystemDrive\dapr and can be modified at the time of installation.

Install Dapr on your local machine (self-hosted)

In self-hosted mode, dapr can be initialized using the CLI with the placement, scheduler, redis, and zipkin containers enabled by default(recommended) or without them which also does not require docker to be available in the environment.

Initialize Dapr

(Prerequisite: Docker is available in the environment - recommended)

Use the init command to initialize Dapr. On init, multiple default configuration files and containers are installed along with the dapr runtime binary. Dapr runtime binary is installed under $HOME/.dapr/bin for Mac, Linux and %USERPROFILE%.dapr\bin for Windows.

bash
dapr init

For Linux users, if you run your docker cmds with sudo, you need to use "sudo dapr init"

Output should look like so:

⌛  Making the jump to hyperspace...
✅  Downloaded binaries and completed components set up.
ℹ️  daprd binary has been installed to  $HOME/.dapr/bin.
ℹ️  dapr_placement container is running.
ℹ️  dapr_scheduler container is running.
ℹ️  dapr_redis container is running.
ℹ️  dapr_zipkin container is running.
ℹ️  Use `docker ps` to check running containers.
✅  Success! Dapr is up and running. To get started, go here: https://docs.dapr.io/getting-started

Note: To see that Dapr has been installed successfully, from a command prompt run the docker ps command and check that the daprio/dapr:latest, dapr_redis and dapr_zipkin container images are all running.

This step creates the following defaults:

  1. components folder which is later used during dapr run unless the --resources-path (--components-path is deprecated and will be removed in future releases) option is provided. For Linux/MacOS, the default components folder path is $HOME/.dapr/components and for Windows it is %USERPROFILE%\.dapr\components.
  2. component files in the components folder called pubsub.yaml and statestore.yaml.
  3. default config file $HOME/.dapr/config.yaml for Linux/MacOS or for Windows at %USERPROFILE%\.dapr\config.yaml to enable tracing on dapr init call. Can be overridden with the --config flag on dapr run.

Slim Init

Alternatively to the above, to have the CLI not install any default configuration files or run Docker containers, use the --slim flag with the init command. Only Dapr binaries will be installed.

bash
dapr init --slim

Output should look like so:

bash
⌛  Making the jump to hyperspace...
✅  Downloaded binaries and completed components set up.
ℹ️  daprd binary has been installed to $HOME/.dapr/bin.
ℹ️  placement binary has been installed.
ℹ️  scheduler binary has been installed.
✅  Success! Dapr is up and running. To get started, go here: https://docs.dapr.io/getting-started

Note: When initializing Dapr with the --slim flag only the Dapr runtime, placement, and scheduler service binaries are installed. An empty default components folder is created with no default configuration files. During dapr run user should use --resources-path (--components-path is deprecated and will be removed in future releases) to point to a components directory with custom configurations files or alternatively place these files in the default directory. For Linux/MacOS, the default components directory path is $HOME/.dapr/components and for Windows it is %USERPROFILE%\.dapr\components.

Install a specific runtime version

You can install or upgrade to a specific version of the Dapr runtime using dapr init --runtime-version. You can find the list of versions in Dapr Release.

bash
# Install v1.0.0 runtime
dapr init --runtime-version 1.0.0

# Check the versions of CLI and runtime
dapr --version
CLI version: v1.0.0
Runtime version: v1.0.0

Install with mariner images

You can install Dapr Runtime using mariner images using the --image-variant flag.

bash
# Installing Dapr with Mariner images
dapr init --image-variant mariner

Install by providing a docker container registry url

You can install Dapr runtime by pulling docker images from a given private registry uri by using --image-registry flag.

Note: This command expects that images have been hosted like example.io//dapr/dapr:, example.io//dapr/3rdparty/redis:, example.io//dapr/3rdparty/zipkin:

bash
# Example of pulling images from a private registry.
dapr init --image-registry example.io/

Install with a custom scheduler host and port

You can install Dapr runtime with a custom scheduler host and port by using --scheduler-override-broadcast-host-port flag.

bash
dapr init --scheduler-override-broadcast-host-port 192.168.42.42:50006

Note: The default host is localhost.

Install in airgap environment

You can install Dapr runtime in airgap (offline) environment using a pre-downloaded installer bundle. You need to download the archived bundle for your OS beforehand (e.g., daprbundle_linux_amd64.tar.gz,) and unpack it. Thereafter use the local Dapr CLI binary in the bundle with --from-dir flag in the init command to point to the extracted bundle location to initialize Dapr.

Move to the bundle directory and run the following command:

bash
# Initializing dapr in airgap environment
./dapr init --from-dir .

For windows, use .\dapr.exe to point to the local Dapr CLI binary.

If you are not running the above command from the bundle directory, provide the full path to bundle directory as input. For example, assuming the bundle directory path is $HOME/daprbundle, run $HOME/daprbundle/dapr init --from-dir $HOME/daprbundle to have the same behavior.

Note: Dapr Installer bundle just contains the placement and scheduler containers apart from the binaries and so zipkin and redis are not enabled by default. You can pull the images locally either from network or private registry and run as follows:

bash
docker run --name "dapr_zipkin" --restart always -d -p 9411:9411 openzipkin/zipkin
docker run --name "dapr_redis" --restart always -d -p 6379:6379 redis

Alternatively to the above, you can also have slim installation as well to install dapr without running any Docker containers in airgap mode.

bash
./dapr init --slim --from-dir .

Install to a specific Docker network

You can install the Dapr runtime to a specific Docker network in order to isolate it from the local machine (e.g. to use Dapr from within a Docker container).

bash
# Create Docker network
docker network create dapr-network

# Install Dapr to the network
dapr init --network dapr-network

Note: When installed to a specific Docker network, you will need to add the --placement-host-address arguments to dapr run commands run in any containers within that network. The format of --placement-host-address argument is either `` or :. If the port is omitted, the default port 6050 for Windows and 50005 for Linux/MacOS applies.

Note: When installed to a specific Docker network, you will need to add the --scheduler-host-address arguments to dapr run commands run in any containers within that network. The format of --scheduler-host-address argument is either `` or :. If the port is omitted, the default port 6060 for Windows and 50006 for Linux/MacOS applies.

Install with a specific container runtime

You can install the Dapr runtime using a specific container runtime environment such as Docker or Podman by passing along the --container-runtime argument:

bash
# Install Dapr with Podman
$ dapr init --container-runtime podman

Note: The default container runtime is Docker.

In a dev container or GitHub Codespace

To install the Dapr CLI in a dev container or GitHub Codespace, add the following to your devcontainer.json file:

jsonc
"features": {
    "ghcr.io/dapr/cli/dapr-cli:0": {}
}

Restart your dev container or GitHub Codespace and run dapr init to initialize Dapr.

For more details, see the docs for dev containers with Visual Studio Code and GitHub Codespaces.

Uninstall Dapr in a standalone mode

Uninstalling will remove daprd binary along with the placement and scheduler containers (if installed with Docker or the placement and scheduler binaries if not).

bash
dapr uninstall

For Linux users, if you run your docker cmds with sudo, you need to use "sudo dapr uninstall" to remove the containers.

The command above won't remove the redis or zipkin containers by default in case you were using it for other purposes. It will also not remove the default dapr folder that was created on dapr init. To remove all the containers (placement, scheduler, redis, zipkin) and also the default dapr folder created on init run:

bash
dapr uninstall --all

The above command can also be run when Dapr has been installed in a non-docker environment, it will only remove the installed binaries and the default dapr folder in that case.

NB: The dapr uninstall command will always try to remove the placement and scheduler binaries/services and will throw an error is not able to.

**You should always run a dapr uninstall before running another `d

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言