Prometheus can collect a host's measurements successfully while its graphs still feel difficult to navigate. Grafana turns those measurements into dashboards with named panels, useful units and a shared time range. This guide installs Grafana, connects the correct Prometheus endpoint, and proves that a panel represents the machine you intended to monitor.
What Is Grafana?
Grafana is a visualization and monitoring application that queries configured data sources. With Prometheus, the historical metric samples remain in Prometheus. Grafana also stores its own application information, including users, dashboard definitions and data-source configuration. Therefore, the statement that Grafana stores no data is misleading: it has state that needs persistence and backup.
A dashboard combines panels, queries, display settings and optional filters. A useful panel should answer a specific question, such as whether a host has sustained CPU pressure. Attractive colors are secondary to choosing the right measurement and explaining its units. The installation overview describes Grafana's application database and deployment options.
Check Prometheus Before Adding Grafana
Complete the Prometheus server setup first if you already have exporters. Confirm its targets are being scraped and that querying up returns the expected instances. The server's usual port is 9090; a Linux exporter's usual 9100 endpoint is not the URL to enter as Grafana's Prometheus data source.
If you want a new Docker deployment of both services, use the stack later in this article instead. Choose one method for Grafana and avoid starting two installations on port 3000. Do not replace an existing stack or its volumes merely to match the example.
Install Grafana on Debian or Ubuntu
For a fresh package installation, use Grafana's signed stable repository. The sequence below installs the download and key-handling prerequisites, creates the keyring directory, registers the repository, and starts the service. Follow the official Debian/Ubuntu installation instructions if repository keys or distribution support change.
sudo apt-get update
sudo apt-get install -y apt-transport-https software-properties-common wget gnupg
sudo mkdir -p /etc/apt/keyrings
wget -q -O grafana.asc https://apt.grafana.com/gpg-full.key
sudo install -m 0644 grafana.asc /etc/apt/keyrings/grafana.asc
echo 'deb [signed-by=/etc/apt/keyrings/grafana.asc] https://apt.grafana.com stable main' | sudo tee /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install grafana
sudo systemctl enable --now grafana-server
sudo systemctl status grafana-server --no-pager
Stop if the key download or repository verification fails; do not bypass signature verification. On a machine with an older Grafana repository, inspect and reconcile its existing source entry first rather than creating conflicting entries. An existing installation also needs its upgrade notes and backups checked before package upgrades. RHEL-family systems require their own repository and package instructions; a bare yum install grafana is not a complete installation guide.
Windows Installation and First Login
Choose the appropriate package from the self-managed download page. For an extracted Windows distribution, open PowerShell in its installation root and start the current executable:
.\bin\grafana.exe server
This is a foreground process, not automatic Windows service registration. Grafana 13 uses the combined grafana executable; older releases can use different binary names. Follow the Windows guide and the instructions for your downloaded version for a supervised service setup.
Open http://localhost:3000 from the machine running Grafana. For a fresh default installation, sign in with admin / admin and replace that password immediately. Existing credentials are not reset just because you reinstall the package. Check listening addresses and firewall rules before allowing other machines to connect; keep the administration interface off the public internet unless you have deliberately configured authenticated HTTPS access.
Alternative: A Complete Docker Compose Stack
This fresh-install example runs both services on the same Compose network, keeps Prometheus unpublished, and publishes Grafana on host loopback. Use grafana/grafana for the open-source image: upstream stopped updating grafana/grafana-oss from version 12.4.0. See the official Docker guide for image names and persistent storage.
Create an empty working folder and save this as compose.yaml. The pinned release examples make upgrades an explicit decision; check supported releases before installing later. Do not automatically update this monitoring stack while you are using it to diagnose another upgrade.
services:
prometheus:
image: prom/prometheus:v3.13.4
restart: unless-stopped
volumes:
- type: bind
source: ./prometheus.yml
target: /etc/prometheus/prometheus.yml
read_only: true
bind:
create_host_path: false
- prometheus_data:/prometheus
grafana:
image: grafana/grafana:13.2.3
restart: unless-stopped
ports:
- "127.0.0.1:3000:3000"
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:?Set GRAFANA_ADMIN_PASSWORD in .env}
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- grafana_data:/var/lib/grafana
volumes:
prometheus_data:
grafana_data:
In the same folder, create prometheus.yml before deployment. This minimal configuration monitors Prometheus itself and a Linux exporter. Replace the example host address or remove that job until you have an exporter:
global:
scrape_interval: 30s
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
- job_name: linux
static_configs:
- targets: ['192.168.1.10:9100']
Create a private .env file beside the Compose file and set GRAFANA_ADMIN_PASSWORD to a strong unique password. On a Linux host, restrict its permissions with chmod 600 .env and exclude it from version control. Use Compose's documented quoting rules if the password contains special characters. Validate without printing expanded secrets, then start and inspect the services:
docker compose config --quiet
docker compose up -d
docker compose ps
docker compose logs --tail=50 prometheus grafana
The environment password initializes a fresh Grafana database; changing it later does not automatically reset an existing administrator's password. The named volumes preserve state across container recreation. Do not run down -v to troubleshoot an empty panel, because it removes volumes. A remote workstation can use an SSH tunnel to host port 3000; change the binding to a private LAN address only as part of an intentional access policy.
Connect the Data Source from Grafana's Location
As an organization administrator, open Connections, find Prometheus, and add a data source. Name it clearly and set the server URL. Menu wording can vary by Grafana version; the data-source guide lists the current connection and authentication settings.
| Deployment | Prometheus URL for Grafana |
|---|---|
| Both native services on the same host | http://127.0.0.1:9090, if Prometheus listens there |
| The Compose stack above | http://prometheus:9090 |
| Separate hosts | The reachable private hostname/address and configured port; ensure the listener and firewall permit Grafana |
Grafana's backend makes the request. In separate containers, localhost refers to Grafana's own container, not Prometheus or your browser. If the endpoint uses TLS or authentication, configure the corresponding trust and credentials rather than disabling certificate checks. Set the data-source scrape interval to match the thirty-second example, then select Save & test.
Build One Panel You Can Explain
Start in Explore with the new data source and query up. Check that the result includes the expected job and instance labels. With the self target available, you can verify connectivity even before installing a remote exporter.
For the Linux job above, create a dashboard visualization and use this expression in the Prometheus query editor:
100 * (1 - avg by (instance) (rate(node_cpu_seconds_total{job="linux",mode="idle"}[5m])))
Name the panel Linux CPU non-idle, five-minute average. Set the unit to percent on the zero-to-one-hundred scale, use {{instance}} as the legend, and choose a time range that includes several scrapes. Save the dashboard in a folder you can find again. The query preserves one result per instance; it averages across CPU cores instead of adding their percentages together.
Compare one host's curve with that host's own CPU monitor over a similar period. A short spike can look smaller in a five-minute average, which is expected. Windows exporter metrics need a Windows-specific query. The Node Exporter guide explains how CPU counters become rates.
Import Community Dashboards Carefully
The Node Exporter Full dashboard, ID 1860, is a starting point for Linux host metrics. Open the dashboard import screen, load that ID or a downloaded JSON definition, select your Prometheus data source and review its instance/job filters.
An imported dashboard is a query template, not an exporter installer or proof of compatibility. It may expect collectors or labels you have not enabled. Review its description and individual queries when panels are empty. Windows, container and Proxmox dashboards need their own appropriate exporters and metrics; a list of impressive dashboard names cannot replace those prerequisites.
Diagnose Empty or Misleading Panels
- Connection test fails: check the URL from Grafana's deployment location, then the server listener, network route and authentication.
- Connection passes but all queries are empty: query
up, check the chosen data source and inspect whether the selected time range includes recent samples. - Some panels work: compare the failing query's metric names and label filters with results in Explore. Check the exporter and collectors before changing the dashboard.
- Rates are empty after startup: allow several scrapes and use a window long enough for the configured interval.
- Values look implausible: inspect aggregation and units. Bytes are not bits, and a zero-to-one ratio is not already a zero-to-one-hundred percentage.
Change one thing at a time and save a working dashboard before broad edits. Dashboard refresh frequency controls how often Grafana asks for results; it cannot make Prometheus collect samples faster than its scrape configuration.
Alerts, Other Sources and Recovery
Grafana can also query SQL databases and other supported sources. For example, a PostgreSQL data source executes database queries; simply connecting it does not automatically produce operating-system or database-health metrics. Choose the source and query that answer your question using the data-source documentation.
Prometheus rules and Grafana-managed alert rules are distinct configurations. Decide where a rule lives and test its notification path there, so two systems do not silently produce duplicate alerts. Prometheus also has query graphs and alerting capabilities; it should not be characterized as incapable of refresh or meaningful alerting. Grafana's value here is making the selected information easier to interpret.
Back up Grafana's configuration, plugins and application database, along with provisioning files or exported dashboards you maintain. For the default SQLite database, stop Grafana before copying it for a consistent backup. The official backup guide distinguishes those items. Prometheus history is stored separately. After a restart or restore, verify both the dashboard definition and the returned measurements.
Conclusion
A dependable dashboard starts with a verified data source and one understandable panel. Once those checks pass, expand with community dashboards, useful filters and tested alerts. Keep the metric collection path and both services' backups documented so you can repair the setup when an exporter, query or host changes. The official Grafana website provides further product resources.



