Log inSign up

Turn your metrics into clear Grafana dashboards

Add the official Grafana repository, install the grafana package and set http_addr = 127.0.0.1 in /etc/grafana/grafana.ini. Publish it at https://grafana.example.net through Caddy, change the admin password on first login, then add Prometheus or Loki as a data source and import a node_exporter dashboard to see your servers in minutes.

Topic: Monitoring and logs · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13, Rocky Linux 9, AlmaLinux 9 · Updated 2026-12-03

What will Grafana do for me?

Grafana draws dashboards and evaluates alerts on top of data you already collect. It does not store metrics itself: it reads them from data sources such as Prometheus, Loki for logs, InfluxDB, PostgreSQL or MySQL. One screen can then show CPU, memory, disk latency and HTTP errors side by side, with variables to switch between servers.

This guide installs Grafana OSS, the free open source edition. It works well on the same VPS as Prometheus for a small fleet; a 4 GB plan leaves comfortable room for both.

How do I install Grafana on Ubuntu or Debian?

Import the signing key into a keyring file, add the stable repository and install:

sudo apt install -y apt-transport-https wget gpg
sudo mkdir -p /etc/apt/keyrings
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
sudo apt update
apt policy grafana
sudo apt install -y grafana

The same repository also carries Loki and Alloy, which the log guide uses.

How do I install Grafana on Rocky Linux or AlmaLinux?

Create a repository file and install with dnf:

sudo tee /etc/yum.repos.d/grafana.repo > /dev/null <<'EOF'
[grafana]
name=grafana
baseurl=https://rpm.grafana.com
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://rpm.grafana.com/gpg.key
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
EOF
sudo dnf install -y grafana
dnf info grafana | grep -E '^(Version|Release)'

Accept the GPG key fingerprint when dnf asks for it.

How do I keep Grafana on localhost?

Edit /etc/grafana/grafana.ini before the first start. Settings are commented out with a semicolon by default; remove it and set the values in the right sections:

[server]
http_addr = 127.0.0.1
http_port = 3000
domain = grafana.example.net
root_url = https://grafana.example.net/

[security]
cookie_secure = true

[users]
allow_sign_up = false

[analytics]
reporting_enabled = false

Start the service and check its health endpoint, which also prints the version:

sudo systemctl daemon-reload
sudo systemctl enable --now grafana-server
sudo ss -tlnp | grep 3000
curl -s http://127.0.0.1:3000/api/health

The listener should read 127.0.0.1:3000 and the health response should report the database as ok.

How do I publish Grafana over HTTPS?

Point an A record for grafana.example.net at your server (see DNS records) and add a Caddy site, following Caddy HTTPS:

grafana.example.net {
    reverse_proxy 127.0.0.1:3000
}
# Ubuntu and Debian
sudo ufw allow 80/tcp && sudo ufw allow 443/tcp

# Rocky Linux and AlmaLinux
sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --reload

Open the address and sign in with admin / admin; Grafana requires a new password straight away, so do this the moment the site comes up. Then enable two step login through an identity provider if you have one, or keep a long unique password. Only want private access? Skip Caddy entirely and use ssh -N -L 3000:127.0.0.1:3000 deploy@198.51.100.24.

How do I add Prometheus as a data source?

You can click through Connections, Data sources, but a provisioning file is repeatable and survives a rebuild. Create /etc/grafana/provisioning/datasources/prometheus.yaml:

apiVersion: 1
datasources:
  - name: Prometheus
    type: prometheus
    access: proxy
    url: http://127.0.0.1:9090
    isDefault: true
sudo systemctl restart grafana-server
sudo journalctl -u grafana-server -n 20 --no-pager

When Prometheus runs on a different server, do not expose it in plain HTTP across the internet: use its TLS and basic auth web config, then fill in basicAuth and secureJsonData in the same file, or connect through an SSH tunnel.

How do I get a useful dashboard quickly?

Import a community dashboard built for node_exporter. In Dashboards choose New, Import, enter the ID 1860 (Node Exporter Full), pick your Prometheus data source and save. You will see CPU, memory, disk, network and filesystem panels with a host selector at the top.

Afterwards, make your own small overview with only the panels you check daily. Three or four time series and a stat panel for free disk space are often more useful than a hundred graphs. Save dashboards as JSON in a Git repository so they can be restored or provisioned from /etc/grafana/provisioning/dashboards/.

How do I set up alerts?

Grafana alerting runs queries on a schedule and notifies contact points. Create a contact point (Telegram, Slack, Discord, webhook or email), then an alert rule, for example: node_filesystem_avail_bytes / node_filesystem_size_bytes < 0.1 for 10 minutes. Email needs SMTP settings in grafana.ini; use an authenticated relay on port 587, and ask support by ticket before relying on outgoing port 25. Press Test on every contact point before trusting it.

How do I upgrade, back up and troubleshoot?

Updates come through the package manager: sudo apt upgrade or sudo dnf upgrade, followed by sudo systemctl restart grafana-server. Back up /var/lib/grafana/grafana.db and /etc/grafana before major upgrades.

  • Lost admin password: sudo grafana cli --homepath /usr/share/grafana --config /etc/grafana/grafana.ini admin reset-admin-password NEW_LONG_PASSWORD.
  • Redirect loop or broken links: root_url does not match the public address.
  • No data: open Explore, run up against Prometheus and check that targets are healthy.
  • Service will not start: read journalctl -u grafana-server; file permissions in /var/lib/grafana are a common cause after manual copies.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A2-4Grafana and Prometheus together2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months
A4-8larger fleets and long retention4 vCPU, 8 GB RAM, 180 GB NVMe$28.80/mo$86.40 for 3 months

Questions about Grafana dashboards

Is Grafana OSS free?

Yes, the open source edition from the official repository is free to install and use on your own server.

What is the default login?

User admin, password admin, and Grafana forces a change on first login. Change it before anyone else can reach the page.

Can Grafana show logs too?

Yes. Add Loki as a data source and use Explore or log panels. See Loki and Alloy for logs.

Does it replace the console Usage graphs?

No, they serve different needs. The Usage graphs tab is the provider side view of each instance; Grafana shows what your own collectors measure inside the OS.

Which plan suits Grafana with Prometheus?

For a small fleet, 2 vCPU and 4 GB RAM are comfortable. Grow by deploying a larger plan and migrating, as described in move to a larger plan.