---
isPrivate: true
title: Upgrade to Datadog Agent v6
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Agent > Agent Guides > Upgrade to Datadog Agent v6
---

# Upgrade to Datadog Agent v6

{% alert level="info" %}
Agent v7 is available. [Upgrade to the newest version](https://docs.datadoghq.com/agent/versions/upgrade_to_agent_v7.md) to benefit from all new functionality.
{% /alert %}

## Upgrade to Agent 6{% #upgrade-to-agent-6 %}

If you have Agent v5 already installed, a script is available to automatically install or upgrade to the new Agent. It sets up the package repositories and installs the Agent package for you. When upgrading, the import tool also searches for an existing `datadog.conf` from a prior version, and converts Agent and check configurations according to the new v6 format. Select your platform below for specific instructions. You can either download the DMG package and install it manually, or use the one-line install script.

## One-step upgrade{% #one-step-upgrade %}

{% tab title="Linux" %}
The Agent v6 installer can automatically convert v5 configurations during the upgrade:

{% dl %}

{% dt %}
The following command works on Amazon Linux, CentOS, Debian, Fedora, Red Hat, Ubuntu, and SUSE:
{% /dt %}

{% dd %}
`DD_UPGRADE=true bash -c "$(curl -L https://install.datadoghq.com/scripts/install_script_agent6.sh)"`
{% /dd %}

{% /dl %}

**Note:** The import process won't automatically move **custom** Agent checks. This is by design as Datadog cannot guarantee full backwards compatibility out of the box.
{% /tab %}

{% tab title="Windows" %}
There is no one step install for Windows platforms, refer to the Manual Upgrade.
{% /tab %}

{% tab title="MacOS" %}
The Agent v6 installer can automatically convert v5 configurations during the upgrade:

```shell
DD_UPGRADE=true bash -c "$(curl -L https://install.datadoghq.com/scripts/install_mac_os.sh)"
```

**Note:** The import process won't automatically move **custom** Agent checks. This is by design as Datadog cannot guarantee full backwards compatibility out of the box.
{% /tab %}

## Manual upgrade{% #manual-upgrade %}

{% tab title="Linux" %}
Find below the manual upgrade instructions for:

- Upgrade to Agent 6
- One-step upgrade
- Manual upgrade
  - Amazon Linux
  - CentOS
  - Debian
  - Fedora
  - Red Hat
  - Ubuntu
  - SUSE

### Amazon Linux{% #amazon-linux %}

1. Set up Datadog's Yum repo on your system by creating `/etc/yum.repos.d/datadog.repo` with the contents:

   ```ini
   [datadog]
   name=Datadog, Inc.
   baseurl=https://yum.datadoghq.com/stable/6/x86_64/
   enabled=1
   gpgcheck=1
   repo_gpgcheck=1
   gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
   ```

1. Update your local Yum repo and install the Agent:

   ```shell
   sudo yum makecache
   sudo yum install datadog-agent
   ```

1. Copy the example configuration into place and plug in your API key:

   ```shell
   sudo sh -c "sed 's/api_key:.*/api_key: <YOUR_API_KEY>/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
   ```

1. Transition your Agent configuration paths and formats from Agent v5 to Agent v6 with the `import` command. The command parses an existing v5 `datadog.conf` and converts the configuration options to the new v6 `datadog.yaml` format. It also copies configuration files for checks that are currently enabled:

   ```shell
   sudo -u dd-agent -- datadog-agent import /etc/dd-agent/ /etc/datadog-agent/
   ```

1. (Re-)start the Agent:

   - Amazon Linux 2.0:

   ```shell
   sudo systemctl restart datadog-agent.service
   ```

   - Amazon Linux 1.0:

   ```shell
   sudo initctl start datadog-agent
   ```

### CentOS{% #centos %}

1. Set up Datadog's Yum repo on your system by creating `/etc/yum.repos.d/datadog.repo` with the contents:

   ```ini
   [datadog]
   name=Datadog, Inc.
   baseurl=https://yum.datadoghq.com/stable/6/x86_64/
   enabled=1
   gpgcheck=1
   repo_gpgcheck=1
   gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
   ```

**Note**: due to a [bug in dnf](https://bugzilla.redhat.com/show_bug.cgi?id=1792506), use `repo_gpgcheck=0` instead of `repo_gpgcheck=1` on CentOS 8.1.

1. Update your local Yum repo and install the Agent:

   ```shell
   sudo yum makecache
   sudo yum remove datadog-agent-base
   sudo yum install datadog-agent
   ```

1. Copy the example configuration into place and plug in your API key:

   ```shell
   sudo sh -c "sed 's/api_key:.*/api_key: <YOUR_API_KEY>/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
   ```

1. Transition your Agent configuration paths and formats from Agent v5 to Agent v6, with the `import` command. The command parses an existing v5 `datadog.conf` and converts the configuration options to the new v6 `datadog.yaml` format. It also copies configuration files for checks that are currently enabled:

   ```shell
   sudo -u dd-agent -- datadog-agent import /etc/dd-agent/ /etc/datadog-agent/
   ```

1. Restart the Agent:

   - Centos 7 and above:

   ```shell
   sudo systemctl restart datadog-agent.service
   ```

   - Centos 6:

   ```shell
   sudo initctl restart datadog-agent
   ```

### Debian{% #debian %}

1. Enable HTTPS support for APT, install `curl` and `gnupg`:

   ```shell
   sudo apt-get update
   sudo apt-get install apt-transport-https curl gnupg
   ```

1. Set up the Datadog API repo on your system and import Datadog's APT keys:

   ```shell
   sudo sh -c "echo 'deb [signed-by=/usr/share/keyrings/datadog-archive-keyring.gpg] https://apt.datadoghq.com/ stable 6' > /etc/apt/sources.list.d/datadog.list"
   sudo touch /usr/share/keyrings/datadog-archive-keyring.gpg
   
   curl https://keys.datadoghq.com/DATADOG_APT_KEY_CURRENT.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
   curl https://keys.datadoghq.com/DATADOG_APT_KEY_06462314.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
   curl https://keys.datadoghq.com/DATADOG_APT_KEY_C0962C7D.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
   curl https://keys.datadoghq.com/DATADOG_APT_KEY_F14F620E.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
   curl https://keys.datadoghq.com/DATADOG_APT_KEY_382E94DE.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
   ```

1. If running Debian 8 or earlier, copy the keyring to `/etc/apt/trusted.gpg.d`:

   ```shell
   sudo cp /usr/share/keyrings/datadog-archive-keyring.gpg /etc/apt/trusted.gpg.d
   ```

1. Update your local APT cache and install the Agent:

   ```shell
   sudo apt-get update
   sudo apt-get install datadog-agent datadog-signing-keys
   ```

1. Copy the example configuration into place and plug in your API key:

   ```shell
   sudo sh -c "sed 's/api_key:.*/api_key: <YOUR_API_KEY>/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
   ```

1. Transition your Agent configuration paths and formats from Agent v5 to Agent v6, with the `import` command. The command parses an existing v5 `datadog.conf` and converts the configuration options to the new v6 `datadog.yaml` format. It also copies configuration files for checks that are currently enabled:

   ```shell
   sudo -u dd-agent -- datadog-agent import /etc/dd-agent/ /etc/datadog-agent/
   ```

1. Start the Agent:

   ```shell
   sudo service datadog-agent start
   ```

### Fedora{% #fedora %}

1. Set up Datadog's Yum repo on your system by creating `/etc/yum.repos.d/datadog.repo` with the contents:

   ```ini
   [datadog]
   name=Datadog, Inc.
   baseurl=https://yum.datadoghq.com/stable/6/x86_64/
   enabled=1
   gpgcheck=1
   repo_gpgcheck=1
   gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
   ```

1. Update your local Yum repo and install the Agent:

   ```shell
   sudo yum makecache
   sudo yum remove datadog-agent-base
   sudo yum install datadog-agent
   ```

1. Copy the example configuration into place and plug in your API key:

   ```shell
   sudo sh -c "sed 's/api_key:.*/api_key: <YOUR_API_KEY>/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
   ```

1. Transition your Agent configuration paths and formats from Agent v5 to Agent v6, with the `import` command. The command parses an existing v5 `datadog.conf` and converts the configuration options to the new v6 `datadog.yaml` format. It also copies configuration files for checks that are currently enabled:

   ```shell
   sudo -u dd-agent -- datadog-agent import /etc/dd-agent/ /etc/datadog-agent/
   ```

1. Restart the Agent

   ```shell
   sudo systemctl restart datadog-agent.service
   ```

### Red Hat{% #red-hat %}

1. Set up Datadog's Yum repo on your system by creating `/etc/yum.repos.d/datadog.repo` with the contents:

   ```ini
   [datadog]
   name=Datadog, Inc.
   baseurl=https://yum.datadoghq.com/stable/6/x86_64/
   enabled=1
   gpgcheck=1
   repo_gpgcheck=1
   gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
          https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
   ```

**Note**: due to a [bug in dnf](https://bugzilla.redhat.com/show_bug.cgi?id=1792506), use `repo_gpgcheck=0` instead of `repo_gpgcheck=1` on RHEL 8.1.

1. Update your local Yum repo and install the Agent:

   ```shell
   sudo yum makecache
   sudo yum remove datadog-agent-base
   sudo yum install datadog-agent
   ```

1. Copy the example configuration into place and plug in your API key:

   ```shell
   sudo sh -c "sed 's/api_key:.*/api_key: <YOUR_API_KEY>/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
   ```

1. Transition your Agent configuration paths and formats from Agent v5 to Agent v6, with the `import` command. The command parses an existing v5 `datadog.conf` and converts the configuration options to the new v6 `datadog.yaml` format. It also copies configuration files for checks that are currently enabled:

   ```shell
   sudo -u dd-agent -- datadog-agent import /etc/dd-agent/ /etc/datadog-agent/
   ```

1. Restart the Agent:

   - Red Hat 7 and above:

   ```shell
   sudo systemctl restart datadog-agent.service
   ```

   - Red Hat 6:

   ```shell
   sudo initctl restart datadog-agent
   ```

### Ubuntu{% #ubuntu %}

1. Enable HTTPS support for APT, install `curl` and `gnupg`:

   ```shell
   sudo apt-get update
   sudo apt-get install apt-transport-https curl gnupg
   ```

1. Set up the Datadog API repo on your system and import Datadog's APT keys:

   ```shell
   sudo sh -c "echo 'deb [signed-by=/usr/share/keyrings/datadog-archive-keyring.gpg] https://apt.datadoghq.com/ stable 6' > /etc/apt/sources.list.d/datadog.list"
   sudo touch /usr/share/keyrings/datadog-archive-keyring.gpg
   
   curl https://keys.datadoghq.com/DATADOG_APT_KEY_CURRENT.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
   curl https://keys.datadoghq.com/DATADOG_APT_KEY_06462314.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
   curl https://keys.datadoghq.com/DATADOG_APT_KEY_C0962C7D.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
   curl https://keys.datadoghq.com/DATADOG_APT_KEY_F14F620E.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
   curl https://keys.datadoghq.com/DATADOG_APT_KEY_382E94DE.public | sudo gpg --no-default-keyring --keyring /usr/share/keyrings/datadog-archive-keyring.gpg --import --batch
   ```

1. If running Ubuntu 14 or earlier, copy the keyring to `/etc/apt/trusted.gpg.d`:

   ```shell
   sudo cp /usr/share/keyrings/datadog-archive-keyring.gpg /etc/apt/trusted.gpg.d
   ```

1. Update your local APT cache and install the Agent:

   ```shell
   sudo apt-get update
   sudo apt-get install datadog-agent datadog-signing-keys
   ```

1. Copy the example configuration into place and plug in your API key:

   ```shell
   sudo sh -c "sed 's/api_key:.*/api_key: <YOUR_API_KEY>/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
   ```

1. Transition your Agent configuration paths and formats from Agent v5 to Agent v6, with the `import` command. The command parses an existing v5 `datadog.conf` and converts the configuration options to the new v6 `datadog.yaml` format. It also copies configuration files for checks that are currently enabled.:

   ```shell
   sudo -u dd-agent -- datadog-agent import /etc/dd-agent/ /etc/datadog-agent/
   ```

1. Start the Agent:

   - Ubuntu 16.04 or higher:

   ```shell
   sudo systemctl start datadog-agent
   ```

   - Ubuntu 14.04 or lower:

   ```shell
   sudo initctl start datadog-agent
   ```

### SUSE{% #suse %}

1. Set up Datadog's Yum repo on your system by creating `/etc/zypp/repos.d/datadog.repo` with the contents:

```ini
[datadog]
name=Datadog, Inc.
enabled=1
baseurl=https://yum.datadoghq.com/suse/stable/6/x86_64
type=rpm-md
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
       https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
       https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
       https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
       https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
```
Update your local Zypper repo and install the Agent:
```shell
sudo zypper refresh
sudo rpm --import https://keys.datadoghq.com/DATADOG_RPM_KEY_CURRENT.public
sudo rpm --import https://keys.datadoghq.com/DATADOG_RPM_KEY_4F09D16B.public
sudo rpm --import https://keys.datadoghq.com/DATADOG_RPM_KEY_B01082D3.public
sudo rpm --import https://keys.datadoghq.com/DATADOG_RPM_KEY_FD4BF915.public
sudo rpm --import https://keys.datadoghq.com/DATADOG_RPM_KEY_E09422B3.public
sudo zypper install datadog-agent
```
Copy the example configuration into place and plug in your API key:
```shell
sudo sh -c "sed 's/api_key:.*/api_key: <YOUR_API_KEY>/' /etc/datadog-agent/datadog.yaml.example > /etc/datadog-agent/datadog.yaml"
```

Transition your Agent configuration paths and formats from Agent v5 to Agent v6, with the `import` command. The command parses an existing v5 `datadog.conf` and converts the configuration options to the new v6 `datadog.yaml` format. It also copies configuration files for checks that are currently enabled:

```shell
sudo -u dd-agent -- datadog-agent import /etc/dd-agent/ /etc/datadog-agent/
```

Re-start the Agent:

```shell
sudo systemctl restart datadog-agent.service
```

{% /tab %}

{% tab title="Windows" %}
Download the [latest version available](https://s3.amazonaws.com/ddagent-windows-stable/datadog-agent-6-latest.amd64.msi) and run the installation package.

Transition your Agent configuration paths and formats from Agent v5 to Agent v6, with the `import` command. The command parses an existing v5 `datadog.conf` and converts the configuration options to the new v6 `datadog.yaml` format. It also copies configuration files for checks that are currently enabled.:

`datadog-agent import <OLD_CONFIGURATION_DIRECTORY> <DESTINATION_DIRECTORY>`

With:

- `<OLD_CONFIGURATION_DIRECTORY>` is the directory containing the `datadog.conf` file
- `<DESTINATION_DIRECTORY>` is the directory where the imported `datadog.yaml` is written (you can use the same directory as `<OLD_CONFIGURATION_DIRECTORY>`).

**Note**: `datadog.conf` is automatically upgraded to `datadog.yaml` on upgrade.
{% /tab %}

{% tab title="MacOS" %}

1. Download the DMG package of the latest Agent version. Use the latest macOS release listed on the [release page][9] of the repository.
1. Install the DMG package.
1. Add your API key to `/opt/datadog-agent/etc/datadog.yaml`.
1. Transition your Agent configuration paths and formats from Agent v5 to Agent v6, with the `import` command. The command parses an existing v5 `datadog.conf` and converts the configuration options to the new v6 `datadog.yaml` format. It also copies configuration files for checks that are currently enabled: `datadog-agent import /opt/datadog-agent/etc/ /opt/datadog-agent/etc/`

Then start the Datadog Agent application (once started, you should see it in the system tray), and manage the Agent from there. Agent v6 includes a web-based GUI to edit the Agent configuration files and much more.

[https://github.com/DataDog/datadog-agent/releases](https://github.com/DataDog/datadog-agent/releases)
{% /tab %}
