Skip to content
statance
MenuClose
← All ports

Port 9090: Prometheus / Cockpit

Medium risk

Port 9090 is the Prometheus server’s web UI and API. Cockpit, the Linux web console on RHEL, Fedora and others, also uses 9090. It should not be reachable from the public internet.

Port
9090
Protocol
TCP
Service
Prometheus / Cockpit
Expose to internet?
No
Also used by
Prometheus, Cockpit web console, Openfire admin

Is port 9090 safe to open?

Prometheus has no authentication by default, so an exposed server reveals every scrape target, internal hostname, label and metric, which is a detailed map of your infrastructure. The admin API, if enabled, can delete data. Cockpit requires a system login but gives a full terminal and admin access once signed in.

How to secure Prometheus / Cockpit

  • Keep Prometheus on a private network, or put it behind a proxy with authentication and TLS.
  • Use Prometheus’s --web.config.file to enable basic auth and TLS.
  • Do not enable --web.enable-admin-api unless you need it.
  • Restrict Cockpit to admin networks with the firewall (firewall-cmd --remove-service=cockpit on public zones).

Check if port 9090 is open

Linux: what is listening on this port

sudo ss -tlpn | grep ':9090 '

Windows (PowerShell): what is listening

Get-NetTCPConnection -LocalPort 9090 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}

From another machine: is it reachable

nc -zv HOST 9090 # or nmap -p 9090 HOST # Windows Test-NetConnection HOST -Port 9090

Test the Prometheus / Cockpit service itself

curl -s http://HOST:9090/-/healthy

Restrict port 9090 in the firewall

Replace 10.0.0.0/8 with the network or address that needs access. Docker publishes container ports through its own iptables rules, which bypass ufw; bind published ports to 127.0.0.1 (-p 127.0.0.1:9090:9090) instead of relying on the host firewall.

ufw: allow only your private network, deny everyone else

sudo ufw allow from 10.0.0.0/8 to any port 9090 proto tcp sudo ufw deny 9090/tcp

firewalld: allow one source network only

sudo firewall-cmd --permanent --remove-port=9090/tcp sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="9090" protocol="tcp" accept' sudo firewall-cmd --reload

iptables

sudo iptables -A INPUT -p tcp --dport 9090 -s 10.0.0.0/8 -j ACCEPT sudo iptables -A INPUT -p tcp --dport 9090 -j DROP

Windows Firewall (PowerShell, as Administrator)

New-NetFirewallRule -DisplayName "Block 9090 from internet" -Direction Inbound -Protocol TCP -LocalPort 9090 -RemoteAddress Internet -Action Block

Monitor port 9090

Run a TCP port monitor against your public IP on port 9090: here, a failed connection is the healthy result, so you know the firewall is still doing its job. On Linux, the Statance agent also reports every listening port on the server. TCP port monitoring.

Related ports

Port 9100Prometheus node_exporter / JetDirect printingMedium risk
Port 3000Grafana / Node.js development serversMedium risk
Port 19999Netdata dashboardMedium risk

FAQ

What is port 9090 used for?

Port 9090 is the Prometheus server’s web UI and API. Cockpit, the Linux web console on RHEL, Fedora and others, also uses 9090. It is also used by Prometheus, Cockpit web console, Openfire admin.

Is it safe to open port 9090?

Not to the public internet. Prometheus has no authentication by default, so an exposed server reveals every scrape target, internal hostname, label and metric, which is a detailed map of your infrastructure. The admin API, if enabled, can delete data. Cockpit requires a system login but gives a full terminal and admin access once signed in.

Is port 9090 TCP or UDP?

Prometheus / Cockpit uses TCP on port 9090.

How do I check if port 9090 is open?

On the server, run sudo ss -tulpn | grep ':9090 ' (Linux) or Get-NetTCPConnection -LocalPort 9090 (Windows) to see what is listening. From another machine, run nc -zv HOST 9090 or Test-NetConnection HOST -Port 9090.

All ports →

Know the moment a port stops answering.

TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.