Skip to content
statance
MenuClose
← All ports

Port 9300: Elasticsearch (transport)

High risk

Port 9300 is the Elasticsearch transport protocol, used for communication between nodes in a cluster. It should not be reachable from the public internet.

Port
9300
Protocol
TCP
Service
Elasticsearch (transport)
Expose to internet?
No
Also used by
Elasticsearch, OpenSearch

Is port 9300 safe to open?

Only other cluster nodes need to reach 9300. If transport TLS is not enforced, a machine that can connect may be able to join the cluster or interfere with it. It has no reason to be visible outside the cluster network.

How to secure Elasticsearch (transport)

  • Enable transport TLS (xpack.security.transport.ssl.enabled: true), which security requires anyway.
  • Bind transport to the private cluster network (transport.host).
  • Allow 9300 only between cluster members.

Check if port 9300 is open

Linux: what is listening on this port

sudo ss -tlpn | grep ':9300 '

Windows (PowerShell): what is listening

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

From another machine: is it reachable

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

Restrict port 9300 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:9300:9300) 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 9300 proto tcp sudo ufw deny 9300/tcp

firewalld: allow one source network only

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

iptables

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

Windows Firewall (PowerShell, as Administrator)

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

Monitor port 9300

Run a TCP port monitor against your public IP on port 9300: 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 9200Elasticsearch (HTTP API)Critical risk
Port 5601KibanaHigh risk

FAQ

What is port 9300 used for?

Port 9300 is the Elasticsearch transport protocol, used for communication between nodes in a cluster. It is also used by Elasticsearch, OpenSearch.

Is it safe to open port 9300?

Not to the public internet. Only other cluster nodes need to reach 9300. If transport TLS is not enforced, a machine that can connect may be able to join the cluster or interfere with it. It has no reason to be visible outside the cluster network.

Is port 9300 TCP or UDP?

Elasticsearch (transport) uses TCP on port 9300.

How do I check if port 9300 is open?

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

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.