What is port 389 used for?
Lightweight Directory Access Protocol: directory lookups, including Active Directory.
Should port 389 be open?
Don’t expose to the internet. Keep this port on private networks and reach it through a VPN or SSH tunnel. Directory servers belong on internal networks. Use LDAPS (636) or StartTLS for encryption.
See what is listening on port 389
# Linux
sudo ss -tlnp | grep ':389 '
# macOS
sudo lsof -nP -i TCP:389 -sTCP:LISTEN
# Windows (PowerShell)
Get-NetTCPConnection -LocalPort 389 -State Listen
Open or block port 389 in a firewall
# Ubuntu / Debian (ufw)
sudo ufw allow 389
sudo ufw deny 389
# Windows (PowerShell, as administrator)
New-NetFirewallRule -DisplayName "Port 389" -Direction Inbound -Protocol TCP -LocalPort 389 -Action Allow
On cloud servers, also open the port in the provider’s security group or network firewall. At home, a service behind a router needs a port-forwarding rule to the device’s local IP.
Test it from outside
A port can be open on the server but blocked upstream. The Port Checker connects from the internet, so it shows what the world sees. From your own machine, use nc -vz example.com 389 (macOS/Linux) or Test-NetConnection example.com -Port 389 (Windows).