Updated: 23 December 2025

What is Dapr?

Abbreivation for “Distributed Application Runtime”

Dapr is a runtime/framework for developing event-driven microservices and cloud-native applications

Dapr can be installed by following the relevant instructions from the documentation

Getting Started

When using Dapr it’s recommended that you also have Docker installed

Dapr works by deploying sidecar containers that manage communication and service invocation between services

To initialize Dapr you can run the following command to download the required binaries and config as well as start some of the required Docker containers:

Terminal window
1
dapr init

Thereafter, you can view the running containers that Dapr has initialized with:

Terminal window
1
docker ps
1
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2
365529eb2137 daprio/dapr "./placement" 19 minutes ago Up 19 minutes 0.0.0.0:6050->50005/tcp dapr_placement
3
86802da99f48 redis "docker-entrypoint.s…" 20 minutes ago Up 20 minutes 0.0.0.0:6379->6379/tcp dapr_redis
4
0affbb4ed6d0 openzipkin/zipkin "start-zipkin" 20 minutes ago Up 20 minutes (healthy) 9410/tcp, 0.0.0.0:9411->9411/tcp dapr_zipkin

And you can verify if the components directory was created

Terminal window
1
ls ~/.dapr
1
Mode LastWriteTime Length Name
2
---- ------------- ------ ----
3
d----- 3/26/2021 5:47 PM bin
4
d----- 3/16/2021 4:10 PM components
5
-a---- 3/16/2021 4:10 PM 187 config.yaml

Run a Component

To run an application/component on Dapr, you use the dapr run command

Running the default Dapr components without actually running any other application can be done with:

Terminal window
1
dapr run --app-id myapp --dapr-http-port 3500

Which will run a blank app which only makes use of the default dapr redis and zipkin components as is defined in the ~/.dapr/components directory we saw above

Based on the default redis state store component that’s defined in the Dapr instance, we can access the state store on http://localhost:3500/v1.0/state/statestore

Using this we can POST some key-value pair data to the endpoint, and retrieve it with the key

So to add something to the state store we can make the following HTTP Request by sending a collection of data:

1
POST /v1.0/state/statestore HTTP/1.1
2
Host: localhost:3500
3
Content-Type: application/json
4
Content-Length: 65
5
6
[
7
{
8
"key": "init_post",
9
"value": "Hello, World!"
10
}
11
]

We can then retreive the data we sent with:

1
GET /v1.0/state/statestore/init_post HTTP/1.1
2
Host: localhost:3500

Which will respond with:

1
"Hello, World!"

We can also log into redis from Docker to view all data in the Redis instance with:

Terminal window
1
docker exec -it dapr_redis redis-cli

And then we can run the following command to view the data in Redis:

Terminal window
1
> keys *
2
3
1) "myapp||init_post"

To view the type of the value that Dapr saves the data as:

Terminal window
1
> type "myapp||init_post
2
3
hash

Since the type is hash we need to use hgetall to get the value

Terminal window
1
> hgetall "myapp||init_post"
2
3
1) "data"
4
2) "\"Hello, World!\""
5
3) "version"
6
4) "1"

Additionally, Dapr apps are managed using components which are defined using yml, there are a number of Quickstart guides on this here