run CLI command reference

Detailed information on the run CLI command

Description

Run Dapr and (optionally) your application side by side. A full list comparing daprd arguments, CLI arguments, and Kubernetes annotations can be found here.

Supported platforms

Usage

  1. dapr run [flags] [command]

Flags

NameEnvironment VariableDefaultDescription
—app-id, -aAPP_IDThe id for your application, used for service discovery. Cannot contain dots.
—app-max-concurrencyunlimitedThe concurrency level of the application; default is unlimited
—app-port, -pAPP_PORTThe port your application is listening on
—app-protocol, -PhttpThe protocol Dapr uses to talk to the application. Valid values are: http, grpc, https (HTTP with TLS), grpcs (gRPC with TLS), h2c (HTTP/2 Cleartext)
—resources-path, -dLinux/Mac: $HOME/.dapr/components
Windows: %USERPROFILE%.dapr\components
The path for resources directory. If you’ve organized your resources into multiple folders (for example, components in one folder, resiliency policies in another), you can define multiple resource paths. See example below.
—app-channel-address127.0.0.1The network address the application listens on
—runtime-pathDapr runtime install path
—config, -cLinux/Mac: $HOME/.dapr/config.yaml
Windows: %USERPROFILE%.dapr\config.yaml
Dapr configuration file
—dapr-grpc-port, -GDAPR_GRPC_PORT50001The gRPC port for Dapr to listen on
—dapr-internal-grpc-port, -I50002The gRPC port for the Dapr internal API to listen on. Set during development for apps experiencing temporary errors with service invocation failures due to mDNS caching, or configuring Dapr sidecars behind firewall. Can be any value greater than 1024 and must be different for each app.
—dapr-http-port, -HDAPR_HTTP_PORT3500The HTTP port for Dapr to listen on
—enable-profilingfalseEnable “pprof” profiling via an HTTP endpoint
—help, -hPrint the help message
—run-file, -fLinux/MacOS: $HOME/.dapr/dapr.yamlRun multiple applications at once using a Multi-App Run template file. Currently in alpha and only available in Linux/MacOS
—imageUse a custom Docker image. Format is repository/image for Docker Hub, or example.com/repository/image for a custom registry.
—log-levelinfoThe log verbosity. Valid values are: debug, info, warn, error, fatal, or panic
—enable-api-loggingfalseEnable the logging of all API calls from application to Dapr
—metrics-portDAPR_METRICS_PORT9090The port that Dapr sends its metrics information to
—profile-port7777The port for the profile server to listen on
—enable-app-health-checkfalseEnable health checks for the application using the protocol defined with app-protocol
—app-health-check-pathPath used for health checks; HTTP only
—app-health-probe-intervalInterval to probe for the health of the app in seconds
—app-health-probe-timeoutTimeout for app health probes in milliseconds
—app-health-thresholdNumber of consecutive failures for the app to be considered unhealthy
—unix-domain-socket, -uPath to a unix domain socket dir mount. If specified, communication with the Dapr sidecar uses unix domain sockets for lower latency and greater throughput when compared to using TCP ports. Not available on Windows.
—dapr-http-max-request-size4Max size of the request body in MB.
—dapr-http-read-buffer-size4Max size of the HTTP read buffer in KB. This also limits the maximum size of HTTP headers. The default 4 KB
—kubernetes, -kRunning Dapr on Kubernetes, and used for Multi-App Run template files on Kubernetes.
—components-path, -dLinux/Mac: $HOME/.dapr/components
Windows: %USERPROFILE%.dapr\components
Deprecated in favor of —resources-path

Examples

  1. # Run a .NET application
  2. dapr run --app-id myapp --app-port 5000 -- dotnet run
  3. # Run a .Net application with unix domain sockets
  4. dapr run --app-id myapp --app-port 5000 --unix-domain-socket /tmp -- dotnet run
  5. # Run a Java application
  6. dapr run --app-id myapp -- java -jar myapp.jar
  7. # Run a NodeJs application that listens to port 3000
  8. dapr run --app-id myapp --app-port 3000 -- node myapp.js
  9. # Run a Python application
  10. dapr run --app-id myapp -- python myapp.py
  11. # Run sidecar only
  12. dapr run --app-id myapp
  13. # Run a gRPC application written in Go (listening on port 3000)
  14. dapr run --app-id myapp --app-port 5000 --app-protocol grpc -- go run main.go
  15. # Run a NodeJs application that listens to port 3000 with API logging enabled
  16. dapr run --app-id myapp --app-port 3000 --enable-api-logging -- node myapp.js
  17. # Pass multiple resource paths
  18. dapr run --app-id myapp --resources-path path1 --resources-path path2
  19. # Run the multi-app run template file
  20. dapr run -f dapr.yaml
  21. # Run the multi-app run template file on Kubernetes
  22. dapr run -k -f dapr.yaml

Last modified March 21, 2024: Merge pull request #4082 from newbe36524/v1.13 (f4b0938)