Port 9042: Cassandra CQL

Port 9042 (TCP) is used by Cassandra CQL. Cassandra client (CQL native) port (unofficial use).

9042Port
TCPProtocol
dsfIANA service name
DatabasesCategory

Port range

9042 is a registered port (range 1024–49151). Any user can bind to it; IANA records which service registered the number.

Security

Port 9042 should not be reachable from the public internet. Restrict it to trusted networks or a VPN, and scan your public IP to confirm it is closed.

Open port 9042 in a firewall

ufw         sudo ufw allow 9042/tcp
iptables    sudo iptables -A INPUT -p tcp --dport 9042 -j ACCEPT
firewalld   sudo firewall-cmd --permanent --add-port=9042/tcp
Windows     New-NetFirewallRule -DisplayName "Cassandra CQL 9042" -Direction Inbound -Protocol TCP -LocalPort 9042 -Action Allow

Check if port 9042 is open

nc -vz example.com 9042
Test-NetConnection example.com -Port 9042   # PowerShell
sudo ss -tulpn | grep ':9042 '   # what is listening locally (Linux)

Other databases ports

Frequently asked questions

What is port 9042 used for?
Cassandra CQL. Cassandra client (CQL native) port (unofficial use).
Is port 9042 TCP or UDP?
TCP.