Introduction
Prometheus is a free and open-source monitoring tool that stores the metrics as time series data with values and labels that can expose the metrics data with Grafana.
Grafana is a free and open-source data visualization and monitoring platform that connects many numbers of data sources and creates logging and metrics-based dashboards along with alerting.
Node exporter is a free and open-source exporter for Prometheus that collects and exposes the hardware utilization.
Prerequisites
- 2 Cores and 2 GB memory
- 30 GB disk space ( This will be a minimal requirement )
- Basic knowledge of Linux's commands
In this post, We are going to show you how to set up an open-source monitoring tool on Ubuntu 24.04 LTS.
Step 1: Run System Update & Upgrade
We need to execute the given command that updates and upgrades the Ubuntu repository and upgrades the packages.
sudo apt-get update && sudo apt-get upgrade -yStep 2: Installing Node Exporter
By default, the Node Exporter repo is available with the Ubuntu repository. We just need to execute the given command to install Prometheus's Node Exporter.
sudo apt-get install prometheus-node-exporter -yStep 3: Checking Node Exporter Service
After the node exporter package installation, we need to check if the service is running or not by using the given command.
sudo systemctl status prometheus-node-exporterBy default, we need to open port 9100 on this Ubuntu machine because Prometheus will pull the metrics from this port using the Node Exporter service.
Step 4: Installing Prometheus
We can directly install Prometheus using Ubuntu 24.04 LTS by executing the given command.
sudo apt-get install prometheus -yStep 5: Verify Prometheus Service
After installation of Prometheus, we need to check if the service is running properly or not. To make sure, we need to execute the given command for the same.
sudo systemctl status prometheusAlso, we need to open the 9090 on this Ubuntu machine because Grafana will pull the metrics from this port using Prometheus.
Step 6: Installing Grafana
To install Grafana, we need to install their dependencies first. Use the given command in order to meet the requirement.
sudo apt-get install adduser libfontconfig1 musl -y
Step 7: Download Grafana .deb
We are good to install Grafana, but in this post, we are going to use the .deb file of Grafana to install version 11.4.0 on Ubuntu.
wget https://dl.grafana.com/oss/release/grafana_11.4.0_amd64.debStep 8: Installing Grafana 11
After downloading the Grafana deb packages from the Grafana official website, we are good to execute the given setup and install Grafana.
sudo dpkg -i grafana_11.4.0_amd64.debStep 9: Start the Grafana Service
We need to start the Grafana service; by default, the Grafana service will be stopped. deb package installation, Use the given command to start Grafana's service.
sudo systemctl start grafana-server.serviceStep 10: Getting Grafana Service Status
When we start Grafana's service, we check that Grafana's service is up and running by using the given command.
Step 11: Accessing Grafana Portal
By default, Grafana will work on port 3000. We need to open this port in order to access the GUI of Grafana and after that use the given URL.
http://localhost:3000 or http://<IP-Address>:3000
Once we get the GUI of the Grafana dashboard, we need to use the default username and password that are given below: -
Username: admin
Password: admin
After passing the default username and password, we will be asked to update the admin user password. Create your new strong password that protects from hacks.
Step 11: Adding Prometheus Data Source
To add the Prometheus data source in Grafana, we need to open the left side menu option and click on the Add new connection button.
In this webpage we need to search the Prometheus data source. We need to type the Prometheus keyword in order to search.
In this webpage we need to click on the Add new data source button on the right side of the web portal.
In this step, we need to pass the data source name, or we can go with the default name, Prometheus, and after that we need to pass the Prometheus server URL to integrate Grafana with Prometheus.
In this tutorial we did not set any kind of authentication, so we choose the No Authentication option here; the rest we can leave at the default setting.
In this advanced settings option, you can set the allowed cookies and timeout parameters.
Here we can set the builder by default; however, we also choose as per our need.
Here we can also set the performance setting that helps tune the performance of Prometheus; as of now, we can leave the setting.
We are good to test the connectivity with the Prometheus API URL; we should get the Prometheus API.
Step 12: Import Node Exporter Dashboard
We can import the Grafana dashboard that was created and publish it on Grafana Lab. We just need to use the dashboard ID. Use the following steps for the same.
Click on the Import dashboard button on the right side.
We should get the option to enter the Grafana dashboard ID. We need to use the 1860 for the node exporter.
Here we need to click on the Load button to import the dashboard.
Here we can see the sample node exporter dashboard is imported successfully.
Conclusion
We did install and configure Grafana, Prometheus, and Node Exporter on Ubuntu 24.04 LTS. Still having any issue or query.
























