Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security, Veeam & DevOps

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form

Install and configure Prometheus for Monitoring on a Linux

Posted on 03/04/202216/08/2026 Raphael Gab-Momoh By Raphael Gab-Momoh No Comments on Install and configure Prometheus for Monitoring on a Linux
  1. Home
  2. Linux
  3. Install and configure Prometheus for Monitoring on a Linux
FEATURE-IMAGE-IMAGE

Prometheus is a lightweight open-source monitoring system with an effective alerting system. In this article, we shall discuss how to “Install and configure Prometheus for Monitoring on a Linux”. Prometheus gathers and saves metrics as time-series data, which means that metric data is kept alongside the timestamp at which it was captured, as well as additional key-value pairs known as labels. Other tutorials can be found here: How to install PostgreSQL on Ubuntu, How to install Apache Tomcat on Ubuntu, How to install Node.js on Ubuntu, How to install PostgreSQL on Ubuntu, how to install Gradle on Ubuntu, and how to install and configure Tripwire on Ubuntu.

More information about Prometheus can be obtained. This tutorial will teach you how to install and configure Prometheus for Monitoring on a Linux Server. Prometheus will be downloaded, installed, and executed.

Prometheus Attributes

The following are some attributes of Prometheus.

1: Time-series data identifiable by metric name and key/value pairs in an inter-data model
2: Uses PromQL for Querying and PromQL is a versatile query language
3: That allows you to make use of the dimensionality without relying on distributed storage.
4: Single server nodes are self-contained, and time series are collected using a pull model over HTTP.
5: Pushing time series is possible with the help of an intermediate gateway.
6: Service discovery or static configuration is used to discover targets.
7: Service discovery or static configuration is used to discover targets.

Requirements

Be sure you have sudo access to the Linux server. The server has internet connectivity and can download the Prometheus binaries.

On the server, firewall rules are opened to allow access to Prometheus port 9090.

Please see How to use Prometheus for Monitoring, Install Grafana on Windows and Windows Server, how to Change Visual Studio Code UI language, Performance and Diagnostics in Microsoft Cloud with Azure Monitor, and About AD LDS: Active Directory Lightweight Directory Services.

Steps to Install and Configure Prometheus

To achieve this, we will need to configure Prometheus Binaries.

1: Update the apt package repositories.

sudo apt update

2: Go to the official Prometheus downloads page and get the latest download link for the Linux binary.

DPROMETHEUS-1
download prometheus

3: extract using the tar command, and rename the extracted folder to Prometheus files.

tar -xvf prometheus-2.35.0.linux-amd64.tar.gz
mv prometheus-2.35.0.linux-amd64 prometheus-files
tarx
extract & rename

4: Create a Prometheus user, the necessary directories, and make Prometheus the owner of those directories.

sudo useradd --no-create-home --shell /bin/false prometheus
sudo mkdir /etc/prometheus
sudo mkdir /var/lib/prometheus
sudo chown prometheus:prometheus /etc/prometheus
sudo chown prometheus:prometheus /var/lib/prometheus

5: Change the ownership to the Prometheus user and copy the Prometheus and promtool binaries from the Prometheus files folder to /usr/local/bin.

sudo cp prometheus-files/prometheus /usr/local/bin/
sudo cp prometheus-files/promtool /usr/local/bin/
sudo chown prometheus:prometheus /usr/local/bin/prometheus
sudo chown prometheus:prometheus /usr/local/bin/promtool

Step 6: Transfer the consoles and console libraries folders from Prometheus files to the /etc/prometheus folder and assign the consoles and console libraries directories to the Prometheus user.

Also, see AD LDS and AD DS: Differences between Active Directory Lightweight Directory Services and Active Directory Domain Services, and how to set up Cisco ASA – wipe old configurations.

Configure Prometheus

The /etc/prometheus/Prometheus.yml file should contain all Prometheus configurations.

1: Create the prometheus.yml file.

sudo vi /etc/prometheus/prometheus.yml

2: Copy the following contents to the prometheus.yml file.

global:
scrape_interval: 10s
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']

3: Change the ownership of the file to Prometheus user.

sudo chown prometheus:prometheus /etc/prometheus/prometheus.yml

Setup Prometheus Service File

1: Create a Prometheus service file.

sudo vi /etc/systemd/system/prometheus.service

2: Copy the following content to the file.

[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
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
[Install]
WantedBy=multi-user.target

3: Reload the systemd service to register the Prometheus service and start the Prometheus service.

sudo systemctl daemon-reload
sudo systemctl start prometheus

Check the Prometheus service

sudo systemctl status prometheus
status-1

Access Prometheus Web UI

You may now access the Prometheus UI through the Prometheus server’s 9090 port.

To get the IP address type the command below

ip address show

To navigate to Prometheus UI type the command below and substitute the IP address of your environment

http://<prometheus-ip>:9090/graph

You should be able to view the UI depicted below.

prometheus-ui
Prometheus ui

We have just finished configuring the Prometheus server. To obtain metrics from the source systems, you must first register the target in the Prometheus.yml file.

If you wish to monitor 10 servers, for example, the IP addresses of these servers should be included as targets in the Prometheus setup to scrape the metrics.

The Node Exporter should be installed on the server to capture all system metrics and make them available for Prometheus to scrape.

endpoint
endpoint well configured

Summary

We installed and configured Prometheus on a Ubuntu machine.

And as you can see from the last screenshot, the state says up and this indicates that everything was well configured and working properly.

I hope you found this article on how to Install and configure Prometheus for Monitoring on a Linux Server useful. If you have any questions, please let me know in the comment session.

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
Linux Tags:Monitoring

Post navigation

Previous Post: How to Install Kubectl on Windows 11
Next Post: How to grant public access to S3 Bucket using Policy

Related Posts

  • Slide4
    How to install Let’s Encrypt on Apache Web Server Linux
  • Screenshot 2022 03 21 at 18.06.30
    How to Configure Virtual Host for Apache HTTP Web Server to Host Several Domains on Ubuntu 20.04 LTS Linux
  • Rport
    RPORT the free and open source remote management tool Linux
  • nodejs install on ubuntu
    How to install Node.js on Ubuntu Linux
  • trip wire feature
    How to install and configure Tripwire on Ubuntu Linux
  • TERRAFORM ON LINUX FEATURE IMAGE
    How to Install Terraform on Linux Linux

More Related Articles

Slide4 How to install Let’s Encrypt on Apache Web Server Linux
Screenshot 2022 03 21 at 18.06.30 How to Configure Virtual Host for Apache HTTP Web Server to Host Several Domains on Ubuntu 20.04 LTS Linux
Rport RPORT the free and open source remote management tool Linux
nodejs install on ubuntu How to install Node.js on Ubuntu Linux
trip wire feature How to install and configure Tripwire on Ubuntu Linux
TERRAFORM ON LINUX FEATURE IMAGE How to Install Terraform on Linux Linux

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

vexpert-badge-stars-5

Virtual Background

VEEAMLEGEND

Categories

veeaam100

Veeam Vanguard

  • RemoteDesktopLinceseServer
    Fix Remote session was disconnected because there are no Remote Desktop License Servers available to provide a license Network | Monitoring
  • banner
    How to deploy Folder Redirection in Windows Windows
  • Windows Hello with fake fingerprints
    Security researchers bypass Windows Hello with fake fingerprints with Raspberry Pi 4 Security | Vulnerability Scans and Assessment
  • Screenshot 2022 03 20 at 20.37.16
    Setup HTTPS users using Git credentials and Pushing Code to AWS CodeCommit AWS/Azure/OpenShift
  • windows 10 logo 100739284 large
    Application pool has been disabled or Changing identity user for IIS Application Pool (Event ID 5059) Web Server
  • screenshot 2020 02 08 at 15.53.31
    Enable Automatic Logon via Windows Registry Windows
  • maxresdefault
    Linux Directory Hierarchy Linux
  • Enable a Pre Boot BitLocker PIN on Windows
    How to Enable a Pre-Boot BitLocker PIN on Windows Security | Vulnerability Scans and Assessment

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,757 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Contact
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon
  • Bsky

Tags

Active Directory Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2026 TechDirectArchive

Loading Comments...

You must be logged in to post a comment.