A complete guide to installing and configuring Prometheus Monitoring System on Ubuntu Server (amd64).
- Introduction
- Key Features
- Architecture
- Prometheus Components
- Data Flow
- Installation Guide
- Access Prometheus UI
- Verify Metrics
- Default Ports
- Production Architecture
- Use Cases
- Summary
Prometheus is an open-source monitoring and alerting toolkit originally developed by SoundCloud.
It is widely used for monitoring:
- Servers
- Applications
- Containers
- Kubernetes
- Cloud Infrastructure
Prometheus collects metrics from configured targets at regular intervals, stores them as time-series data, and allows users to query them using:
Prometheus is commonly integrated with:
- Grafana → Visualization
- Alertmanager → Alerts & Notifications
✅ Time-series metrics storage
✅ Powerful query language (PromQL)
✅ Built-in alerting system
✅ Pull-based metrics collection
✅ Service discovery support
✅ Multi-dimensional data model (labels)
✅ Kubernetes integration
✅ Linux/Windows monitoring support
Prometheus follows a pull-based monitoring architecture.
+----------------------+
| Applications |
| (Node Exporter, App) |
+----------+-----------+
|
| HTTP Metrics
v
+---------------+
| Prometheus |
| Server |
|---------------|
| Scraping |
| TSDB Storage |
| Query Engine |
+-------+-------+
|
+--------------+--------------+
| |
v v
+--------------+ +----------------+
| Alertmanager | | Grafana |
| Alert Engine | | Visualization |
+--------------+ +----------------+
Core component responsible for:
- Scraping metrics
- Storing time-series data
- Running queries
- Triggering alerts
Exporters expose system/application metrics.
- Node Exporter → Linux metrics
- Windows Exporter → Windows metrics
- MySQL Exporter
- Nginx Exporter
Example:
http://<server-ip>:9100/metricsHandles alerts generated by Prometheus.
- Alert deduplication
- Alert grouping
- Silence management
- Notification routing
- Slack
- PagerDuty
- Webhooks
Grafana visualizes Prometheus metrics through dashboards.
Example dashboards:
- CPU Usage
- Memory Usage
- Disk IO
- Network Traffic
Exporter → Prometheus → Storage → Query → Grafana Dashboard
↓
Alertmanager
sudo apt update && sudo apt upgrade -ysudo useradd --no-create-home --shell /bin/false prometheussudo mkdir /etc/prometheus
sudo mkdir /var/lib/prometheusSet permissions:
sudo chown prometheus:prometheus /etc/prometheus
sudo chown prometheus:prometheus /var/lib/prometheuscd /tmp
wget https://github.com/prometheus/prometheus/releases/download/v3.9.1/prometheus-3.9.1.linux-amd64.tar.gzExtract files:
tar xvf prometheus-3.9.1.linux-amd64.tar.gz
cd prometheus-3.9.1.linux-amd64sudo cp prometheus /usr/local/bin/
sudo cp promtool /usr/local/bin/Set ownership:
sudo chown prometheus:prometheus /usr/local/bin/prometheus
sudo chown prometheus:prometheus /usr/local/bin/promtoolsudo cp -r consoles /etc/prometheus
sudo cp -r console_libraries /etc/prometheus
sudo cp prometheus.yml /etc/prometheusSet permissions:
sudo chown -R prometheus:prometheus /etc/prometheusCreate service file:
sudo nano /etc/systemd/system/prometheus.serviceAdd the following configuration:
[Unit]
Description=Prometheus Monitoring Service
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
WorkingDirectory=/var/lib/prometheus
ExecStart=/usr/local/bin/prometheus \
--config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/var/lib/prometheus \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries
Restart=always
LimitNOFILE=65536
[Install]
WantedBy=multi-user.targetReload systemd:
sudo systemctl daemon-reloadEnable service:
sudo systemctl enable prometheusStart service:
sudo systemctl start prometheusCheck service status:
sudo systemctl status prometheusOpen your browser:
http://SERVER-IP:9090Prometheus dashboard should load successfully.
Run the following query in Prometheus UI:
upExpected result:
up = 1This means the target is healthy.
| Service | Port |
|---|---|
| Prometheus | 9090 |
| Node Exporter | 9100 |
| Alertmanager | 9093 |
| Grafana | 3000 |
Servers → Node Exporter
↓
Prometheus
↓
Alertmanager
↓
Grafana
Prometheus is commonly used for:
- Infrastructure Monitoring
- Kubernetes Monitoring
- Application Performance Monitoring
- DevOps Observability
- SRE Monitoring
- Security Monitoring Integration
Prometheus is a powerful open-source monitoring solution built for:
- Reliability
- Scalability
- Real-time monitoring
- Alerting
- Observability
When combined with Grafana and Alertmanager, it becomes a complete monitoring stack for modern infrastructure.
Feel free to fork this repository and submit pull requests.
This project is licensed under the MIT License.