Marketplace
Deploy this app

Monitoring
Grafana + Prometheus
Metrics collection and dashboards, preconfigured together.
About
Installs Prometheus and Grafana from their official apt repositories and pre-wires Prometheus as a Grafana data source, so you can start building dashboards immediately.
Grafana's default login is admin / admin — you'll be prompted to change it on first sign-in.
Ports opened by the installer
3000/tcp · Grafana9090/tcp · Prometheus
Install script (runs as cloud-init user-data on first boot)
#!/bin/bash
set -e
export DEBIAN_FRONTEND=noninteractive
apt-get update -y
apt-get install -y apt-transport-https software-properties-common wget gnupg curl
# Prometheus
useradd --no-create-home --shell /usr/sbin/nologin prometheus || true
mkdir -p /etc/prometheus /var/lib/prometheus
cd /tmp
PROM_VER=$(curl -s https://api.github.com/repos/prometheus/prometheus/releases/latest | grep tag_name | cut -d'"' -f4 | tr -d v)
curl -sL "https://github.com/prometheus/prometheus/releases/download/v$PROM_VER/prometheus-$PROM_VER.linux-amd64.tar.gz" -o prometheus.tar.gz
tar xzf prometheus.tar.gz
cp prometheus-$PROM_VER.linux-amd64/prometheus prometheus-$PROM_VER.linux-amd64/promtool /usr/local/bin/
cp -r prometheus-$PROM_VER.linux-amd64/consoles prometheus-$PROM_VER.linux-amd64/console_libraries /etc/prometheus/
cat > /etc/prometheus/prometheus.yml <<'YML'
global:
scrape_interval: 15s
scrape_configs:
- job_name: prometheus
static_configs: [{ targets: ['localhost:9090'] }]
YML
chown -R prometheus:prometheus /etc/prometheus /var/lib/prometheus
cat > /etc/systemd/system/prometheus.service <<'UNIT'
[Unit]
Description=Prometheus
After=network.target
[Service]
User=prometheus
ExecStart=/usr/local/bin/prometheus --config.file=/etc/prometheus/prometheus.yml --storage.tsdb.path=/var/lib/prometheus
Restart=always
[Install]
WantedBy=multi-user.target
UNIT
systemctl daemon-reload
systemctl enable --now prometheus
# Grafana
wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" > /etc/apt/sources.list.d/grafana.list
apt-get update -y
apt-get install -y grafana
mkdir -p /etc/grafana/provisioning/datasources
cat > /etc/grafana/provisioning/datasources/prometheus.yml <<'YML'
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://localhost:9090
isDefault: true
YML
systemctl enable --now grafana-server
Minimum requirements
- vCPU
- 1
- Memory
- 1 GB
- Disk
- 20 GB
- Base image
- ubuntu
