Port 9200 is the Elasticsearch and OpenSearch REST API, used for indexing, searching and cluster administration. It should not be reachable from the public internet.
- Port
- 9200
- Protocol
- TCP
- Service
- Elasticsearch (HTTP API)
- Expose to internet?
- No
- Also used by
- Elasticsearch, OpenSearch
Is port 9200 safe to open?
Elasticsearch versions before 8.0 had security disabled by default, and exposed clusters have been behind many of the largest data leaks on record. Anyone who reaches an unsecured cluster can read every index and delete them. Version 8 enables authentication and TLS by default, but older and misconfigured clusters remain common.
How to secure Elasticsearch (HTTP API)
- Enable security (
xpack.security.enabled: true) with TLS on the HTTP layer. - Set
network.hostto a private address, not0.0.0.0. - Use role-based users for applications; do not let them use the
elasticsuperuser. - Block 9200 from the internet and access it through Kibana or a proxy.
Check if port 9200 is open
Linux: what is listening on this port
sudo ss -tlpn | grep ':9200 'Windows (PowerShell): what is listening
Get-NetTCPConnection -LocalPort 9200 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}From another machine: is it reachable
nc -zv HOST 9200
# or
nmap -p 9200 HOST
# Windows
Test-NetConnection HOST -Port 9200Test the Elasticsearch (HTTP API) service itself
curl -s http://HOST:9200/Restrict port 9200 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:9200:9200) 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 9200 proto tcp
sudo ufw deny 9200/tcpfirewalld: allow one source network only
sudo firewall-cmd --permanent --remove-port=9200/tcp
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="9200" protocol="tcp" accept'
sudo firewall-cmd --reloadiptables
sudo iptables -A INPUT -p tcp --dport 9200 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 9200 -j DROPWindows Firewall (PowerShell, as Administrator)
New-NetFirewallRule -DisplayName "Block 9200 from internet" -Direction Inbound -Protocol TCP -LocalPort 9200 -RemoteAddress Internet -Action BlockMonitor port 9200
Run a TCP port monitor against your public IP on port 9200: 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 9300 | Elasticsearch (transport) | High risk |
| Port 5601 | Kibana | High risk |
| Port 27017 | MongoDB | Critical risk |
FAQ
Is Elasticsearch secure by default?
From version 8.0, yes: authentication and TLS are enabled during setup. Earlier versions had no authentication unless you configured X-Pack security, so many old clusters are wide open.
What is port 9200 used for?
Port 9200 is the Elasticsearch and OpenSearch REST API, used for indexing, searching and cluster administration. It is also used by Elasticsearch, OpenSearch.
Is it safe to open port 9200?
Not to the public internet. Elasticsearch versions before 8.0 had security disabled by default, and exposed clusters have been behind many of the largest data leaks on record. Anyone who reaches an unsecured cluster can read every index and delete them. Version 8 enables authentication and TLS by default, but older and misconfigured clusters remain common.
Is port 9200 TCP or UDP?
Elasticsearch (HTTP API) uses TCP on port 9200.
How do I check if port 9200 is open?
On the server, run sudo ss -tulpn | grep ':9200 ' (Linux) or Get-NetTCPConnection -LocalPort 9200 (Windows) to see what is listening. From another machine, run nc -zv HOST 9200 or Test-NetConnection HOST -Port 9200.
Know the moment a port stops answering.
TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.