How to Install Prometheus on Manjaro

Prometheus is an open-source monitoring system that is used to collect and store metrics from various sources. In this tutorial, we will guide you through the process of installing Prometheus on Manjaro.

Prerequisites

Before we start with the installation, you need to make sure that your system meets the following requirements:

Step 1: Install Prometheus

To install Prometheus, follow the steps below:

  1. Go to the Prometheus website and select the version you want to download.

  2. Download the binary file prometheus-<version>.linux-amd64.tar.gz corresponding to your Manjaro system’s architecture (32-bit or 64-bit).

  3. Extract the contents of the downloaded archive file with the following command:

    tar -xvf prometheus-<version>.tar.gz
    
  4. After extracting the files, you will see a directory named prometheus-<version>.linux-amd64 containing the Prometheus binaries.

  5. Move this directory to the installation path /usr/local/bin/prometheus with the following command:

    sudo mv prometheus-<version>.linux-amd64 /usr/local/bin/prometheus
    

    This command will move the Prometheus binaries to the /usr/local/bin/prometheus directory, which is commonly used as the installation directory for Prometheus.

Step 2: Configure Prometheus

Now that you have installed Prometheus on your Manjaro system, you need to create a configuration file for it.

  1. Open a text editor and create a new file named prometheus.yml.

  2. Copy the following configuration and paste it into the prometheus.yml file:

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

    This configuration tells Prometheus to scrape data from itself (on localhost:9090) every 5 seconds.

  3. Save and close the file.

Step 3: Run Prometheus

To run Prometheus, follow the steps below:

  1. Open a terminal window and navigate to the /usr/local/bin/prometheus directory with the following command:

    cd /usr/local/bin/prometheus
    
  2. Start Prometheus with the following command:

    ./prometheus
    

    This command will start Prometheus and load the configuration file you created in the previous step.

  3. Open a web browser and go to http://localhost:9090.

    This will open the Prometheus web interface, where you can view and explore the metrics collected by Prometheus.

Congratulations! You have successfully installed Prometheus on your Manjaro system. You can now configure Prometheus to collect metrics from other endpoints and set up monitoring for your systems.

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!