Install prometheus on centos7/rhel7

  1. Download prometheus monitoring tool. Latest downloads can be found at

    curl -LO “”

  2.  Untar the  file and move it to installation folder

    tar -xzvf prometheus-1.7.1.linux-amd64.tar.gz

  3. Move it to installation folder , here I am moving it to /var/lib

    mv prometheus-1.7.1.linux-amd64 /var/lib/prometheus

  4.  Edit the prometheus.yml file and update the scrape config– job_name: ‘server_monitoring’   scrape_interval: 15s   metrics_path: “/metrics”   static_configs:

        – targets:

            – server1:9100

            – server2:9100

            – server3:9100


            service: servers_usage


       – source_labels: [__address__]

         regex: ‘(.*)\:9108’

         target_label:  ‘instance’

         replacement:   ‘$1’

  5.  Add the start script in /etc/systemd/system/prometheus.service
    # echo “[Unit]
    Description=Prometheus Server
    ExecStart=/var/lib/prometheus/prometheus -config.file=/var/lib/prometheus/prometheus.yml -storage.local.path=/var/lib/prometheus/data[Install]”
  6. Start the prometheus service

    systemctl start prometheus

  7. Prometheus can now be accessible from http://<ip-address:9090