Prometheus And Grafana#
| Author | Oskar Sinkkilä |
| Last updated | 12.2.2025 |
Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud. Since its inception in 2012, many companies and organizations have adopted Prometheus, and the project has a very active developer and user community. It is now a standalone open source project and maintained independently of any company.
Prometheus collects and stores its metrics as time series data, i.e. metrics information is stored with the timestamp at which it was recorded, alongside optional key-value pairs called labels.
Link to Prometheus documentation
Link to Grafana documentation
Prometheus Installation#
Make sure ports 9090 (Prometheus), 9100 (Node Exporter), and 3000 (Grafana) are open.
The way I have this set up is that I use two VMs, k6 with prometheus and grafana, and Prestashop that has prestashop. Both machines have node_exporter for data collection.
Download Prometheus#
wget https://github.com/prometheus/prometheus/releases/download/v3.1.0/prometheus-3.1.0.linux-amd64.tar.gz
Extract the archive#
Extracts the Prometheus files.Remove the archive#
Deletes the compressed file to save space.Create directories for Prometheus#
Creates directories for configuration and data storage.Navigate to extracted directory#
Moves into the Prometheus folder.Move Prometheus binaries to system path#
Moves the prometheus and promtool binaries to /usr/local/bin/ for global access.Move configuration file#
Moves the prometheus.yml configuration file to /etc/prometheus/.Verify Prometheus installation#
Confirms that Prometheus is installed.Create a Prometheus system user#
Creates a system user prometheus without login access.Set permissions for Prometheus files#
Grants ownership of Prometheus directories to the prometheus user.Create a systemd service file for Prometheus#
Defines a service to run Prometheus automatically.Contents of prometheus.service:#
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/bin/prometheus \
--config.file /etc/prometheus/prometheus.yml \
--storage.tsdb.path /var/lib/prometheus/ \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries \
--web.listen-address=0.0.0.0:9090 \
--web.enable-lifecycle \
--log.level=info
[Install]
WantedBy=multi-user.target
Reload systemd and start Prometheus#
Check Prometheus status#
Ensures Prometheus is running.
Access Prometheus Web UI#
- Open
http://<public_ip>:9090/queryin a browser. - Ensure port 9090 is open.

Node Exporter Installation#
Download Node Exporter#
wget https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-amd64.tar.gz
At the time of writing version 1.8.2 is the latest.
Extract Node Exporter#
Move the Node Exporter binary#
Remove extracted files#
Run Node Exporter (for testing)#
Create a system user for Node Exporter#
Create a systemd service file for Node Exporter#
Enable and start Node Exporter#
Check Node Exporter status#
Should show a green status.Verify Node Exporter Web UI#
- Open
http://<public_ip>:9100and check metrics.

Configure Prometheus to Monitor Node Exporter#
Edit Prometheus configuration file#

Restart Prometheus#
Check Target Health in Prometheus UI#
- Open
http://<public_ip>:9090/targets - Ensure Node Exporter appears as a monitored target.

Note, If Prestashop is on another machine, install Node Exporter there and configure Prometheus accordingly
Grafana Installation#
Grafana version used in this guide at the time of writing is 11.5.0
Install required dependencies#
Add Grafana repository key#
Add Grafana repository#
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
Update package list#
Install Grafana#
Enable and start Grafana service#
sudo systemctl daemon-reload
sudo systemctl enable grafana-server.service
sudo systemctl start grafana-server
Check Grafana status#
Should show a green status.Accessing Grafana#
- Open
http://<public_ip>:3000 - Default login credentials:
- Username: admin
- Password: admin (prompted to change after first login)
- Add Prometheus as a data source.
- Create dashboards to visualize metrics.