Port 5984 is the CouchDB HTTP API, used for both data access and administration (the Fauxton web UI at /_utils). It should not be reachable from the public internet.
- Port
- 5984
- Protocol
- TCP
- Service
- Apache CouchDB
- Expose to internet?
- No
Is port 5984 safe to open?
CouchDB releases before 3.0 started in “admin party” mode, where anyone could do anything until an admin was created. Exposed CouchDB instances have leaked data and been exploited to run commands. CouchDB 3 requires an admin account but is still a database and should not face the internet.
How to secure Apache CouchDB
- Run CouchDB 3.x or later and make sure an admin user exists.
- Bind to localhost (
bind_address = 127.0.0.1in local.ini) and proxy with TLS if remote access is needed. - Set
require_valid_user = trueso anonymous reads are refused.
Check if port 5984 is open
Linux: what is listening on this port
sudo ss -tlpn | grep ':5984 'Windows (PowerShell): what is listening
Get-NetTCPConnection -LocalPort 5984 -State Listen | Select-Object LocalAddress, OwningProcess, @{n='Process';e={(Get-Process -Id $_.OwningProcess).Name}}From another machine: is it reachable
nc -zv HOST 5984
# or
nmap -p 5984 HOST
# Windows
Test-NetConnection HOST -Port 5984Test the Apache CouchDB service itself
curl -s http://HOST:5984/Restrict port 5984 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:5984:5984) 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 5984 proto tcp
sudo ufw deny 5984/tcpfirewalld: allow one source network only
sudo firewall-cmd --permanent --remove-port=5984/tcp
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.0/8" port port="5984" protocol="tcp" accept'
sudo firewall-cmd --reloadiptables
sudo iptables -A INPUT -p tcp --dport 5984 -s 10.0.0.0/8 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 5984 -j DROPWindows Firewall (PowerShell, as Administrator)
New-NetFirewallRule -DisplayName "Block 5984 from internet" -Direction Inbound -Protocol TCP -LocalPort 5984 -RemoteAddress Internet -Action BlockMonitor port 5984
Run a TCP port monitor against your public IP on port 5984: 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 27017 | MongoDB | Critical risk |
| Port 4369 | Erlang Port Mapper Daemon (epmd) | High risk |
| Port 9200 | Elasticsearch (HTTP API) | Critical risk |
FAQ
What is port 5984 used for?
Port 5984 is the CouchDB HTTP API, used for both data access and administration (the Fauxton web UI at /_utils).
Is it safe to open port 5984?
Not to the public internet. CouchDB releases before 3.0 started in “admin party” mode, where anyone could do anything until an admin was created. Exposed CouchDB instances have leaked data and been exploited to run commands. CouchDB 3 requires an admin account but is still a database and should not face the internet.
Is port 5984 TCP or UDP?
Apache CouchDB uses TCP on port 5984.
How do I check if port 5984 is open?
On the server, run sudo ss -tulpn | grep ':5984 ' (Linux) or Get-NetTCPConnection -LocalPort 5984 (Windows) to see what is listening. From another machine, run nc -zv HOST 5984 or Test-NetConnection HOST -Port 5984.
Know the moment a port stops answering.
TCP, HTTP, DNS and SSL checks from six regions, plus server metrics from a one-line agent.