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:
1dapr initThereafter, you can view the running containers that Dapr has initialized with:
1docker ps1CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES2365529eb2137 daprio/dapr "./placement" 19 minutes ago Up 19 minutes 0.0.0.0:6050->50005/tcp dapr_placement386802da99f48 redis "docker-entrypoint.s…" 20 minutes ago Up 20 minutes 0.0.0.0:6379->6379/tcp dapr_redis40affbb4ed6d0 openzipkin/zipkin "start-zipkin" 20 minutes ago Up 20 minutes (healthy) 9410/tcp, 0.0.0.0:9411->9411/tcp dapr_zipkinAnd you can verify if the components directory was created
1ls ~/.dapr1Mode LastWriteTime Length Name2---- ------------- ------ ----3d----- 3/26/2021 5:47 PM bin4d----- 3/16/2021 4:10 PM components5-a---- 3/16/2021 4:10 PM 187 config.yamlRun 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:
1dapr run --app-id myapp --dapr-http-port 3500Which 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:
1POST /v1.0/state/statestore HTTP/1.12Host: localhost:35003Content-Type: application/json4Content-Length: 655
6[7 {8 "key": "init_post",9 "value": "Hello, World!"10 }11]We can then retreive the data we sent with:
1GET /v1.0/state/statestore/init_post HTTP/1.12Host: localhost:3500Which will respond with:
1"Hello, World!"We can also log into redis from Docker to view all data in the Redis instance with:
1docker exec -it dapr_redis redis-cliAnd then we can run the following command to view the data in Redis:
1> keys *2
31) "myapp||init_post"To view the type of the value that Dapr saves the data as:
1> type "myapp||init_post2
3hashSince the type is hash we need to use hgetall to get the value
1> hgetall "myapp||init_post"2
31) "data"42) "\"Hello, World!\""53) "version"64) "1"Additionally, Dapr apps are managed using components which are defined using yml, there are a number of Quickstart guides on this here