OpenLDAP

OpenLDAP #

First it’s required to setup OpenLDAP server to complete below setup.

This article will help you to setup OpenLDAP server.

Setup #

mkdir openldap && cd openldap
touch docker-compose.yaml && nano docker-compose.yaml
docker-compose up -d

docker-compose.yaml #

version: '2'

volumes:
  data:
  config:

services:
  openldap:
    image: osixia/openldap:1.5.0
    container_name: openldap
    hostname: "ldap"
    domainname: "example.com"
    tty: true
    stdin_open: true
    restart: always
    environment:
      LDAP_LOG_LEVEL: "256"
      LDAP_ORGANISATION: "Example Inc."
      LDAP_DOMAIN: "example.com"
      LDAP_BASE_DN: "dc=example,dc=com"
      LDAP_ADMIN_PASSWORD: "youradminpassword"
      LDAP_CONFIG_PASSWORD: "yourconfigpassword"
      LDAP_READONLY_USER: "false"
      LDAP_RFC2307BIS_SCHEMA: "false"
      LDAP_BACKEND: "mdb"
      LDAP_TLS: "false"
      LDAP_REPLICATION: "false"
      KEEP_EXISTING_CONFIG: "false"
      LDAP_REMOVE_CONFIG_AFTER_SETUP: "true"
    volumes:
      - data:/var/lib/ldap
      - config:/etc/ldap/slapd.d
    ports:
      - "389:389"

You need to adjust these env:

  • LDAP_ORGANISATION: Your Company Name

  • LDAP_DOMAIN: Your Domain, such as motofans.club

  • LDAP_BASE_DN: The Base DN setting specifies the root for searches in the Active Directory. Ideally​, this should match the root of your domain. Example: dc=motofans,dc=club.

  • LDAP_ADMIN_PASSWORD: LDAP Admin password

  • LDAP_CONFIG_PASSWORD: LDAP config password