Port 9090 — Prometheus & Cockpit
Port 9090 is shared by two entirely unrelated tools: Prometheus (the industry-standard metrics monitoring system) and Cockpit (a browser-based Linux server management panel). You'd rarely run both on the same machine — Prometheus is for DevOps infrastructure monitoring, Cockpit for sysadmins managing Linux servers. But knowing which one you have is step one when you hit localhost:9090.
Prometheus on Port 9090
Prometheus is a time-series metrics database and monitoring system. It works by pulling (scraping) metrics from instrumented applications and infrastructure exporters at regular intervals, then storing them for querying and alerting. Port 9090 is Prometheus's own web interface and API — the same port you'd use to run PromQL queries directly, check scrape target health, and view alerting rules.
In a typical monitoring stack, Prometheus runs at 9090 and Grafana at 3000 — Grafana connects to Prometheus as a data source and renders the dashboards, while Prometheus does the data collection and storage.
Prometheus Install and Config
# Docker
docker run -d \
--name prometheus \
-p 9090:9090 \
-v ./prometheus.yml:/etc/prometheus/prometheus.yml \
-v prom_data:/prometheus \
prom/prometheus
# prometheus.yml — minimal config
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'prometheus' # Prometheus scrapes itself
static_configs:
- targets: ['localhost:9090']
- job_name: 'node' # Linux host metrics
static_configs:
- targets: ['node-exporter:9100']
- job_name: 'my-app' # Custom application
static_configs:
- targets: ['app:8080']
metrics_path: '/metrics'
PromQL — Querying Metrics
PromQL (Prometheus Query Language) is how you query collected metrics. At localhost:9090, the Graph tab gives a PromQL query interface. Common queries:
# CPU usage percentage (all cores, last 5 min)
100 - (avg by(instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)
# HTTP request rate per second
rate(http_requests_total[1m])
# Memory available in GB
node_memory_MemAvailable_bytes / 1024^3
# 95th percentile request duration
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))
Common Prometheus Exporters and Their Ports
| Exporter | Port | Metrics |
|---|---|---|
| node_exporter | 9100 | Linux CPU, memory, disk, network |
| cAdvisor | 8080 | Docker container metrics |
| blackbox_exporter | 9115 | HTTP, TCP, DNS probe checks |
| mysqld_exporter | 9104 | MySQL query and connection stats |
| postgres_exporter | 9187 | PostgreSQL metrics |
| redis_exporter | 9121 | Redis memory and commands |
Cockpit on Port 9090
Cockpit is a web-based Linux server management console included by default in RHEL, Fedora, CentOS Stream, and available on Ubuntu. It provides a browser interface for server tasks: service management (start/stop systemd units), log viewing, storage and networking configuration, terminal access, software updates, and container management. Unlike Prometheus, Cockpit uses HTTPS on port 9090 and requires Linux system user credentials to log in.
# Enable and start Cockpit (RHEL/Fedora/CentOS)
sudo systemctl enable --now cockpit.socket
# Install on Ubuntu/Debian
sudo apt install cockpit
sudo systemctl enable --now cockpit.socket
# Access at:
# https://[server-ip]:9090
# Login with your Linux user account (e.g., root or sudo-capable user)
Cockpit is particularly useful on headless servers — instead of SSH + memorizing commands, you get a browser GUI for common maintenance tasks. The terminal tab gives a full shell when you need it.
Resolving Prometheus / Cockpit Conflict
If you need both on the same server, change one of them. Change Prometheus's port with the --web.listen-address flag:
# Prometheus on 9091 instead
docker run -d -p 9091:9090 prom/prometheus \
--config.file=/etc/prometheus/prometheus.yml \
--web.listen-address=:9090
Or change Cockpit's port in /etc/cockpit/cockpit.conf:
[WebService]
Port = 9091
Troubleshooting
| Problem | Fix |
|---|---|
| Prometheus targets showing "DOWN" | Check the exporter is running, the port is correct, and no firewall blocks it |
| PromQL returns no data | Check scrape interval and lookback window — rate(metric[5m]) needs at least 5 minutes of data |
| Cockpit HTTPS cert warning | Expected — Cockpit uses a self-signed cert by default. Install a real cert via cockpit-certificates package. |
| Port 9090 conflict | sudo lsof -i :9090 to identify which process is running — then change one service's port |