Prometheus runs on port 9090 by default. This is the port where its web UI, API, and expression browser are served when you start it with the standard configuration. The default listening address is 0.0.0.0:9090, meaning it accepts connections on all network interfaces.
Why Port 9090?
Port 9090 was chosen by the Prometheus project early in its development and has remained the default ever since. It is not a registered IANA port (those are 0–1023 for well-known services, and 1024–49151 for registered ones), so it sits in the dynamic/private range (49152–65535) only if you explicitly assign it there. In practice, 9090 is simply an unassigned port that the project picked to avoid clashing with common services like 8080 (HTTP proxies) or 3000 (Grafana, which often runs alongside Prometheus).
When you install Prometheus via official binaries, the prometheus.yml configuration file does not even specify a port—the default is compiled into the binary. You can override it at runtime with the --web.listen-address flag, for example:
prometheus --web.listen-address=":9091"
That would make Prometheus listen on port 9091 instead. The same flag accepts an IP address, like "192.168.1.10:9090", to bind to a specific interface.
How to Check What Port Prometheus Is Using
If you are unsure which port your running Prometheus instance is on, you have several quick ways to find out:
- Look at the process command line:
ps aux | grep prometheusand check for--web.listen-address. - Check the systemd service file if you installed via a package manager—usually
/etc/systemd/system/prometheus.serviceor/lib/systemd/system/prometheus.service. - Run
ss -tlnp | grep prometheus(Linux) ornetstat -an | findstr 9090(Windows) to see listening ports. - Visit
http://localhost:9090in a browser—if the UI loads, that is the port.
If you are using a reverse proxy (like Nginx or Caddy) in front of Prometheus, the external port may be different (e.g., 80 or 443), but the internal Prometheus process still listens on 9090 unless changed.
What Runs on Port 9090?
Port 9090 serves several functions for a single Prometheus process:
- Web UI – The main dashboard with the expression browser, graph view, and status pages (targets, rules, service discovery).
- HTTP API – The JSON API used by external tools (e.g.,
/api/v1/query). - Metrics endpoint – Prometheus exposes its own internal metrics (like
prometheus_tsdb_head_samples_appended_total) at/metricson the same port, so it can scrape itself. - Admin API – If enabled with
--web.enable-admin-api, endpoints like/api/v1/admin/tsdb/snapshotalso live here.
Note that the port is only for HTTP traffic. Prometheus does not use a separate port for its push gateway or alertmanager—those are different components with their own default ports (9091 for Pushgateway, 9093 for Alertmanager).
How to Change the Port
Changing the port is straightforward, but you must consider a few things:
- Edit the startup command or service file to add
--web.listen-address=":." - Restart the Prometheus service.
- Update any scrapers or dashboards that reference the old port (e.g., Grafana data source URL).
- If you are using a firewall, open the new port and optionally close the old one.
For example, to run Prometheus on port 8080, you would start it with:
prometheus --web.listen-address=":8080"
If you are using Docker, you would map the container port to a host port, such as -p 9090:9090 (host:container). Changing the container’s internal port is less common because you can just remap the host port.
Common Port Conflicts and Troubleshooting
Port 9090 is not used by many other popular applications, but conflicts can still happen. Common causes:
- Another instance of Prometheus is already running.
- A different monitoring tool (like some versions of Cockpit or certain Java apps) uses 9090.
- A firewall or SELinux policy blocks the port.
If you see an error like listen tcp :9090: bind: address already in use, you can find the conflicting process with lsof -i :9090 (Linux/macOS) or netstat -ano | findstr :9090 (Windows). Then either stop that process or choose a different port for Prometheus.
Another common issue is that Prometheus appears to start but you cannot access the UI. Check that the process is listening on the expected interface—if you set --web.listen-address="127.0.0.1:9090", it will only be reachable from the local machine, not from other hosts.
Security Considerations for the Port
By default, Prometheus has no authentication or encryption on port 9090. Anyone who can reach that port can read all metrics and even trigger certain API actions (like snapshots if the admin API is enabled). Therefore, in production:
- Do not expose port 9090 directly to the public internet.
- Place Prometheus behind a reverse proxy with TLS and basic auth, or use a firewall to restrict access to trusted IPs.
- Consider using the
--web.external-urlflag if you serve it under a subpath. - Use the
--web.enable-lifecycleflag only if you need to reload config via HTTP—it can be a security risk if exposed.
Prometheus itself does not support native TLS or authentication (as of version 2.x), so it is common to use a sidecar like nginx or a service mesh to handle that.
Frequently Asked Questions
Is Prometheus port 9090 TCP or UDP?
TCP. Prometheus uses HTTP for both its UI and API, and HTTP runs over TCP. UDP is not used for any of its core functions.
Can I run Prometheus on port 80?
Yes, you can, but you need to run it as root (or use a privileged port capability) because ports below 1024 are restricted on Linux. It is more common to use a reverse proxy on port 80 and forward to 9090.
Does Prometheus use a different port for scraping targets?
No. Prometheus scrapes targets over HTTP, and the port is defined per target in the scrape configuration (e.g., targets: ['localhost:9100']). The default scrape port is whatever the target exposes—there is no fixed port for scraping.
Why does Grafana default to port 3000, not 9090?
Grafana is a separate project that chose 3000 as its default. Prometheus and Grafana are often used together, but they run on different ports by design so they do not conflict. You configure Grafana to connect to Prometheus’s 9090 as a data source.
How do I check if Prometheus is running on port 9090?
Use curl http://localhost:9090/-/healthy—if it returns Prometheus Server is Healthy., it is running. You can also open the web UI in a browser.
What is the difference between port 9090 and 9091?
Port 9091 is the default for the Prometheus Pushgateway, a separate component that allows short-lived jobs to push metrics. Prometheus itself scrapes the Pushgateway on 9091, but the main Prometheus server listens on 9090.
Related
- How Many Histamine Receptors Are There?
- Hestia and Sacred Fire: Greek Goddess of the Hearth
- Cronus Bridge Setup: Complete Guide
How pages are sourced and corrected: Sources and editorial policy.