How to install Prometheus server on Debian 11 open source monitoring. Prometheus is a free and open source monitoring system with a dimensional data model, a flexible query language, an efficient time series database, and a contemporary alerting methodology.
It is a flexible tool that can collect data from almost any infrastructure component, such as the Linux kernel, Docker containers, Kubernetes pods, and more. It is presented in a format that’s easy to query and visualize. Our content of monitoring section is very interesting so please take a look also.
This tutorial will go through the features, benefits, installation, and configuration process of the Prometheus server on Debian 11. This article will also discuss how you can run the Prometheus server securely with the help of the Nginx reverse proxy.
System monitoring tools are the way to go in a world where businesses need to monitor and analyse the performance of their apps and infrastructure using metrics.
Prometheus is one such system monitoring and alerting tool, built on top of Zookeeper. It can be used to monitor a variety of types of services and data stores, such as operating system metrics, service discovery, load balancers, and application metrics.
SoundCloud was the original creator of Prometheus. It is now a self contained open source project managed by the Cloud Native Computing Foundation (CNCF).
With Prometheus there is a flexible schema and it can store almost any kind of metric. It collects metrics from different kinds of system components (e.g., applications, libraries, daemons) and exposes them in a publish and monitor way so that they can be analysed by external tools such as graphd and Grafana.
Numerous Prometheus server configuration options are available to customize how data is collected and stored for analysis purposes.
Additionally, Prometheus is designed to easily be extended by anyone writing plugins that implement the metrics schema and publish their data to Prometheus.
Once the directories are created, you can go ahead and download the latest version of Prometheus, either directly from the Prometheus downloads page or using the following command.
You can verify the Prometheus version using the following commands.
prometheus --version
Output:
prometheus, version 2.37.0 (branch: HEAD, revision: b41e0750abf5cc18d8233161560731de05199330)
build user: root@0ebb6827e27f
build date: 20220714-15:13:18
go version: go1.18.4
platform: linux/amd64
Similarly, check the Promtool version with the following command.
promtool --version
Output:
promtool, version 2.37.0 (branch: HEAD, revision: b41e0750abf5cc18d8233161560731de05199330)
build user: root@0ebb6827e27f
build date: 20220714-15:13:18
go version: go1.18.4
platform: linux/amd64
Set Up Authentication
Prometheus can be accessed without a password by default, which poses a significant security risk. So, use the following steps to secure Prometheus with the password.
To generate a safe password, install the Python Bcrypt utility with the following command.
sudo apt install python3-bcrypt gnupg2 -y
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gnupg2 is already the newest version (2.2.27-2+deb11u2).
The following NEW packages will be installed:
python3-bcrypt python3-cffi-backend
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
...
Here you will need to run the Python script to generate the password, so create a Python file.
You can use and communicate with the Prometheus server through the port directly, but it is not secure or practical for the server. So next, you need to set up a reverse proxy for the Prometheus server so that the server does not have to communicate with the users directly.
Install the Nginx Web Server
For that purpose, install the Nginx server using the following command.
sudo apt-get install nginx -y
Output:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
geoip-database libgeoip1 libnginx-mod-http-geoip libnginx-mod-http-image-filter
libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream
libnginx-mod-stream-geoip nginx-common nginx-core
Suggested packages:
geoip-bin fcgiwrap nginx-doc
The following NEW packages will be installed:
geoip-database libgeoip1 libnginx-mod-http-geoip libnginx-mod-http-image-filter
libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream
libnginx-mod-stream-geoip nginx nginx-common nginx-core
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
...
Configure the Nginx Web Server
Once the Nginx package has been installed, use the following command to build an Nginx virtual host configuration file:
How to Install Prometheus Server on Debian 11 Open Source Monitoring Conclusion
In this article, you have learned how to install and configure the Prometheus server for system monitoring in Debian 11. Moreover, how to utilize a reverse proxy as a cover to run the Prometheus server securely.
Prometheus is an open source monitoring and alerting system that collects metrics from various system components.
It provides monitoring and alerting features for cloud-native systems such as Kubernetes. Prometheus gathers and stores measurements as time-series data, collects information with a timestamp and stores labels, which are optional key value pairs, and compiles all this information and presents it in its aggregated form.
Learn more about other system monitoring tools and solutions like this in our monitoring section.
Information Security professional with 4+ years of experience. I am interested in learning about new technologies and loves working with all kinds of infrastructures.
00votes
Article Rating
Subscribe
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.