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
—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 or grpc
—app-sslfalseEnable https when Dapr invokes the application
—components-path, -dLinux/Mac: $HOME/.dapr/components
Windows: %USERPROFILE%.dapr\components
The path for components directory
—config, -cLinux/Mac: $HOME/.dapr/config.yaml
Windows: %USERPROFILE%.dapr\config.yaml
Dapr configuration file
—dapr-grpc-portDAPR_GRPC_PORT50001The gRPC port for Dapr to listen on
—dapr-http-portDAPR_HTTP_PORT3500The HTTP port for Dapr to listen on
—enable-profilingfalseEnable “pprof” profiling via an HTTP endpoint
—help, -hPrint the help message
—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

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

Last modified October 12, 2022: Added docs for app health checks (#2870) (5e718b4c)