Prometheus is an open-source monitoring system that collects and stores metrics information from various resources like servers, applications, and microservices. Installing Prometheus on Debian is a straightforward process that requires following a few simple steps.
In this tutorial, we will cover how to install Prometheus on Debian latest version.
Before we begin, make sure your system meets the following prerequisites:
Update the installed packages and repositories on your Debian system by running the following command:
sudo apt-get update
wget https://github.com/prometheus/prometheus/releases/download/v2.30.3/prometheus-2.30.3.linux-amd64.tar.gz
tar xvf prometheus-2.30.3.linux-amd64.tar.gz
sudo mv prometheus-2.30.3.linux-amd64 /opt/prometheus
sudo groupadd --system prometheus
sudo useradd -s /sbin/nologin --system -g prometheus prometheus
sudo chown -R prometheus:prometheus /opt/prometheus/
nano /opt/prometheus/prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
Save and close the configuration file.
Create a systemd service file for Prometheus using the following command:
sudo nano /etc/systemd/system/prometheus.service
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.path=/opt/prometheus/data
[Install]
WantedBy=multi-user.target
Save and close the file.
Reload the systemd daemon and start the Prometheus service using the following command:
sudo systemctl daemon-reload
sudo systemctl enable --now prometheus
Prometheus UI can be accessed on the web browser by accessing the following URL:
http://<your-server-IP>:9090/
Congratulations! You have successfully installed Prometheus on your Debian system. You can now use Prometheus to collect, store and analyze metrics information from various sources.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!