How to Install & Set Up Grafana
Install Grafana OSS from the official APT repository (or Docker), connect a Prometheus data source through the UI or as code, and build your first dashboard.
Prerequisites
- ✓A Linux host
- ✓A data source such as Prometheus, Loki, or a SQL database — the walkthrough below assumes Prometheus running on the same host
How Grafana fits together
Grafana itself doesn't store your metrics or logs — it's a query and visualization layer that sits in front of data sources (Prometheus, Loki, InfluxDB, plain SQL, dozens of others) and translates each one's native query language into panels on a dashboard. A dashboard is just a JSON document describing a grid of panels, each pointed at a data source and a query; that JSON is exportable, importable, and diffable, which is what makes dashboards-as-code practical.
Install on Ubuntu/Debian (APT repo)
Install on RHEL, CentOS Stream, or Fedora (official RPM repo)
Alternative — run Grafana in Docker
Verify and log in
Open http://your-host:3000 and sign in with admin / admin — you'll be prompted to set a new password immediately.
Connect a data source through the UI
Connections → Data sources → Add data source → Prometheus, then point the URL at wherever Prometheus is listening (http://localhost:9090 if it's on the same box) and hit Save & test.
Provision data sources and dashboards as code
Clicking through the UI every time you stand up a new Grafana instance doesn't scale. Drop YAML files into Grafana's provisioning directories and it picks them up on startup — the same data sources and dashboards, defined once, checked into Git.
Drop exported dashboard JSON files into /var/lib/grafana/dashboards and restart grafana-server — they'll show up under the folder you configured, no manual import needed.
Build your first dashboard
Dashboards → New → New Dashboard → Add visualization, pick the Prometheus data source, and try a query like rate(node_cpu_seconds_total{mode="idle"}[5m]) — the same PromQL you'd run in Prometheus's own expression browser, now rendered as a time series panel you can save and share.
Documentation & Knowledge Base
Download Grafana— all versions & official links→Need Grafana deployed and managed for you?
We're OpenStack Dev — we design, deploy, and operate production DevOps infrastructure.