What port does LDAP use?
LDAP uses 389 and 636, and which one depends on what you are doing.
Directory lookups, plain and over TLS. The plain port carries bind credentials in clear text.
| Port | Protocol | Name | What it is for |
|---|---|---|---|
| 389 | TCP | LDAP | Directory services — user and group lookups, including Active Directory. |
| 636 | TCP | LDAPS | LDAP over TLS. |
Exposing it
Unencrypted. Use LDAPS on 636 or StartTLS, otherwise credentials are readable on the wire.
Checking it is listening
sudo lsof -i :389 # macOS, Linux
netstat -ano | findstr :389 # Windows
nc -zv host 389 # from elsewhere
An "address already in use" error on a port nothing appears to be holding usually means the socket is in TIME_WAIT rather than that a process has it — the ports reference covers that and the ephemeral range.
Frequently asked questions
What port does LDAP use?
LDAP uses ports 389, 636, and they do different jobs. 389: Directory services — user and group lookups, including Active Directory. 636: LDAP over TLS.
Is port 389 safe to expose to the internet?
Unencrypted. Use LDAPS on 636 or StartTLS, otherwise credentials are readable on the wire.
How do I check whether LDAP is listening?
sudo lsof -i :389 on macOS or Linux, netstat -ano | findstr :389 on Windows. From another machine, nc -zv host 389 says whether anything answers.
Other services
- What port does HTTP use?
- What port does HTTPS use?
- What port does FTP use?
- What port does DHCP use?
- What port does Docker use?
- What port does MQTT use?
- What port does SSH use?
- What port does RDP use?
- What port does MySQL use?
- What port does PostgreSQL use?
- What port does SQL Server use?
- What port does Oracle use?
Port 389 in full · Port 636 in full · Every service · All port numbers