How to Install Prometheus on Ubuntu 18.04

Simple. Predictable. Scalable.

Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Deploy Your Application
Category: Ubuntu Date: 2023-06-13

Installing Prometheus on Ubuntu 18.04

Prometheus is an open-source monitoring and alerting toolkit. It was originally created at SoundCloud in 2012 and has since gained popularity as a powerful monitoring solution.

Here are the steps to install Prometheus on Ubuntu 18.04:

$ sudo apt update
$ sudo apt install prometheus
$ sudo nano /etc/prometheus/prometheus.yml
$ sudo systemctl start prometheus
$ sudo systemctl enable prometheus
  1. First, update the package list by running the following command.
  2. Then, install Prometheus by executing the command.
  3. After the installation, you need to configure Prometheus. The main configuration file is located at /etc/prometheus/prometheus.yml. Edit the file using your preferred text editor.
  4. In the configuration file, you can specify targets to scrape for metrics. For example, add the following lines to scrape metrics from a web server running on localhost:
    scrape_configs:
      - job_name: 'my_web_server'
        static_configs:
          - targets: ['localhost:9090']
  5. Save the changes and exit the text editor.
  6. Next, start the Prometheus service.
  7. To enable Prometheus to start on system boot, run the enable command.
  8. You can verify that Prometheus is running correctly by accessing its web interface. Open a web browser and navigate to http://localhost:9090.
  9. From the Prometheus web interface, you can explore the available metrics and create custom queries to monitor your systems.

That's it! You have successfully installed Prometheus on Ubuntu 18.04.

Ready to Deploy Prometheus?

Get started in minutes with our one-click deployment

Deploy Now