Access
- Open
https://<SERVER_IP>:9090in your browser. - The certificate is self-signed, so your browser will display a certificate warning.
- The Prometheus targets page is available at
https://<SERVER_IP>:9090/targets. - Metrics are available at
https://<SERVER_IP>:9090/metrics.
Login
Prometheus is protected with HTTP Basic Authentication.
- Username:
admin - Password: stored in
/root/.prometheus-credentials
The same authentication protects the web UI, API, and /metrics endpoint.
Important Files & Directories
- Prometheus Config:
/etc/prometheus/prometheus.yml - Web/TLS/Auth Config:
/etc/prometheus/web-config.yml - TLS Certificates:
/etc/prometheus/tls/ - Prometheus Data:
/var/lib/prometheus - Node Exporter Textfile Collector:
/var/lib/node_exporter/textfile_collector - Credentials:
/root/.prometheus-credentials - Prometheus Binary:
/usr/local/bin/prometheus - Promtool:
/usr/local/bin/promtool - Node Exporter Binary:
/usr/local/bin/node_exporter - Prometheus Service:
/etc/systemd/system/prometheus.service - Node Exporter Service:
/etc/systemd/system/node_exporter.service
Service Management
Check Prometheus:
systemctl status prometheus
Restart Prometheus:
systemctl restart prometheus
View Prometheus logs:
journalctl -u prometheus -f
Check Node Exporter:
systemctl status node_exporter
Restart Node Exporter:
systemctl restart node_exporter
View Node Exporter logs:
journalctl -u node_exporter -f
Adding Targets
Edit /etc/prometheus/prometheus.yml:
vim /etc/prometheus/prometheus.yml
Validate the configuration:
promtool check config /etc/prometheus/prometheus.yml
Reload Prometheus:
curl -sS --cacert /etc/prometheus/tls/prometheus.crt \
-u admin:<PASSWORD> \
-X POST https://localhost:9090/-/reload
Retention
Prometheus is configured with:
- Retention time:
30d - Maximum storage size:
10GB
Whichever limit is reached first is applied.
Notes
- Grafana and Alertmanager are not installed. They can be added separately and connected to this Prometheus instance.
- Metrics are retained for up to 30 days or 10 GB, whichever limit is reached first.
- Custom host metrics can be added as
.promfiles under:/var/lib/node_exporter/textfile_collector