Initialize Dapr in your local environment

Now that you’ve , use the CLI to initialize Dapr on your local machine.

Dapr runs as a sidecar alongside your application. In self-hosted mode, this means it is a process on your local machine. By initializing Dapr, you:

  • Fetch and install the Dapr sidecar binaries locally.

Dapr initialization includes:

  1. Running a Redis container instance to be used as a local state store and message broker.
  2. Running a Zipkin container instance for observability.
  3. Creating a default components folder with component definitions for the above.
  4. Running a Dapr placement service container instance for local actor support.

Docker

The recommended development environment requires . While you can initialize Dapr without a dependency on Docker), the next steps in this guide assume the recommended Docker development environment.

You can also install in place of Docker. Read more about initializing Dapr using Podman.

You will need to use sudo for this quickstart if:

  • You run your Docker commands with sudo, or

Run Windows Terminal or command prompt as administrator.

  1. Right click on the Windows Terminal or command prompt icon.
  2. Select Run as administrator.

Output:


Runtime version: 1.10.2

As mentioned earlier, the dapr init command launches several containers that will help you get started with Dapr. Verify you have container instances with daprio/dapr, , and redis images running:

Output:

On dapr init, the CLI also creates a default components folder that contains several YAML files with definitions for a state store, Pub/sub, and Zipkin. The Dapr sidecar will read these components and use:

  • The Redis container for state management and messaging.
  • The Zipkin container for collecting traces.

Verify by opening your components directory:

Output:

bin components config.yaml

Result:

Init Dapr locally - 图2