Environment variables

The following table lists the environment variables used by the Dapr runtime, CLI, or from within your application:

Environment VariableUsed ByDescription
APP_IDYour applicationThe id for your application, used for service discovery
APP_PORTYour applicationThe port your application is listening on
APP_API_TOKENYour applicationThe token used by the application to authenticate requests from Dapr API. Read authenticate requests from Dapr using token authentication for more information.
DAPR_HTTP_PORTYour applicationThe HTTP port that the Dapr sidecar is listening on. Your application should use this variable to connect to Dapr sidecar instead of hardcoding the port value. Set by the Dapr CLI run command for self-hosted or injected by the dapr-sidecar-injector into all the containers in the pod.
DAPR_GRPC_PORTYour applicationThe gRPC port that the Dapr sidecar is listening on. Your application should use this variable to connect to Dapr sidecar instead of hardcoding the port value. Set by the Dapr CLI run command for self-hosted or injected by the dapr-sidecar-injector into all the containers in the pod.
DAPR_METRICS_PORTYour applicationThe HTTP Prometheus port to which Dapr sends its metrics information. With this variable, your application sends its application-specific metrics to have both Dapr metrics and application metrics together. See metrics-port for more information
DAPR_PROFILE_PORTYour applicationThe profiling port through which Dapr lets you enable profiling and track possible CPU/memory/resource spikes in your application’s behavior. Enabled by —enable-profiling command in Dapr CLI for self-hosted or dapr.io/enable-profiling annotation in Dapr annotated pod.
DAPR_API_TOKENDapr sidecarThe token used for Dapr API authentication for requests from the application. Enable API token authentication in Dapr.
NAMESPACEDapr sidecarUsed to specify a component’s namespace in self-hosted mode.
DAPR_DEFAULT_IMAGE_REGISTRYDapr CLIIn self-hosted mode, it is used to specify the default container registry to pull images from. When its value is set to GHCR or ghcr, it pulls the required images from Github container registry. To default to Docker hub, unset this environment variable.
SSL_CERT_DIRDapr sidecarSpecifies the location where the public certificates for all the trusted certificate authorities (CA) are located. Not applicable when the sidecar is running as a process in self-hosted mode.
DAPR_HELM_REPO_URLYour private Dapr Helm chart urlSpecifies a private Dapr Helm chart url, which defaults to the official Helm chart URL: https://dapr.github.io/helm-charts
DAPR_HELM_REPO_USERNAMEA username for a private Helm chartThe username required to access the private Dapr Helm chart. If it can be accessed publicly, this env variable does not need to be set
DAPR_HELM_REPO_PASSWORDA password for a private Helm chartThe password required to access the private Dapr helm chart. If it can be accessed publicly, this env variable does not need to be set

Last modified September 14, 2022: Upmerge to 1.9 (#2793) (a35f0dcd)