---
title: Docker Agent for Docker, containerd, and Podman
description: >-
  Install and configure the Datadog Agent for Docker containers and container
  runtimes
breadcrumbs: Docs > Containers > Docker Agent for Docker, containerd, and Podman
---

# Docker Agent for Docker, containerd, and Podman

## Overview{% #overview %}

The Datadog Docker Agent is a version of the [Datadog Agent](https://docs.datadoghq.com/agent/) that supports Docker, containerd, and Podman runtimes. For supported Docker versions, see [Supported Platforms](https://docs.datadoghq.com/agent/supported_platforms/?tab=cloudandcontainers).

## Install the Datadog Docker Agent{% #install-the-datadog-docker-agent %}

Follow the [in-app installation flow in Datadog](https://app.datadoghq.com/account/settings/agent/latest?platform=docker). This is the recommended flow, which helps you create your `docker run` command with your API key, the required minimum configurations, and toggles for various Datadog features.

{% image
   source="https://docs.dd-static.net/images/agent/basic_agent_usage/agent_install_docker.39ca8e8e7b1020619b7dbaa261feae37.png?auto=format"
   alt="In-app installation steps for the Datadog Agent on Docker." /%}

## Manually run the Datadog Docker Agent{% #manually-run-the-datadog-docker-agent %}

The Fleet Automation flow helps configure your Datadog Agent container with Datadog's recommended instructions. To configure this manually, see the examples below.

Use the following command to run the Agent as a Docker container once on each host you want to monitor. Replace `<DATADOG_API_KEY>` with your Datadog API key and `<DATADOG_SITE>` with your .

{% tab title="Linux" %}

```shell
docker run -d --cgroupns host --pid host --name dd-agent \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  -v /proc/:/host/proc/:ro \
  -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
  -e DD_SITE=<DATADOG_SITE> \
  -e DD_API_KEY=<DATADOG_API_KEY> \
  registry.datadoghq.com/agent:7
```

{% /tab %}

{% tab title="Windows" %}
The Datadog Agent is supported on Windows Server 2019 (LTSC) and Windows Server 2022 (LTSC). The following PowerShell command runs the Datadog Agent container:

```powershell
docker run -d --name dd-agent `
  -v \\.\pipe\docker_engine:\\.\pipe\docker_engine `
  -e DD_SITE=<DATADOG_SITE> `
  -e DD_API_KEY=<DATADOG_API_KEY> `
  registry.datadoghq.com/agent:7
```

{% /tab %}

**Note**: For Docker Compose, see [Compose and the Datadog Agent](https://docs.datadoghq.com/containers/guide/compose-and-the-datadog-agent/). For deploying the Agent in Podman, see the instructions in [Using the Docker integration with Podman container runtime](https://docs.datadoghq.com/containers/guide/podman-support-with-docker-integration/).

## Integrations{% #integrations %}

After the Datadog Docker Agent is up and running, you can [configure Datadog integrations](https://docs.datadoghq.com/containers/docker/integrations/) to collect metrics and logs automatically from your application containers. Datadog's [Container Autodiscovery](https://docs.datadoghq.com/getting_started/containers/autodiscovery) enables you to define monitoring configuration for dynamic resources in containerized systems.

## Configuration options for the Datadog Docker Agent{% #configuration-options-for-the-datadog-docker-agent %}

### Container registries{% #container-registries %}

Images are available for 64-bit x86 and Arm v8 architectures. Datadog publishes container images to the Datadog Container Registry, Google Artifact Registry (GAR), Amazon ECR, Azure ACR, and Docker Hub:

| Registry                          | Path                     |
| --------------------------------- | ------------------------ |
| Datadog Container Registry        | `registry.datadoghq.com` |
| Google Artifact Registry          | `gcr.io/datadoghq`       |
| Google Artifact Registry (Europe) | `eu.gcr.io/datadoghq`    |
| Google Artifact Registry (Asia)   | `asia.gcr.io/datadoghq`  |
| Amazon ECR                        | `public.ecr.aws/datadog` |
| Azure ACR                         | `datadoghq.azurecr.io`   |
| Docker Hub                        | `docker.io/datadog`      |

By default, the above instructions pull the image from the Datadog Container Registry (`registry.datadoghq.com`). If you use this registry, ensure your firewall allows traffic to `us-docker.pkg.dev/datadog-prod/public-images`, as the registry may redirect requests to this URL.

{% alert level="warning" %}
Docker Hub is subject to image pull rate limits. If you are not a Docker Hub customer, Datadog recommends that you update your configuration to pull from another registry. For instructions, see [Changing your container registry](https://docs.datadoghq.com/agent/guide/changing_container_registry).
{% /alert %}

### Environment variables{% #environment-variables %}

In a non-containerized environment, configuration options for the Datadog Agent are set in [`datadog.yaml`](https://docs.datadoghq.com/agent/configuration/agent-configuration-files/#agent-main-configuration-file). For the Datadog Docker Agent, you can set `datadog.yaml` configuration options through environment variables.

#### Global options{% #global-options %}

{% dl %}

{% dt %}
`DD_API_KEY`
{% /dt %}

{% dd %}
Your Datadog API key (**required**).
{% /dd %}

{% dt %}
`DD_ENV`
{% /dt %}

{% dd %}
Sets the global `env` tag for all data emitted.
{% /dd %}

{% dt %}
`DD_HOSTNAME`
{% /dt %}

{% dd %}
Hostname to use for metrics (if autodetection fails).
{% /dd %}

{% dt %}
`DD_HOSTNAME_FILE`
{% /dt %}

{% dd %}
In some environments, auto-detection of the hostname is not adequate, and you cannot set the value with environment variables. In these cases, you can use a file on the host to provide an appropriate value. If `DD_HOSTNAME` is set to a non-empty value, this option is ignored.
{% /dd %}

{% dt %}
`DD_TAGS`
{% /dt %}

{% dd %}
Host tags separated by spaces. For example: `key1:value1 key2:value2`.
{% /dd %}

{% dt %}
`DD_SITE`
{% /dt %}

{% dd %}
Destination site for your metrics, traces, and logs. Set your Datadog site to: ``. Defaults to `datadoghq.com`.
{% /dd %}

{% dt %}
`DD_DD_URL`
{% /dt %}

{% dd %}
Optional setting to override the URL for metric submission.
{% /dd %}

{% dt %}
`DD_URL` (6.36+/7.36+)
{% /dt %}

{% dd %}
Alias for `DD_DD_URL`. Ignored if `DD_DD_URL` is already set.
{% /dd %}

{% dt %}
`DD_CHECK_RUNNERS`
{% /dt %}

{% dd %}
The Agent runs all checks concurrently by default (default value = `4` runners). To run the checks sequentially, set the value to `1`. If you need to run a high number of checks (or slow checks), the `collector-queue` component may fall behind and fail the health check. You can increase the number of runners to run checks in parallel.
{% /dd %}

{% dt %}
`DD_APM_ENABLED`
{% /dt %}

{% dd %}
Enables trace collection. Defaults to `true`. For more information about additional trace collection environment variables, see [Tracing Docker Applications](https://docs.datadoghq.com/containers/docker/apm/).
{% /dd %}

{% dt %}
`DD_LOGS_CONFIG_EXPECTED_TAGS_DURATION`
{% /dt %}

{% dd %}
In some environments, the initial logs from hosts might not include the correct tags. If you're missing tags on new hosts in your logs, include this environment variable and set it to `"10m"`.
{% /dd %}

{% /dl %}

#### Proxy settings{% #proxy-settings %}

Starting with Agent v6.4.0 (and v6.5.0 for the Trace Agent), you can override the Agent proxy settings with the following environment variables:

{% dl %}

{% dt %}
`DD_PROXY_HTTP`
{% /dt %}

{% dd %}
An HTTP URL to use as a proxy for `http` requests.
{% /dd %}

{% dt %}
`DD_PROXY_HTTPS`
{% /dt %}

{% dd %}
An HTTPS URL to use as a proxy for `https` requests.
{% /dd %}

{% dt %}
`DD_PROXY_NO_PROXY`
{% /dt %}

{% dd %}
A space-separated list of URLs for which no proxy should be used.
{% /dd %}

{% /dl %}

For more information about proxy settings, see the [Agent v6 Proxy documentation](https://docs.datadoghq.com/agent/configuration/proxy/#agent-v6).

#### Optional collection Agents{% #optional-collection-agents %}

Optional collection Agents are disabled by default for security or performance reasons. Use these environment variables to enable them:

{% dl %}

{% dt %}
`DD_APM_NON_LOCAL_TRAFFIC`
{% /dt %}

{% dd %}
Allow non-local traffic when [tracing from other containers](https://docs.datadoghq.com/containers/docker/apm/?tab=linux#tracing-from-other-containers).
{% /dd %}

{% dt %}
`DD_LOGS_ENABLED`
{% /dt %}

{% dd %}
Enable [log collection](https://docs.datadoghq.com/containers/docker/log/) with the Logs Agent.
{% /dd %}

{% dt %}
`DD_PROCESS_CONFIG_PROCESS_COLLECTION_ENABLED`
{% /dt %}

{% dd %}
Enable [live process collection](https://docs.datadoghq.com/infrastructure/process/) with the Process Agent. The [live container view](https://docs.datadoghq.com/infrastructure/livecontainers/) is already enabled by default if the Docker socket is available.
{% /dd %}

{% /dl %}

#### DogStatsD (custom metrics){% #dogstatsd-custom-metrics %}

Send custom metrics with [the StatsD protocol](https://docs.datadoghq.com/extend/dogstatsd/):

{% dl %}

{% dt %}
`DD_DOGSTATSD_NON_LOCAL_TRAFFIC`
{% /dt %}

{% dd %}
Listen to DogStatsD packets from other containers (required to send custom metrics).
{% /dd %}

{% dt %}
`DD_HISTOGRAM_PERCENTILES`
{% /dt %}

{% dd %}
The histogram percentiles to compute (separated by spaces). The default is `0.95`.
{% /dd %}

{% dt %}
`DD_HISTOGRAM_AGGREGATES`
{% /dt %}

{% dd %}
The histogram aggregates to compute (separated by spaces). The default is `"max median avg count"`.
{% /dd %}

{% dt %}
`DD_DOGSTATSD_SOCKET`
{% /dt %}

{% dd %}
Path to the unix socket to listen to. Must be in a `rw` mounted volume.
{% /dd %}

{% dt %}
`DD_DOGSTATSD_ORIGIN_DETECTION`
{% /dt %}

{% dd %}
Enable container detection and tagging for UNIX socket metrics.
{% /dd %}

{% dt %}
`DD_DOGSTATSD_TAGS`
{% /dt %}

{% dd %}
Additional tags to append to all metrics, events, and service checks received by this DogStatsD server. For example: `"env:golden group:retrievers"`.
{% /dd %}

{% dt %}
`DD_USE_DOGSTATSD`
{% /dt %}

{% dd %}
Enable or disable sending custom metrics from the DogStatsD library. Learn more about [DogStatsD over Unix Domain Sockets](https://docs.datadoghq.com/extend/dogstatsd/unix_socket/).
{% /dd %}

{% /dl %}

#### Tagging{% #tagging %}

As a best practice, Datadog recommends using [unified service tagging](https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging/?tab=docker) when assigning tags.

Datadog automatically collects common tags from Docker, Kubernetes, ECS, Swarm, Mesos, Nomad, and Rancher. To extract even more tags, use the following options:

{% dl %}

{% dt %}
`DD_CONTAINER_LABELS_AS_TAGS`
{% /dt %}

{% dd %}
Extract container labels. This env is equivalent to `DD_DOCKER_LABELS_AS_TAGS`.
{% /dd %}

{% dt %}
`DD_CONTAINER_ENV_AS_TAGS`
{% /dt %}

{% dd %}
Extract container environment variables. This env is equivalent to `DD_DOCKER_ENV_AS_TAGS`.
{% /dd %}

{% dt %}
`DD_COLLECT_EC2_TAGS`
{% /dt %}

{% dd %}
Extract custom EC2 tags without using the AWS integration.
{% /dd %}

{% /dl %}

See the [Docker Tag Extraction](https://docs.datadoghq.com/containers/docker/tag) documentation to learn more.

#### Using secret files{% #using-secret-files %}

Integration credentials can be stored in Docker or Kubernetes secrets and used in Autodiscovery templates. For more information, see the [Secrets Management documentation](https://docs.datadoghq.com/agent/configuration/secrets-management/?tab=linux).

#### Ignore containers{% #ignore-containers %}

Exclude containers from logs collection, metrics collection, and Autodiscovery. Datadog excludes Kubernetes and OpenShift `pause` containers by default. These allowlists and blocklists apply to Autodiscovery only; traces and DogStatsD are not affected. The value for these environment variables support regular expressions.

{% dl %}

{% dt %}
`DD_CONTAINER_INCLUDE`
{% /dt %}

{% dd %}
Allowlist of containers to include (separated by spaces). Use `.*` to include all. For example: `"image:image_name_1 image:image_name_2"`, `image:.*` When using ImageStreams inside OpenShift environments, use the container name instead of image. For example: `"name:container_name_1 name:container_name_2"`, `name:.*`
{% /dd %}

{% dt %}
`DD_CONTAINER_EXCLUDE`
{% /dt %}

{% dd %}
Blocklist of containers to exclude (separated by spaces). Use `.*` to exclude all. For example: `"image:image_name_3 image:image_name_4"`, `image:.*` (**Note**: This variable is only honored for Autodiscovery.)
{% /dd %}

{% dt %}
`DD_CONTAINER_INCLUDE_METRICS`
{% /dt %}

{% dd %}
Allowlist of containers whose metrics you wish to include.
{% /dd %}

{% dt %}
`DD_CONTAINER_EXCLUDE_METRICS`
{% /dt %}

{% dd %}
Blocklist of containers whose metrics you wish to exclude.
{% /dd %}

{% dt %}
`DD_CONTAINER_INCLUDE_LOGS`
{% /dt %}

{% dd %}
Allowlist of containers whose logs you wish to include.
{% /dd %}

{% dt %}
`DD_CONTAINER_EXCLUDE_LOGS`
{% /dt %}

{% dd %}
Blocklist of containers whose logs you wish to exclude.
{% /dd %}

{% dt %}
`DD_AC_INCLUDE`
{% /dt %}

{% dd %}
**Deprecated**. Allowlist of containers to include (separated by spaces). Use `.*` to include all. For example: `"image:image_name_1 image:image_name_2"`, `image:.*`
{% /dd %}

{% dt %}
`DD_AC_EXCLUDE`
{% /dt %}

{% dd %}
**Deprecated**. Blocklist of containers to exclude (separated by spaces). Use `.*` to exclude all. For example: `"image:image_name_3 image:image_name_4"`, `image:.*` (**Note**: This variable is only honored for Autodiscovery.)
{% /dd %}

{% /dl %}

Additional examples are available on the [Container Discovery Management](https://docs.datadoghq.com/containers/guide/container-discovery-management/?tab=containerizedagent) page.

**Note**: The `kubernetes.containers.running`, `kubernetes.pods.running`, `docker.containers.running`, `.stopped`, `.running.total` and `.stopped.total` metrics are not affected by these settings. All containers are counted. This does not affect your per-container billing.

**Note**: When using containerd, it's possible to ignore containers by namespace using `DD_CONTAINERD_NAMESPACES` and `DD_CONTAINERD_EXCLUDE_NAMESPACES`. Both are a space-separated list of namespaces. When `DD_CONTAINERD_NAMESPACES` is set, the agent reports data for the containers that belong to a namespace present in the list. When `DD_CONTAINERD_EXCLUDE_NAMESPACES` is set, the agent reports data for all the containers except the ones that belong to a namespace of the list.

#### Autodiscovery{% #autodiscovery %}

{% dl %}

{% dt %}
`DD_LISTENERS`
{% /dt %}

{% dd %}
Autodiscovery listeners to run.
{% /dd %}

{% dt %}
`DD_EXTRA_LISTENERS`
{% /dt %}

{% dd %}
Additional Autodiscovery listeners to run. They are added in addition to the variables defined in the `listeners` section of the `datadog.yaml` configuration file.
{% /dd %}

{% dt %}
`DD_CONFIG_PROVIDERS`
{% /dt %}

{% dd %}
The providers the Agent should call to collect checks configurations. The default provider is `docker`. The Docker provider handles templates embedded in container labels.
{% /dd %}

{% dt %}
`DD_EXTRA_CONFIG_PROVIDERS`
{% /dt %}

{% dd %}
Additional Autodiscovery configuration providers to use. They are added in addition to the variables defined in the `config_providers` section of the `datadog.yaml` configuration file.
{% /dd %}

{% /dl %}

#### Miscellaneous{% #miscellaneous %}

{% dl %}

{% dt %}
`DD_PROCESS_AGENT_CONTAINER_SOURCE`
{% /dt %}

{% dd %}
Overrides container source auto-detection to force a single source. e.g `"docker"`, `"ecs_fargate"`, `"kubelet"`. This is no longer needed since Agent v7.35.0.
{% /dd %}

{% dt %}
`DD_HEALTH_PORT`
{% /dt %}

{% dd %}
Set this to `5555` to expose the Agent health check at port `5555`.
{% /dd %}

{% /dl %}

## Commands{% #commands %}

See the [Agent Commands guides](https://docs.datadoghq.com/agent/configuration/agent-commands/) to discover all the Docker Agent commands.

## Data collected{% #data-collected %}

### Metrics{% #metrics %}

By default, the Docker Agent collects metrics with the following core checks. To collect metrics from other technologies, see the Integrations section.

| Check       | Metrics                                                                        |
| ----------- | ------------------------------------------------------------------------------ |
| Container   | [Metrics](https://docs.datadoghq.com/integrations/container/)                  |
| CPU         | [System](https://docs.datadoghq.com/integrations/system/#metrics)              |
| Disk        | [Disk](https://docs.datadoghq.com/integrations/disk/#metrics)                  |
| Docker      | [Docker](https://docs.datadoghq.com/containers/docker/data_collected/#metrics) |
| File Handle | [System](https://docs.datadoghq.com/integrations/system/#metrics)              |
| IO          | [System](https://docs.datadoghq.com/integrations/system/#metrics)              |
| Load        | [System](https://docs.datadoghq.com/integrations/system/#metrics)              |
| Memory      | [System](https://docs.datadoghq.com/integrations/system/#metrics)              |
| Network     | [Network](https://docs.datadoghq.com/integrations/network/#metrics)            |
| NTP         | [NTP](https://docs.datadoghq.com/integrations/ntp/#metrics)                    |
| Uptime      | [System](https://docs.datadoghq.com/integrations/system/#metrics)              |

### Events{% #events %}

The Docker Agent sends events to Datadog when an Agent is started or restarted.

### Service checks{% #service-checks %}

**datadog.agent.up**Returns `CRITICAL` if the Agent is unable to connect to Datadog, otherwise returns `OK`.

**datadog.agent.check\_status**Returns `CRITICAL` if an Agent check is unable to send metrics to Datadog, otherwise returns `OK`.

## Uninstall Single Step APM Instrumentation{% #uninstall-single-step-apm-instrumentation %}

If you installed the Datadog Docker Agent with Single Step APM Instrumentation, and you want to uninstall the Agent, you need to [run additional commands](https://docs.datadoghq.com/tracing/trace_collection/automatic_instrumentation/single-step-apm/docker/#remove-single-step-apm-instrumentation-from-your-agent) to uninstall APM Instrumentation.

## Further Reading{% #further-reading %}

- [Check out the latest Datadog Containers releases! (App login required).](https://app.datadoghq.com/release-notes?category=Container%20Monitoring)
- [Collect your application logs](https://docs.datadoghq.com/agent/docker/log/)
- [Collect your application traces](https://docs.datadoghq.com/agent/docker/apm/)
- [Collect your Prometheus metrics](https://docs.datadoghq.com/agent/docker/prometheus/)
- [Automatically collect your application's metrics and logs](https://docs.datadoghq.com/agent/docker/integrations/)
- [Limit data collection to a subset of containers only](https://docs.datadoghq.com/agent/guide/autodiscovery-management/)
- [Assign tags to all data emitted by a container](https://docs.datadoghq.com/agent/docker/tag/)
