How to Install the DigitalOcean Metrics Agent

To enable extended metrics and enhanced monitoring features, like metrics-based alerting, you need to install the metrics agent on your Droplet. You can do this automatically when you create a Droplet or manually after you create a Droplet.

In preparation for the deprecation of our initial metrics agent, DigitalOcean has released a beta metrics agent that uses the Prometheus node_exporter codebase. The new agent makes it easier for users to contribute custom metrics, adds an additional load average plot, supports Fedora 27, allows users to opt out of process name collection, and will be the default agent used by our managed databases and Kubernetes products. Learn more in the metrics agent repo.

To use the new agent during the beta period, you can upgrade Droplets running the current agent. In mid-2019, we plan to fully deprecate the initial metrics agent, at which point you’ll have three months to switch to the new agent. We’ll announce this deprecation in our release notes.

Installing the Metrics Agent During Droplet Creation

To install the metrics agent during Droplet creation, select the Monitoring checkbox in the additional options section of the creation page:

Monitoring checkbox on the creation page

The metrics agent will be automatically installed and enabled during the Droplet creation process.

If you are using the DigitalOcean API to create Droplets, you can set the monitoring attribute to true in the creation parameters to automatically install the metrics agent on the Droplet during creation. The Droplet creation section of the API documentation contains additional details.

Installing the Metrics Agent Manually

You can also install the metrics agent manually. There is an installation script available that automatically detects the client operating system and configures repositories to install the agent. If you are uncomfortable running an installation script, you can set up your repositories manually.

With an Installation Script

An installation script is available to install the metrics agent manually. The script will add a repository to your system and use the native package manager to install the metrics agent. This simplifies package management tasks like upgrading or removing the metrics agent.

Log into your Droplet as root or as a user with sudo access:

ssh root@

Once connected, to install and enable the metrics agent immediately, you can download and execute the installation script by typing:

curl -sSL | sh

You may be prompted for your password if running as a sudo user.

If you would like to audit the script before installing, you can write it to disk first, then view the contents and run it manually.

curl -sSL -o /tmp/ # Save the script
less /tmp/ # View the contents
sh /tmp/ # Run the script manually

The agent should now be installed and running.

Configuring Repositories Manually

You can also add the repositories and install the package manually if you prefer.

Ubuntu and Debian

To add the metrics agent repository, create and open a file in the /etc/apt/sources.list.d directory with sudo privileges:

sudo nano /etc/apt/sources.list.d/digitalocean-agent.list

Inside, add the following line:

deb main main

Save and close the file.

Next, add the DigitalOcean key to apt by typing:

curl | sudo apt-key add -

Now you can update the repository package index and install the Agent by typing:

sudo apt-get update
sudo apt-get install do-agent

The agent should now be installed and running.

CentOS and Fedora

On CentOS or Fedora, create and open a repository definition file with sudo privileges:

sudo vi /etc/yum.repos.d/digitalocean-agent.repo

Inside, paste the following configuration:

name=do agent


Import the DigitalOcean key by typing:

sudo rpm --import

Now, you can install the metrics agent by typing:

sudo yum install do-agent

The agent should now be installed and running.

View the Enhanced Graphs

Once the metrics agent is enabled, click the Droplet’s name, which takes you to the Graphs section of your Droplet’s detail page. The extended metrics will be available once the metrics agent checks in and the initial data points are processed, which may take a few minutes:

Droplet extended metric graphs

Use the drop-down menu to adjust the time window displayed and mouse over the graphs to view detailed information.