Port 2181: Apache ZooKeeper

Port 2181 (TCP) is used by Apache ZooKeeper. Client port for ZooKeeper coordination service (unofficial use).

2181Port
TCPProtocol
eforwardIANA service name
DatabasesCategory

Port range

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

Security

Port 2181 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 2181 in a firewall

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

Check if port 2181 is open

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

Other databases ports

Frequently asked questions

What is port 2181 used for?
Apache ZooKeeper. Client port for ZooKeeper coordination service (unofficial use).
Is port 2181 TCP or UDP?
TCP.