Here are the steps to install Prometheus on Ubuntu:
Update your package list:
sudo apt update
Download the Prometheus configuration file:
wget https://raw.githubusercontent.com/prometheus/prometheus/main/documentation/examples/prometheus.yml sudo apt update
Install Prometheus using docker:
docker run -d --name=prometheus -p 9090:9090 -v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus --config.file=/etc/prometheus/prometheus.yml
Now that the docker is up and running, You can access Prometheus via your web browser by going to
http://localhost:9090
.
That's it! You now have Prometheus up and running on your Ubuntu system, ready to monitor your services and infrastructure.
Note
Incase of EC2 instance, remember to properly secure your EC2 instance by configuring security groups(i.e. 9090) and limiting access to necessary ports
Conclusion:
In summary, Prometheus is a powerful way to monitor your infrastructure. By following the steps outlined here, you can set up Prometheus, gain valuable insights, and ensure the reliability of your services.
Hope you like my post. Don't forget to like, comment, and share.