How to Install Prometheus on Elementary OS Latest

Prometheus is a popular monitoring system used for monitoring and alerting. In this tutorial, we will be walking you through the steps to install Prometheus on Elementary OS Latest.

Prerequisites

Before we begin, make sure that you have the following:

Step 1 - Update the System

Before we can proceed with the installation of Prometheus, it is recommended that you update your system. You can do this by running the following command.

sudo apt update && sudo apt upgrade -y

Step 2 - Install Prometheus

To install Prometheus, follow the steps below:

  1. Download the latest Prometheus binary from the official website. You can do this by running the following command.

    wget https://github.com/prometheus/prometheus/releases/download/v2.30.1/prometheus-2.30.1.linux-amd64.tar.gz
    

    Note: Replace the URL with the latest version of Prometheus available.

  2. Extract the downloaded archive by running the following command.

    tar -xvf prometheus-2.30.1.linux-amd64.tar.gz
    

    Note: Replace the version number with the version you have downloaded.

  3. Move the extracted directory to /opt directory.

    sudo mv prometheus-2.30.1.linux-amd64 /opt/prometheus
    
  4. Create a Prometheus system user by running the following command.

    sudo useradd -rs /bin/false prometheus
    
  5. Change ownership of Prometheus directories to Prometheus user.

    sudo chown -R prometheus:prometheus /opt/prometheus
    
  6. Create a Prometheus systemd service file.

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

    Paste the following contents into the file.

    [Unit]
    Description=Prometheus
    Wants=network-online.target
    After=network-online.target
    
    [Service]
    User=prometheus
    Group=prometheus
    Type=simple
    ExecStart=/opt/prometheus/prometheus
    Restart=always
    
    [Install]
    WantedBy=multi-user.target
    
  7. Reload systemd services.

    sudo systemctl daemon-reload
    
  8. Enable Prometheus service.

    sudo systemctl enable prometheus.service
    
  9. Start the Prometheus service.

    sudo systemctl start prometheus.service
    
  10. Verify that Prometheus is running by accessing the web interface at http://localhost:9090/

Conclusion

You have successfully installed Prometheus on Elementary OS Latest. You can now use the monitoring tool to monitor and alert on your system.

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!