How to Install the DigitalOcean Metrics Agent

Validated on 1 May 2026 • Last edited on 12 May 2026

DigitalOcean Monitoring is a free, opt-in service that helps you track Droplet resource usage, view performance metrics, and receive alerts. The DigitalOcean metrics agent is an open-source Go utility that collects and sends system metrics to DigitalOcean to enable features such as usage graphs, alerts, and custom metrics.

You can install the metrics agent by running the automated installation script. The script detects your operating system, adds the correct DigitalOcean package repository, installs the do-agent package, and then enables the service automatically.

Note

The DigitalOcean metrics agent collects and sends system telemetry data for monitoring and alerts. It does not collect or transmit Customer Content. After you uninstall the agent, we keep historical data for 90 days, and then delete it.

GPU Droplets have the metrics agent selected by default. To remove it, see How to Uninstall the DigitalOcean Metrics Agent.

If you don’t want to use the installation script, you can install the agent manually with the metrics agent repository.

Enable Metrics Agent During Droplet Creation

To enable monitoring when you create a Droplet under the Monitoring section, click the Improved Metrics and monitoring (Free) option.

When you create a GPU Droplet and select Improved Metrics and monitoring (Free), we enable GPU Observability, which adds GPU metrics such as utilization, temperature, power, and throttling. On AI/ML Ready Droplets, GPU metrics are enabled automatically. On basic images, you must enable GPU metrics manually. For Basic Images, you can enable GPU metrics by manually installing the exporter, binding it to 127.0.0.1, reconfiguring do-agent to scrape it, and restarting do-agent.

Install Metrics Agent Using Script

The installation script detects your operating system, configures the correct DigitalOcean package repository, installs the do-agent package with your system’s package manager, and then enables the service automatically.

To install the metrics agent from the repository, go to the DigitalOcean Control Panel. In the left menu, click COMPUTE, then Droplets. Select the Droplet you want to add the metrics agent to, and then in the top-right, click Web Console to open a terminal session.

You can either run the script directly or review it before executing.

Download and Run Script

To download and immediately run the installation script, run the following command:

curl -sSL https://repos.insights.digitalocean.com/install.sh | sudo bash

After you run the command, the script verifies compatibility, installs system dependencies, adds the required package repositories, and then installs the metrics agent. The script returns output similar to the following:

Cleaning up old sources...OK
Verifying machine compatibility...OK
...
Installing apt repository...
Installing gpg key...
...
Setting up do-agent (3.17.1) ...
enable systemd service
Created symlink '/etc/systemd/system/multi-user.target.wants/do-agent.service' → '/etc/systemd/system/do-agent.service'.
...

After you run the script, verify the agent is running.

Download, Inspect, and Run Script

Before you download and run the installation script, you can review it to audit the changes it makes to your system. This is useful in production environments or when your security policies require script review.

To review the script, save the script to /tmp/install.sh like this:

curl -sSL https://repos.insights.digitalocean.com/install.sh -o /tmp/install.sh

This command produces no output. To confirm that the file downloaded successfully, run the following command to check that it exists and has content:

ls -lh /tmp/install.sh

If the download was successful, the command returns output similar to this and shows that the file exists at /tmp/install.sh:

-rw-r--r-- 1 root root 7.2K ... /tmp/install.sh

Then, run a less command to review the script contents:

less /tmp/install.sh

Then, type q to exit the viewer. To install the metrics agent, run the script manually with administrative privileges, completing the installation:

sudo bash /tmp/install.sh

The output confirms that the script verified compatibility, installed the do-agent package, and enabled the agent service to start on boot, like this:

Cleaning up old sources...OK
Verifying machine compatibility...OK
...
Installing apt repository...
Installing gpg key...
...
Setting up do-agent (3.17.1) ...
enable systemd service
Created symlink '/etc/systemd/system/multi-user.target.wants/do-agent.service' → '/etc/systemd/system/do-agent.service'.
...

After installation, verify that the agent is running.

Verify Metrics Agent Installed

To check whether the do-agent systemd service is active, run the following command:

systemctl status do-agent

If the metrics agent is active, the output confirms that it’s installed, running, and set to start automatically on boot:

● do-agent.service - The DigitalOcean Monitoring Agent
     Loaded: loaded (/etc/systemd/system/do-agent.service; enabled; ...)
     Active: active (running) since Wed 2025-06-18 19:14:50 UTC; 35s ago
...
   Main PID: 4675 (do-agent)
...
             └─4675 /opt/digitalocean/bin/do-agent --syslog

Then, check whether the agent process is running by searching for processes with the name do-agent:

ps aux | grep do-agent

If the metrics agent is running, the output includes a line that shows do-agent is running as a background process like this:

do-agent    4675  0.0  0.3 ... ?  Ssl  19:14   0:00 /opt/digitalocean/bin/do-agent --syslog
root        4733  0.0  0.0 ... pts/0  S+  19:15   0:00 grep --color=auto do-agent

To see your Droplet’s metrics, exit your Droplet’s terminal session, and then click its Insights tab. Metrics appear a few minutes after the metrics agent starts reporting data.

If the service isn’t running or these commands return no output, contact support for help troubleshooting the installation.

Enable Metrics Agent Using Automation

You can enable monitoring via the DigitalOcean API or CLI.

Enable Metrics Agent via API

To enable the metrics agent via API, set the monitoring parameter to true when creating a Droplet via API.

How to Enable the Metrics Agent Using the DigitalOcean API

Create a personal access token and save it for use with the API.

cURL

Send a POST request to https://api.digitalocean.com/v2/droplets.

Using cURL:

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  -d '{"name":"example.com","region":"nyc3","size":"s-1vcpu-1gb","image":"ubuntu-20-04-x64","ssh_keys":[289794,"3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"],"backups":true,"ipv6":true,"monitoring":true,"tags":["env:prod","web"],"user_data":"#cloud-config\nruncmd:\n  - touch /test.txt\n","vpc_uuid":"760e09ef-dc84-11e8-981e-3cfdfeaae000"}' \
  "https://api.digitalocean.com/v2/droplets"

Go

Using Godo, the official DigitalOcean API client for Go:

import (
    "context"
    "os"

    "github.com/digitalocean/godo"
)

func main() {
    token := os.Getenv("DIGITALOCEAN_TOKEN")

    client := godo.NewFromToken(token)
    ctx := context.TODO()

    createRequest := &godo.DropletCreateRequest{
        Name:   "example.com",
        Region: "nyc3",
        Size:   "s-1vcpu-1gb",
        Image: godo.DropletCreateImage{
            Slug: "ubuntu-20-04-x64",
        },
        SSHKeys: []godo.DropletCreateSSHKey{
            godo.DropletCreateSSHKey{ID: 289794},
            godo.DropletCreateSSHKey{Fingerprint: "3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"}
        },
        Backups: true,
        IPv6: true,
        Monitoring: true,
        Tags: []string{"env:prod","web"},
        UserData: "#cloud-config\nruncmd:\n  - touch /test.txt\n",
        VPCUUID: "760e09ef-dc84-11e8-981e-3cfdfeaae000",
    }

Ruby

Using DropletKit, the official DigitalOcean API client for Ruby:

require 'droplet_kit'
token = ENV['DIGITALOCEAN_TOKEN']
client = DropletKit::Client.new(access_token: token)

droplet = DropletKit::Droplet.new(
  name: 'example.com',
  region: 'nyc3',
  size: 's-1vcpu-1gb',
  image: 'ubuntu-20-04-x64',
  ssh_keys: [289794,"3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"],
  backups: true,
  ipv6: true,
  monitoring: true,
  tags: ["env:prod","web"],
  user_data: "#cloud-config\nruncmd:\n  - touch /test.txt\n",
  vpc_uuid: "760e09ef-dc84-11e8-981e-3cfdfeaae000",
)
client.droplets.create(droplet)

Python

Using PyDo, the official DigitalOcean API client for Python:

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "name": "example.com",
  "region": "nyc3",
  "size": "s-1vcpu-1gb",
  "image": "ubuntu-20-04-x64",
  "ssh_keys": [
    289794,
    "3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45"
  ],
  "backups": True,
  "ipv6": True,
  "monitoring": True,
  "tags": [
    "env:prod",
    "web"
  ],
  "user_data": "#cloud-config\nruncmd:\n  - touch /test.txt\n",
  "vpc_uuid": "760e09ef-dc84-11e8-981e-3cfdfeaae000"
}

resp = client.droplets.create(body=req)

Enable Metrics Agent via CLI

To enable the metrics agent via CLI, add the --enable-monitoring flag when creating a Droplet using the CLI.

How to Enable the Metrics Agent Using the DigitalOcean CLI
  1. Install doctl, the official DigitalOcean CLI.
  2. Create a personal access token and save it for use with doctl.
  3. Use the token to grant doctl access to your DigitalOcean account.
    doctl auth init
  4. Finally, run doctl compute droplet create. Basic usage looks like this, but you can read the usage docs for more details:
    doctl compute droplet create <droplet-name>... [flags]
    The following example creates a Droplet named example-droplet with a two vCPUs, two GiB of RAM, and 20 GBs of disk space. The Droplet is created in the nyc1 region and is based on the ubuntu-20-04-x64 image. Additionally, the command uses the --user-data flag to run a Bash script the first time the Droplet boots up:

doctl compute droplet create example-droplet –size s-2vcpu-2gb –image ubuntu-20-04-x64 –region nyc1 –user-data $’#!/bin/bash\n touch /root/example.txt; sudo apt update;sudo snap install doctl'

Please note: In Windows Powershell, the example command would be the following instead:

```shell
doctl compute droplet create example-droplet --size s-2vcpu-2gb --image ubuntu-20-04-x64 --region nyc1  --user-data "#!/bin/bash`n touch /root/example.txt; sudo apt update;sudo snap install doctl"
```

We can't find any results for your search.

Try using different keywords or simplifying your search terms.