Initialize Dapr in your local environment

Dapr runs as a sidecar alongside your application, and in self-hosted mode this means it is a process on your local machine. Therefore, initializing Dapr includes fetching the Dapr sidecar binaries and installing them locally.

In addition, the default initialization process also creates a development environment that helps streamline application development with Dapr. This includes the following steps:

  1. Running a Zipkin container instance for observability
  2. Creating a default components folder with component definitions for the above
  3. Running a Dapr placement service container instance for local actor support

Docker

This recommended development environment requires Docker. It is possible to initialize Dapr without a dependency on Docker (see ) but next steps in this guide assume the recommended development environment.

If you run your Docker commands with sudo, or the install path is (default install path), you will need to use sudo below.

Make sure that you run Command Prompt as administrator (right click, run as administrator)

  1. dapr --version

Output should look like this:

As mentioned above, the dapr init command launches several containers that will help you get started with Dapr. Verify this by running:

    Make sure that instances with daprio/dapr, openzipkin/zipkin, and redis images are all running:

    On , the CLI also creates a default components folder which includes several YAML files with definitions for a state store, pub/sub and zipkin. These will be read by the Dapr sidecar, telling it to use the Redis container for state management and messaging and the Zipkin container for collecting traces.

    • In Linux/MacOS Dapr is initialized with default components and files in $HOME/.dapr.
    • For Windows Dapr is initialized to %USERPROFILE%\.dapr\

    • Windows

    Run:

    1. ls $HOME/.dapr

    You should see:

    Using Command Prompt (not PowerShell), open in file explorer:

    1. explorer "%USERPROFILE%\.dapr\"

    You will see the Dapr config, Dapr binaries directory, and the default components directory for Dapr: