Toolman

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.

PortProtocolNameWhat it is for
389TCPLDAPDirectory services — user and group lookups, including Active Directory.
636TCPLDAPSLDAP 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

Port 389 in full · Port 636 in full · Every service · All port numbers