run CLI command reference

Detailed information on the run CLI command

Description

Run Dapr and (optionally) your application side by side.

Supported platforms

Usage

  1. dapr run [flags] [command]

Flags

NameEnvironment VariableDefaultDescription
—app-id, -aThe id for your application, used for service discovery
—app-max-concurrencyunlimitedThe concurrency level of the application, otherwise is unlimited
—app-port, -pThe port your application is listening on
—app-protocol, -PhttpThe protocol (gRPC or HTTP) 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\componentsThe path for components directory
—config, -cLinux & Mac: $HOME/.dapr/config.yaml, Windows: %USERPROFILE%.dapr\config.yamlDapr configuration file
—dapr-grpc-port3500The gRPC port for Dapr to listen on
—dapr-http-port50001The HTTP port for Dapr to listen on
—enable-profilingfalseEnable pprof profiling via an HTTP endpoint
—help, -hPrint this help message
—imageThe image to build the code in. Input is: repository/image
—log-levelinfoThe log verbosity. Valid values are: debug, info, warn, error, fatal, or panic
—placement-host-addressDAPR_PLACEMENT_HOSTlocalhostThe host on which the placement service resides
—profile-port7777The port for the profile server to listen on

Examples

Run a .NET application

  1. dapr run --app-id myapp --app-port 5000 -- dotnet run

Run a Java application

  1. dapr run --app-id myapp -- java -jar myapp.jar

Run a NodeJs application that listens to port 3000

  1. dapr run --app-id myapp --app-port 3000 -- node myapp.js

Run a Python application

  1. dapr run --app-id myapp -- python myapp.py

Run sidecar only

  1. dapr run --app-id myapp

Last modified February 16, 2021: Merge pull request #1235 from dapr/update-v0.11 (b4e9fbb)