HTTPfy

Port 2181 (Apache ZooKeeper)

ZooKeeper client port, historically required by Kafka, HBase, Solr and Hadoop.

Registered (user) port, 1024-49151 TCP Message queues Do not expose to the internet

What port 2181 is used for

ZooKeeper client port, historically required by Kafka, HBase, Solr and Hadoop.

Security: should port 2181 be open?

Do not expose to the internet. Never expose: by default ZooKeeper allows unauthenticated reads and writes of cluster metadata, and the four-letter commands leak details.

IANA assignment

Service nameProtoDescriptionAssigneeReference
eforward TCP eforward Greg Pringle -
eforward UDP eforward Greg Pringle -

Check what is listening on port 2181

Linux: is anything listening on TCP 2181?
sudo ss -tlnp 'sport = :2181'
Linux / macOS: which process owns the port
sudo lsof -nP -i :2181
Older Linux / BSD (net-tools)
sudo netstat -tlnp | grep ':2181 '
Windows (Command Prompt)
netstat -ano | findstr :2181
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 2181 -State Listen | Select LocalAddress,OwningProcess

Test it from outside

From another machine
nc -vz -w 5 HOST 2181
From Windows
Test-NetConnection HOST -Port 2181

Block port 2181 in the firewall

ufw
sudo ufw deny 2181/tcp
iptables
sudo iptables -A INPUT -p tcp --dport 2181 -j DROP
nftables
sudo nft add rule inet filter input tcp dport 2181 drop
Windows Firewall
New-NetFirewallRule -DisplayName 'Block TCP 2181' -Direction Inbound -Protocol TCP -LocalPort 2181 -Action Block

Related ports

All port numbers · Open port checker
Assignment data: IANA port number registry (public domain), retrieved 2026-11-10.