---
title: "Monitoring a Linux host using Prometheus and node_exporter | Grafana Cloud documentation"
description: "Linux Quickstart without the Agent using Prometheus and node_exporter"
---

# Monitoring a Linux host using Prometheus and node\_exporter

This guide will show you how to install Prometheus and node\_exporter to a Linux node and use them to push metrics to Grafana Cloud. Then it will show you how to install a preconfigured dashboard or create your own to visualize those metrics.

## Prerequisites

- A Grafana Cloud account, as shown in [Quickstarts](/docs/grafana-cloud/quickstart/).
- A [Grafana Cloud Access Policy token](/docs/grafana-cloud/account-management/authentication-and-permissions/access-policies/) with the `metrics:write` scope (permission) to send metrics to your Grafana Cloud Prometheus instance.
- A Linux machine
- Command line (terminal) access to that Linux machine
- Account permissions sufficient to install `wget` on the Linux machine

## Install and run node\_exporter on the node

We are going to collect metrics from a Linux node using [node\_exporter](https://github.com/prometheus/node_exporter). If you want to collect metrics from Windows, you can follow a similar process using [windows\_exporter](https://github.com/prometheus-community/windows_exporter).

Download the node\_exporter compressed package.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
wget https://github.com/prometheus/node_exporter/releases/download/v*/node_exporter-*.*-amd64.tar.gz
```

Extract the node\_exporter binary, which will collect metrics from the Linux machine, format those metrics in a Prometheus format, and provide those metrics on an internal port for Prometheus to scrape.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
tar xvfz node_exporter-*.*-amd64.tar.gz
```

Change to the directory created during extraction.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
cd node_exporter-*.*-amd64
```

Make the node\_exporter binary executable.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
chmod +x node_exporter
```

Run the node\_exporter binary.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
./node_exporter
```

Test that metrics are being exported on port 9100.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
curl http://localhost:9100/metrics
```

If you see metrics on your screen, all is well. If not, check your steps for typos, make sure the binary is executable, and whether curl works with other URLs.

## Install Prometheus on the node

Next, we will download and install [Prometheus](https://prometheus.io) on the node to scrape the metrics being provided by node\_exporter and send them to Grafana Cloud. Prometheus collects metrics and makes them available for searching and visualization. Typically, Prometheus pulls metrics from configured sources, but we will use the `remote_write` feature which will push metrics from Prometheus to Grafana Cloud.

Download the Prometheus compressed package.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
wget https://github.com/prometheus/prometheus/releases/download/v*/prometheus-*.*-amd64.tar.gz
```

Extract the binary.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
tar xvf prometheus-*.*-amd64.tar.gz
```

Change to the directory created during extraction.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
cd prometheus-*.*
```

Create a configuration file for Prometheus, so that it can scrape the metrics and to send them to Grafana Cloud. This configuration file has many options. For our example, it only needs three sections:

- **`global`** is the section into which configurations common across all Prometheus actions are placed. In this example, we set the `scrape_interval` for checking and grabbing metrics from configured jobs to happen every 15 seconds.
- **`scrape_configs`** is where we name our job; this name will be used in Grafana to help you find associated metrics. It is also where we configure Prometheus to find the metrics for that job.
- **`remote_write`** is where we instruct Prometheus to send the scraped metrics to a secondary endpoint.

Edit this file to include your Grafana Cloud username and the Access Policy token you created earlier.

To confirm your username and URL, first navigate to the Cloud Portal, then from the **Prometheus** box, click **Send Metrics**. 

Create a Prometheus configuration file named `prometheus.yml` in the same directory as the Prometheus binary with the following content.

YAML ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```yaml
global:
  scrape_interval: 60s

scrape_configs:
  - job_name: node
    static_configs:
      - targets: ['localhost:9100']

remote_write:
  - url: '<Your Metrics instance remote_write endpoint>'
    basic_auth:
      username: '<Your Grafana Username>'
      password: '<Your Grafana Cloud Access Policy Token>'
```

You can find the `/api/prom/push` URL, username, and password for your metrics endpoint by clicking on **Details** in the Prometheus card of the [Cloud Portal](/docs/grafana-cloud/security-and-account-management/cloud-portal/).

Save the file.

Run the Prometheus binary, instructing Prometheus to use the configuration file we just created.

Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```bash
./prometheus --config.file=./prometheus.yml
```

If you don’t want to have to start Prometheus directly from the command line every time you want it to run, you can create a systemd service for it.

## Check that metrics are being ingested into Grafana Cloud

Within minutes, metrics should begin to be available in Grafana Cloud. To test this, use the **Explore** feature. Click **Explore** in the sidebar to start. This takes you to the Explore page, which looks like this.

At the top of the page, use the dropdown menu to select your Prometheus data source.

Use the **Metrics** dropdown to find the entry for **node**, which is the `job_name` we created in `prometheus.yml`.

If `node` is not listed, metrics are not being collected. If metrics are listed, this confirms that metrics are being received.

If metrics are not displayed after several minutes, check your steps for typos, make sure the binary is executable, and whether Prometheus is running on the Linux machine.

## Configure a dashboard

Here you have two options: install a pre-made dashboard or create a dashboard from scratch.

### Import a dashboard

Official and community-built dashboards are listed on the Grafana website [Dashboards](/grafana/dashboards) page.

Dashboards on this page will include information in the Overview tab about special configurations you may need to use to get the dashboard to work. For our example, we require a dashboard that is built to display Linux Node metrics using Prometheus and node\_exporter, so we chose [Linux Hosts Metrics | Base](/grafana/dashboards/10180). Note the ID of the dashboard: 10180. We will use this ID in the next step.

1. In Grafana, click **Dashboards** in the left-side menu to go to the Dashboards page.
2. Click **New** and select **Import** in the dropdown.
3. Enter the ID number of the dashboard we selected.
4. Click **Load**.
   
   You’ll get a dashboard like this one.

See [Export and import](/docs/grafana/latest/dashboards/manage-dashboards/#export-and-import-dashboards) to learn more about importing Grafana dashboards.

### Create a Dashboard

To create a dashboard, it is helpful to know [PromQL](https://prometheus.io/docs/prometheus/latest/querying/basics/) and have a sense of the metrics and calculations based on those metrics that you want to display in your dashboard panels.

1. In Grafana, click **Dashboards** in the left-side menu to go to the Dashboards page.
2. Click **New** and select **New Dashboard** in the dropdown menu.
   
   Your new dashboard starts out empty.
3. Click **+ Add visualization** to open the Edit panel screen.

Complete instructions for creating a dashboard panel (indeed, multiple panels to create a dashboard) are beyond the scope of this quickstart. To learn more about creating a panel, see the Grafana [Add a panel](/docs/grafana/latest/panels-visualizations/) documentation.
