/homelab-ldap

OpenLDAP server with built-in phpLDAPadmin

Primary LanguageShellMIT LicenseMIT

QA Build Status Docker Hub Build Status Docker Image Version MIT License

OpenLDAP server with built-in phpLDAPadmin

This container is far from perfect and set only the minimum needed settings (especially when it comes to OpenLDAP server), but does its job and can be a great base for building much more complex solution.

Based on:

Included services

Environment Variables you should set

  • DOMAIN_NAME -- Domain name for LDAP suffix (i.e.: example.com)
  • DOMAIN_NAME_DC -- DomainComponent for LDAP database (single word, no dots, i.e.: example)
  • LDAP_ROOT_USERNAME -- root/admin user name for OpenLDAP
  • LDAP_ROOT_PASSWORD -- password for OpenLDAP root/admin user *

* Plain-text password is possible, but not recommended! To generate password hash, use the slappasswd command and set this environment variable to value returned by slappasswd.
If you don't want to install this command, use:

$ docker run --rm -it alpine:latest sh -c 'apk add openldap 2>/dev/null; slappasswd'

nginx, php & phpLDAPadmin can be disabled altogether by setting DISABLE_PHPLDAPADMIN="1" environment variable.

Exposed Ports

Volumes

  • /var/lib/openldap/openldap-data -- OpenLDAP database
  • /var/lib/openldap/openldap-init -- custom LDIF config files for OpenLDAP

Useful commands

  • Test LDAP root login:
    ldapsearch -D 'cn=root,dc=example,dc=com' -W '(objectclass=*)' -b 'dc=example,dc=com'

Useful links

LDAP/OpenLDAP (slapd) documentation

phpLDAPadmin documentation

License

MIT