

Prometheus and Grafana together form a complete monitoring stack for your server. Prometheus collects and stores metrics, while Grafana visualizes that data in customizable dashboards.
Create a directory for your monitoring stack and a subdirectory for the Prometheus configuration:
Now create the Prometheus configuration file:
Paste the following base configuration. It instructs Prometheus to monitor itself and the Node Exporter, which we will set up in the next step:
In the root of your monitoring-stack directory, create the Compose file:
Paste the following content. The file defines three services: Prometheus for metric collection, Grafana for visualization, and Node Exporter which exposes your server's metrics:
Start all three containers with a single command:
Docker will pull the images and start Prometheus, Grafana, and Node Exporter in the background.
Open your browser and navigate to http://YOUR_SERVER_IP:3000. Log in with the default credentials — username admin, password admin. You will be prompted to set a new password immediately.
http://prometheus:9090 as the Prometheus server URLImport a pre-built dashboard to start visualizing your server metrics right away:
1860 — a widely used dashboard for server monitoringFor advanced configurations, custom dashboards, and alerting setup, refer to the official documentation for each tool.