Skip to content

Install Prometheus Service and Data Source

Video Lecture

Install Prometheus Service and Data Source Install Prometheus Service and Data Source

Description

Prometheus is already available on the default Ubuntu 24.04 repositories. So we can just install it, and it will be set up as a service already.

#
apt install prometheus

It has installed two services named prometheus and prometheus-node-exporter. We can check them using

#
service prometheus status

and

#
service prometheus-node-exporter status

Press ctrl-c to exit each of the above status commands.

We can test the Prometheus metrics endpoint is running locally by using the command

curl http://127.0.0.1:9090/metrics

After installing Prometheus, it is also likely to have,

  • installed a local Prometheus Node Exporter,
  • created and started 2 services to manage Prometheus and the Node Exporter,
  • created a specific user called prometheus that both services are running under.

You can check the prometheus user using the command

#
id prometheus

You can check which processes it is running by using the command

#
ps -u prometheus

You can see which ports each process is listening on by using the command

#
ss -ntlp | grep prometheus

The Prometheus Node Exporter also creates a metrics HTTP endpoint on port 9100. You can check it locally using

#
curl http://127.0.0.1:9100/metrics

Note

If your server is on the public internet, and you haven't configured a dedicated firewall, both Prometheus and the Node Exporter endpoints may be accessible using the URLs,

http://[your domain or IP]:9090/ http://[your domain or IP]:9100/

You should consider restricting access to those port numbers to only IP addresses that need to access them.

Prometheus Course

If you want to try a more detailed course on Prometheus, then you can visit my Prometheus tutorials.

Comments