+
+
+```bash
+docker run --rm -it -d -p 18888:18888 -p 4317:18889 --name aspire-dashboard \
+ -e DASHBOARD__API__ENABLED='true' \
+ -e DASHBOARD__API__AUTHMODE='ApiKey' \
+ -e DASHBOARD__API__PRIMARYAPIKEY='{MY_APIKEY}' \
+ mcr.microsoft.com/dotnet/aspire-dashboard:latest
+```
+
+
+
+
+```powershell
+docker run --rm -it -d -p 18888:18888 -p 4317:18889 --name aspire-dashboard `
+ -e DASHBOARD__API__ENABLED='true' `
+ -e DASHBOARD__API__AUTHMODE='ApiKey' `
+ -e DASHBOARD__API__PRIMARYAPIKEY='{MY_APIKEY}' `
+ mcr.microsoft.com/dotnet/aspire-dashboard:latest
+```
+
+
+
+
+When API key authentication is configured, each request to the telemetry API must include a valid `x-api-key` header. If the API is enabled without configuring an auth mode or API key, it defaults to `Unsecured` and a warning is logged at startup.
+
## Memory exhaustion
The dashboard stores external information it receives in memory, such as resource details and telemetry. While the number of resources the dashboard tracks are bounded, there isn't a limit to how much telemetry apps send to the dashboard. Limits must be placed on how much information is stored to prevent the dashboard using an excessive amount of memory and exhausting available memory on the current machine.