NOTE: This was done on Debian 5 Lenny. This does not apply to Squeeze. A new guide will be released shortly.

By the ! I mean get ready to dedicate some time. This might take a while and might not work perfectly when you first install it.

First install the software. It will then ask you some questions.
# apt-get install slapd ldap-utils migrationtools (only install migrationtools if moving user accounts from local /etc/passwd file)
Remember dc=yourdomain,dc=com when setting up. The default username it sets up will be cn=admin. it will ask you for a passwd.

Now to configure more options:
# dpkg-reconfigure slapd

And Some answers:
Omit OpenLDAP server configuration? … No
DNS domain name: … debuntu.local
Name of your organization: … Whatever & Co
Admin Password: XXXXX
Confirm Password: XXXXX
OK
BDB
Do you want your database to be removed when slapd is purged? … No
Move old database? … Yes
Allow LDAPv2 Protocol? … No

After answering, slapd should be started automatically. to test this, run the search command:
$ ldapsearch -x -b dc=yourdomain,dc=com

if your output is an error in contacting the server, try /etc/init.d/slapd restart

Thats it! db is setup and ready to go. But you will have to setup your clients and migration if need be from having all your users presently in a /etc/passwd (and shadow) file.

Mario Loria is a builder of diverse infrastructure with modern workloads on both bare-metal and cloud platforms. He's traversed roles in system administration, network engineering, and DevOps. You can learn more about him here.