Monitoring DigitalOcean Droplets with Prometheus

Monitoring DigitalOcean Droplets with Prometheus
  • Create a Private Network
  • Setup Prometheus
  • Install Node Exporter

Create a Private Network

Segmenting traffic gives you more flexibility and security. In most deployments users do not want their monitoring traffic flowing over public facing interfaces.

Full docs on how to setup private networking below. You will need to do this on all the droplets you want to monitor.

How to Enable Private Networking on Droplets | DigitalOcean Product Documentation
Enable private networking when creating a Droplet, or manually configure private networking on an existing Droplet.

Setup Prometheus

Create a new droplet that will host the Prometheus instance.

Prometheus from the ground up
Prometheus installation and setup

You can also get prometheus running from the DigatalOcean Marketplace

Prometheus Hosting | DigitalOcean Marketplace 1-Click App
The Prometheus monitoring system

Install Node Exporter

Node Exporter gathers OS level metrics and presents them over HTTP for Prometheus to scrape.

Download NodeExporter

Download | Prometheus
An open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach.
cd /tmp


#check MD5

tar -xf node_exporter-1.0.1.linux-amd64.tar.gz

cd node_exporter-1.0.1.linux-amd64/

cp node_exporter /usr/local/bin/

useradd -r node_exporter

nano /etc/systemd/system/node_exporter.service

systemctl daemon-reload

service node_exporter status
service node_exporter start

Service File

Description=Prometheus Node Exporter

ExecStart=/usr/local/bin/node_exporter \




If you have ufw enabled you'll have to allow TCP port 9100

ufw status numbered

# allow port 9100 TCP
ufw allow proto tcp from any to any port 9100

Update the Prometheus Config

nano /etc/prometheus/prometheus.yml
  - job_name: 'node'
    - targets: ['IP01:9100','IP02:9100','IP03:9100']
Example Prometheus Job
service prometheus reload

Larger deployments should look into Service Discovery instead of a static list of nodes in the prometheus.yml

Get $100 in cloud credits from DigitalOcean using my link:

DigitalOcean Referral Badge