Need help with ldap-user-manager?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

149 Stars 34 Forks MIT License 52 Commits 8 Opened issues


A PHP web-based interface for LDAP user account management and self-service password change.

Services available


Need anything else?

Contributors list

LDAP User Manager

This is a PHP LDAP account manager; a web-based GUI interface which allows you to quickly populate a new LDAP directory and easily manage user accounts and groups. It also has a self-service password change module.
It's designed to work with OpenLDAP and to be run as a container. It complements OpenLDAP containers such as osixia/openldap.


  • Setup wizard: this will create the necessary structure to allow you to add users and groups and will set up an initial admin user that can log into the user manager.
  • Group creation and management.
  • User account creation and management.
  • Optionally send an email to the user with their new or updated account credentials.
  • Secure password auto-generator: click the button to generate a secure password.
  • Password strength indicator.
  • Self-service password change: non-admin users can log in to change their password.
  • An optional form for people to request accounts (request emails are sent to an administrator).


Initial setup: add an administrator account:

Add a new group:

Manage group membership:

Edit accounts:

Self-service password change:

Quick start

docker run \
           --detach \
           --name=lum \
           -p 80:80 \
           -p 443:443 \
           -e "" \
           -e "LDAP_URI=ldap://" \
           -e "LDAP_BASE_DN=dc=example,dc=com" \
           -e "LDAP_ADMINS_GROUP=admins" \
           -e "LDAP_ADMIN_BIND_DN=cn=admin,dc=example,dc=com" \
           -e "LDAP_ADMIN_BIND_PWD=secret"\
           -e "LDAP_IGNORE_CERT_ERRORS=true" \
           -e "" \

Change the variable values to suit your environment. Now go to


Configuration is via environmental variables. Please bear the following in mind:

  • This tool needs to bind to LDAP as a user that has the permissions to modify everything under the base DN.
  • This interface is designed to work with a fresh LDAP server and should only be against existing, populated LDAP directories with caution and at your own risk.


    : The URI of the LDAP server, e.g.
    : The base DN for your organisation, e.g.
    : The DN for the user with permission to modify all records under
    , e.g.
    : The password for
    : The name of the group used to define accounts that can use this tool to manage LDAP accounts. e.g.


Organisation settings

    (default: The hostname that this interface will be served from.
    : (default: LDAP): Your organisation's name.
    (default: {ORGANISATION_NAME} user manager): Change this to replace the title in the menu, e.g. "My Company Account Management".

LDAP settings

    (default: people): The name of the OU used to store user accounts (without the base DN appended).
    (default: groups): The name of the OU used to store groups (without the base DN appended).
    (default: TRUE): If TRUE then a TLS connection is required for this interface to work. If set to FALSE then the interface will work without STARTTLS, but a warning will be displayed on the page.
    (default: FALSE): If TRUE then problems with the certificate presented by the LDAP server will be ignored (for example FQDN mismatches). Use this if your LDAP server is using a self-signed certificate and you don't have a CA certificate for it or you're connecting to a pool of different servers via round-robin DNS.
    (no default): If you need to use a specific CA certificate for TLS connections to the LDAP server (when
    is set) then assign the contents of the CA certificate to this variable. e.g.
    -e LDAP_TLS_CACERT="$( (ensure you're using quotes or you'll get an "invalid reference format: repository name must be lowercase" error.

Advanced LDAP settings

These settings should only be changed if you're trying to make the user manager work with an LDAP directory that's already populated and the defaults don't work.

    (default: memberUID or uniqueMember): The attribute used when adding a user's account to a group. When the
    objectClass is detected or force-enabled it defaults to
    , otherwise it'll default to
    . Explicitly setting this variable will override any default.
    (default: TRUE or FALSE): If TRUE then the entry for a member of a group will be just the username, otherwise it's the member's full DN. When the
    objectClass is detected or force-enabled it defaults to
    , otherwise it'll default to
    . Explicitly setting this variable will override the default.
    (default: FALSE): Set to TRUE if the auto-detection is failing to spot that the RFC2307BIS schema is available. When FALSE the user manager will use auto-detection. See Using the RFC2307BIS schema for more information.

User account settings

    (default: everybody): The group that new accounts are automatically added to when created. NOTE: If this group doesn't exist then a group is created with the same name as the username and the user is added to that group.
    (default: /bin/bash): The shell that will be launched when the user logs into a server.
    (no default): If set then the email address field will be automatically populated in the form of
    [email protected]_domain
    (default: {firstname}-{lastname}): The template used to dynamically generate usernames. See Username format.
    (default: ^[a-z][a-zA-Z0-9._-]{3,32}$): The regular expression used to ensure a username (and group name) is valid. See Username format.
    (no default): Select which hashing method which will be used to store passwords in LDAP. Options are (in order of precedence)
    . If your chosen method isn't available on your system then the strongest available method will be automatically selected -
    is the strongest method guaranteed to be available. Cleartext passwords should NEVER be used in any situation outside of a test.
    (default: FALSE): Set this to TRUE to prevent a password being rejected for being too weak. The password strength indicators will still gauge the strength of the password. Don't enable this in a production environment.

Email sending

To send emails you'll need to use an existing SMTP server. Email sending will be disabled if

isn't set.
    (no default): The hostname of an SMTP server - used to send emails when creating new accounts.
    (default: 25): The SMTP port on the SMTP server.
    (no default): The username to use when the SMTP server requires authentication.
    (no default): The password to use when the SMTP server requires authentication.
    (default: FALSE): Set to TRUE if the SMTP server requires TLS to be enabled.
    (default: [email protected]{EMAIL_DOMAIN}): The FROM email address used when sending out emails. The default domain is taken from
    under User account settings.
    (default: {SITE_NAME}): The FROM name used when sending out emails. The default name is taken from
    under Organisation settings.

Account requests

    (default: FALSE): Set to TRUE in order to enable a form that people can fill in to request an account. This will send an email to {ACCOUNTREQUESTSEMAIL} with their details and a link to the account creation page where the details will be filled in automatically. You'll need to set up email sending (see Email sending, above) for this to work. If this is enabled but email sending isn't then requests will be disabled and an error message sent to the logs.
    (default: {EMAILFROMADDRESS}): This is the email address that any requests for a new account are sent to. Site security settings

Website sessions

    (default: FALSE): If you set this to TRUE then the server will run in HTTP mode, without any encryption. This is insecure and should only be used for testing.
    (default: 10 minutes): How long before an idle session will be timed out.

Debugging settings

    (default: FALSE): Set to TRUE to increase the logging level for LDAP requests. This will output passwords to the error log - don't enable this in a production environment. This is for information on problems updating LDAP records and such. To debug problems connecting to the LDAP server in the first place use
    (default: FALSE): Set to TRUE to enable detailed LDAP connection logs (PHP's LDAPOPTDEBUG_LEVEL 7). This will flood the logs with detailled LDAP connection information so disable this for production environments.
    (default: FALSE): Set to TRUE to increase the logging level for sessions and user authorisation. This will output cookie passkeys to the error log - don't enable this in a production environment.
    (default: 0): Set to between 1-4 to get SMTP logging information (0 disables SMTP debugging logs though it will still display errors). See for details of the levels.

SSL setup


is set to FALSE (the default), the webserver (Apache HTTPD) expects to find
, and these certificates should match
. If these files aren't found then the startup script will create self-signed certificates based on
. To use your own key and certificate then you need to bind-mount a directory containing them to
. You can also add a certificate chain file (the Apache
option) if needed - name it
and place it in the same directory as

For example, if your key and certificate files are in

you can bind-mount that folder by adding this line to the docker run example above, just after the last line starting with
: ``` -v /home/myaccount/ssl:/opt/ssl \
Initial setup

Ideally you'll be using this against an empty LDAP directory. You can use the setup utility to create the LDAP structures that this user manager needs in order to create accounts and groups. Go to https://{SERVER_HOSTNAME}/setup to get started (replace {SERVER_HOSTNAME} with whatever you set SERVER_HOSTNAME to in the Docker run command).

The log in password is the admin user's password (what LDAP_ADMIN_BIND_DN was set to).

The setup utility will create the user and account trees, records that store the last UID and GID used when creating a user account or group, a group for admins and the initial admin account.


Sending emails

When you create an account you'll have an option to send an email to the person you created the account for. The email will give them their new username, password and a link to the self-service password change utility.

Emails are sent via SMTP, so you'll need to be able to connect to an SMTP server and pass in the settings for that server via environmental variables - see Email sending above.
If you haven't passed in those settings or if the account you've created has no (valid) email address then the option to send an email will be disabled.

When the account is created you'll be told if the email was sent or not but be aware that just because your SMTP server accepted the email it doesn't mean that it was able to deliver it. If you get a message saying the email wasn't sent then check the logs for the error. You can increase the log level (SMTP_LOG_LEVEL) to above 0 in order to see SMTP debug logs.

Username format

When entering the user's first and last names a bit of JavaScript automatically generates the username. The way it generates is it based on a template format defined by USERNAME_FORMAT. This is basically a string in which predefined macros are replaced by the formatted first and/or last name.
The default is {first_name}-{last_name} with which Jonathan Testperson's username would be jonathan-testperson.
Currently the available macros are:

  • {first_name} : the first name in lowercase
  • {first_name_initial} : the first letter of the first name in lowercase
  • {last_name}: the last name in lowercase
  • {last_name_initial}: the first initial of the last name in lowercase

Anything else in the USERNAME_FORMAT string is left as defined, but the username is also checked for validity against USERNAME_REGEX. This is to ensure that there aren't any characters forbidden by other systems (i.e. email or Linux/Unix accounts).

If EMAIL_DOMAIN is set then the email address field will be automatically updated in the form of [email protected]_domain. Entering anything manually in that field will stop the automatic update of the email field.

Using the RFC2307BIS schema

The user manager will attempt detect if your LDAP server has the RFC2307BIS schema available and, if it does, use it when creating groups. This will allow you to use memberOf in LDAP searches which gives you an easy way to check if a user is a member of a group. For example: (&(objectClass=posixAccount)(memberof=cn=somegroup,ou=groups,dc=ldapusermanager,dc=org)). See this guide for more information.

With OpenLDAP this schema isn't normally available by default; you need to configure your server to use the RFC2307BIS schema when setting up your directory.

If for some reason you do have the schema available but it isn't being detected then you can force it's use by setting FORCE_RFC2307BIS to TRUE.
Note: if you force-enable using RFC2307BIS but your LDAP server doesn't have that schema available then creating and adding users to groups won't work and the user manager will throw errors.

If you plan on using osixia/openldap as your LDAP server you can enable the RFC2307BIS schema by setting LDAP_RFC2307BIS_SCHEMA to true during the initial setup.

Testing with an LDAP container

This will set up an OpenLDAP container you can use to test the user manager against. It uses the RFC2307BIS schema.

docker run \ --detach \ --restart unless-stopped \ --name openldap \ -e "LDAPORGANISATION=ldapusermanager" \ -e "" \ -e "LDAPADMINPASSWORD=changeme" \ -e "LDAPRFC2307BISSCHEMA=true" \ -e "LDAPREMOVECONFIGAFTERSETUP=true" \ -e "LDAPTLSVERIFYCLIENT=never" \ -p 389:389 --volume /opt/docker/openldap/varlibldap:/var/lib/ldap \ --volume /opt/docker/openldap/etcldapslapd.d:/etc/ldap/slapd.d \ osixia/openldap:latest

docker run \ --detach \ --name=lum \ -p 80:80 \ -p 443:443 \ -e "SERVERHOSTNAME=localhost" \ -e "LDAPURI=ldap://" \ -e "LDAPBASEDN=dc=ldapusermanager,dc=org" \ -e "LDAPADMINSGROUP=admins" \ -e "LDAPADMINBINDDN=cn=admin,dc=ldapusermanager,dc=org" \ -e "LDAPADMINBINDPWD=changeme" \ -e "LDAPIGNORECERTERRORS=true" \ wheelybird/ldap-user-manager:latest ``

Now go to https://localhost/setup - the password is
change_me` (unless you changed it). As this will use self-signed certificates you might need to tell your browser to ignore certificate warnings.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.