Configuration

OpenLDAP Docker is configured entirely through environment variables. No manual LDIF editing required.

Core Configuration

VariableDefaultDescription
LDAP_DOMAINexample.comLDAP domain (auto-converts to base DN dc=example,dc=com)
LDAP_ORGANIZATIONExample OrganizationOrganization name for the base entry
LDAP_ADMIN_PASSWORDadminDirectory Manager password (SSHA hashed internally)
LDAP_CONFIG_PASSWORDconfigcn=config database password
LDAP_ADMIN_PASSWORD_FILELoad admin password from file (Docker secrets)
LDAP_CONFIG_PASSWORD_FILELoad config password from file (Docker secrets)
LDAP_LOG_LEVEL256slapd logging level
INCLUDE_SCHEMASSchemas to load (comma-separated: cosine,inetorgperson,nis)

Replication

VariableDefaultDescription
ENABLE_REPLICATIONfalseEnable multi-master (mirror mode) replication
SERVER_ID1Unique server ID (1–4095)
REPLICATION_PEERSComma-separated peer hostnames
REPLICATION_RIDSCustom Replica IDs (comma-separated, default auto-generated from 100)

Overlays

VariableDefaultDescription
ENABLE_MEMBEROFfalseEnable memberOf overlay (track group membership on user entries)
ENABLE_PASSWORD_POLICYfalseEnable ppolicy overlay (min 8 chars, 5 history, lockout after 5 failures)
ENABLE_AUDIT_LOGfalseEnable auditlog overlay (logs all modifications to /logs/audit.log)
ENABLE_MONITORINGtrueEnable cn=Monitor backend for real-time statistics

TLS/SSL

VariableDefaultDescription
LDAP_TLS_CERTPath to TLS certificate file
LDAP_TLS_KEYPath to TLS private key file
LDAP_TLS_CAPath to CA certificate file
LDAP_TLS_VERIFY_CLIENTneverClient certificate verification (never, allow, try, demand)

Network

VariableDefaultDescription
LDAP_PORT389LDAP port (unencrypted)
LDAPS_PORT636LDAPS port (TLS encrypted)

Performance

VariableDefaultDescription
LDAP_QUERY_LIMIT_SOFT500Soft limit for search results
LDAP_QUERY_LIMIT_HARD1000Hard limit for search results
LDAP_IDLE_TIMEOUT600Connection idle timeout in seconds

Volumes

PathPurpose
/var/lib/ldapDatabase files (MDB) — must be writable
/etc/openldap/slapd.dConfiguration database — must be writable
/logsLog output (slapd.log, audit.log) — must be writable
/custom-schemaCustom LDIF schemas — read-only, auto-loaded on startup
/docker-entrypoint-initdb.dInitialization scripts — executed once on first startup
/certsTLS certificates — read-only

Example: Basic Single Node

version: '3.8'
services:
  openldap:
    image: ghcr.io/vibhuvioio/openldap:latest
    environment:
      - LDAP_DOMAIN=example.com
      - LDAP_ADMIN_PASSWORD=changeme
      - ENABLE_MONITORING=true
    ports:
      - "389:389"
    volumes:
      - ldap-data:/var/lib/ldap
      - ldap-config:/etc/openldap/slapd.d

Example: With Overlays and TLS

version: '3.8'
services:
  openldap:
    image: ghcr.io/vibhuvioio/openldap:latest
    environment:
      - LDAP_DOMAIN=mycompany.com
      - LDAP_ADMIN_PASSWORD=securepassword
      - ENABLE_MEMBEROF=true
      - ENABLE_PASSWORD_POLICY=true
      - ENABLE_AUDIT_LOG=true
      - LDAP_TLS_CERT=/certs/server.crt
      - LDAP_TLS_KEY=/certs/server.key
    ports:
      - "389:389"
      - "636:636"
    volumes:
      - ldap-data:/var/lib/ldap
      - ldap-config:/etc/openldap/slapd.d
      - ./logs:/logs
      - ./certs:/certs:ro

Example: Multi-Master Cluster

version: '3.8'
services:
  openldap-node1:
    image: ghcr.io/vibhuvioio/openldap:latest
    hostname: openldap-node1
    environment:
      - LDAP_DOMAIN=example.com
      - LDAP_ADMIN_PASSWORD=changeme
      - ENABLE_REPLICATION=true
      - SERVER_ID=1
      - REPLICATION_PEERS=openldap-node2,openldap-node3
    ports:
      - "389:389"

  openldap-node2:
    image: ghcr.io/vibhuvioio/openldap:latest
    hostname: openldap-node2
    environment:
      - LDAP_DOMAIN=example.com
      - LDAP_ADMIN_PASSWORD=changeme
      - ENABLE_REPLICATION=true
      - SERVER_ID=2
      - REPLICATION_PEERS=openldap-node1,openldap-node3
    ports:
      - "390:389"

  openldap-node3:
    image: ghcr.io/vibhuvioio/openldap:latest
    hostname: openldap-node3
    environment:
      - LDAP_DOMAIN=example.com
      - LDAP_ADMIN_PASSWORD=changeme
      - ENABLE_REPLICATION=true
      - SERVER_ID=3
      - REPLICATION_PEERS=openldap-node1,openldap-node2
    ports:
      - "391:389"

Database Details

  • Backend: MDB (Memory-Mapped Database)
  • Indices: cn, uid, mail, sn, givenname, member, memberOf
  • Base Image: AlmaLinux 9 (enterprise-grade, long-term support)
  • User: Runs as ldap user (UID 55) for non-root execution