Skip to content

abstecker/ldapy

Repository files navigation

LDAP Server Docker Compose Setup

This Docker Compose setup provides an OpenLDAP server with a web-based administration interface.

Services

OpenLDAP Server

  • Port: 389 (LDAP), 636 (LDAPS)
  • Admin DN: cn=admin,dc=electronicpanopti,dc=com
  • Admin Password: admin123
  • Base DN: dc=electronicpanopti,dc=com

phpLDAPadmin (Web Interface)

Quick Start

  1. Start the services:

    docker-compose up -d
  2. Access the web interface at: http://localhost:8080

  3. Login with:

    • Login DN: cn=admin,dc=electronicpanopti,dc=com
    • Password: admin123

LDAP Client Commands

You can also interact with the LDAP server using command-line tools:

Install LDAP utils (on macOS)

brew install openldap

Search for all entries

ldapsearch -x -H ldap://localhost:389 -D "cn=admin,dc=electronicpanopti,dc=com" -w admin123 -b "dc=electronicpanopti,dc=com"

Search for users

ldapsearch -x -H ldap://localhost:389 -D "cn=admin,dc=electronicpanopti,dc=com" -w admin123 -b "ou=people,dc=electronicpanopti,dc=com"

Add a new user (create add-user.ldif first)

ldapadd -x -H ldap://localhost:389 -D "cn=admin,dc=electronicpanopti,dc=com" -w admin123 -f add-user.ldif

Sample Data

The setup includes sample users and groups in the ldif/01-sample-data.ldif file:

  • Users: john.doe, jane.smith
  • Group: developers
  • Default password for users: password123

Configuration

Environment Variables

  • LDAP_ORGANISATION: Organization name
  • LDAP_DOMAIN: Domain name (affects base DN)
  • LDAP_ADMIN_PASSWORD: Admin user password
  • LDAP_BASE_DN: Base Distinguished Name

Volumes

  • ldap_data: Stores LDAP data
  • ldap_config: Stores LDAP configuration
  • ./ldif: Custom LDIF files for initial data

Stopping the Services

docker-compose down

To remove all data (volumes):

docker-compose down -v

Troubleshooting

  1. Check container logs:

    docker-compose logs openldap
    docker-compose logs phpldapadmin
  2. Verify containers are running:

    docker-compose ps
  3. Test LDAP connectivity:

    telnet localhost 389

About

Fun with Docker and LDAP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors