---
title: Linux
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Agent > Supported Platforms > Linux
---

# Linux

## Overview{% #overview %}

This page outlines the basic features of the Datadog Agent for Linux environments. See the [Supported Platforms](https://docs.datadoghq.com/agent/supported_platforms.md?tab=linux) documentation for the complete list of supported Linux distributions and versions.

## Install the Agent{% #install-the-agent %}

To install the Agent on Linux, follow the [in-app instructions in Fleet Automation](https://app.datadoghq.com/fleet/install-agent/latest?platform=linux), and run the generated script on your hosts.

{% image
   source="https://docs.dd-static.net/images/agent/basic_agent_usage/linux_img_july_25.e5ecf3ca10a4c027a2e8bba8573bb24b.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/agent/basic_agent_usage/linux_img_july_25.e5ecf3ca10a4c027a2e8bba8573bb24b.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="In-app installation steps for the Datadog Agent on a Linux host." /%}

## Configure the Agent{% #configure-the-agent %}

The Datadog Agent configuration file is located in `/etc/datadog-agent/datadog.yaml`. This YAML file holds the host-wide connection details used to send data to Datadog including:

- `api_key`: Your organization's [Datadog API key](https://app.datadoghq.com/organization-settings/api-keys)
- `site`: Target Datadog region (for example `datadoghq.com`, `datadoghq.eu`, `ddog-gov.com`)
- `proxy`: HTTP/HTTPS proxy endpoints for outbound traffic (see [Datadog Agent Proxy Configuration](https://docs.datadoghq.com/agent/configuration/proxy.md))
- Default tags, log level, and Datadog configurations

A fully commented reference file, located in `/etc/datadog-agent/datadog.yaml.example`, lists every available option for comparison or to copy and paste. Alternatively, see the sample `config_template.yaml` file for all available configuration options.

### Integration files{% #integration-files %}

Configuration files for integrations live in `/etc/datadog-agent/conf.d/`. Each integration has its own sub-directory, `<INTEGRATION>.d/`, that contains:

- `conf.yaml`: The active configuration controlling how the integration gathers metrics and logs
- `conf.yaml.example`: A sample illustrating supported keys and defaults

## Commands{% #commands %}

| Description                        | Command                                                |
| ---------------------------------- | ------------------------------------------------------ |
| Start Agent as a service           | `sudo systemctl start datadog-agent`                   |
| Stop Agent running as a service    | `sudo systemctl stop datadog-agent`                    |
| Restart Agent running as a service | `sudo systemctl restart datadog-agent`                 |
| Status of Agent service            | `sudo systemctl status datadog-agent`                  |
| Status page of running Agent       | `sudo datadog-agent status`                            |
| Send flare                         | `sudo datadog-agent flare`                             |
| Display command usage              | `sudo datadog-agent --help`                            |
| Run a check                        | `sudo -u dd-agent -- datadog-agent check <CHECK_NAME>` |

**Note**: For upstart-based systems, such as `CentOS/RHEL 6` or `SUSE 11`, swap `systemctl <action>` with `<action>`. For example, when starting an Agent as a service on a `SUSE 11` system, use `sudo start datadog-agent`.

## Uninstall the Agent{% #uninstall-the-agent %}

To uninstall the Agent, run the command for the appropriate Linux environment:

### For CentOS, Rocky, AlmaLinux, Amazon Linux, Oracle Linux, and Red Hat{% #for-centos-rocky-almalinux-amazon-linux-oracle-linux-and-red-hat %}

```shell
sudo yum remove datadog-agent
```

### For Debian, Ubuntu{% #for-debian-ubuntu %}

```shell
sudo apt-get remove datadog-agent -y
```

### For SUSE{% #for-suse %}

```shell
sudo zypper remove datadog-agent
```

{% alert level="info" %}
**The above commands remove the Agent, but do not remove**:

- The `datadog.yaml` configuration file
- User-created files in the `/etc/datadog-agent` configuration folder
- User-created files in the `/opt/datadog-agent` folder
- The `dd-agent` user
- Datadog log files

**To remove these elements, run this command after removing the Agent:**

```shell
sudo userdel dd-agent \
&& sudo rm -rf /opt/datadog-agent/ \
&& sudo rm -rf /etc/datadog-agent/ \
&& sudo rm -rf /var/log/datadog/
```

To uninstall remaining Agent artifacts for `Debian` and `Ubuntu` run:

```shell
sudo apt-get remove --purge datadog-agent -y
```

{% /alert %}

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

If you installed the Agent with Single Step APM Instrumentation and want to uninstall it, you need to [run additional commands](https://docs.datadoghq.com/tracing/trace_collection/automatic_instrumentation/single-step-apm.md) to remove APM Instrumentation. Follow the steps for your [specific environment](https://docs.datadoghq.com/tracing/trace_collection/automatic_instrumentation/single-step-apm/linux.md).

## Troubleshooting{% #troubleshooting %}

For detailed steps, see [Agent Troubleshooting](https://docs.datadoghq.com/agent/troubleshooting.md).

## Working with the embedded Agent{% #working-with-the-embedded-agent %}

The Agent contains an embedded Python environment at `/opt/datadog-agent/embedded/`. Common binaries such as `python` and `pip` are contained within `/opt/datadog-agent/embedded/bin/`.

See the instructions on how to [add packages to the embedded Agent](https://docs.datadoghq.com/extend/guide/custom-python-package.md) for more information.

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

- [Collect your logs](https://docs.datadoghq.com/logs.md)
- [Collect your processes](https://docs.datadoghq.com/infrastructure/process.md)
- [Collect your traces](https://docs.datadoghq.com/tracing.md)
- [Find out more about the Agent's architecture](https://docs.datadoghq.com/agent/architecture.md#agent-architecture)
- [Configure inbound ports](https://docs.datadoghq.com/agent/configuration/network.md#configure-ports)
