Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a developer for a product that integrates with LDAP for authentication. I need to set up a directory that I can test against.

I'm not an expert with LDAP. To help ease the learning curve it'd be useful to have a real-world example directory.

Are there any resources that'll help me set up an demo directory, ready-to-go? A VMware appliance for example?

share|improve this question
What OS are you on? – Le Comte du Merde-fou Oct 19 '09 at 17:37
Any OS. Last time I had to do this, I struggled to set up AD on Windows. OpenLDAP may be easier? – Christopher Nadeau Oct 19 '09 at 17:47
up vote 8 down vote accepted

OpenDS is very easy to get running - just download the ZIP file and run the installer or use the Java web-start. The installer can populate the directory with test entries too if you want to see some example data.

I'd strongly recommend Apache Directory Studio as a good client to use to get familiar with how to browse, edit and manage data via LDAP.

share|improve this answer
Exactly what I needed. The automatic test data is a big help. Thanks! – Christopher Nadeau Oct 19 '09 at 18:52
Note: OpenDS only works with Java7. For Java8, you'll need the OpenDS fork OpenDJ. – Quandary Jul 5 at 7:45

Install Ubuntu Server Edition 8.10, boot it up and install OpenLDAP.

$ sudo apt-get install slapd ldap-utils

You can probably just accept the defaults if this is just for testing, therefore your domain will be dc=example,dc=com. In the install wizard it should ask you to setup your ldap admin user, this user's DN should be *cn=admin,dc=example,dc=com`.

Then you'll need to add two organizational units, one for People, one for Groups. Create the file myldap.ldif and place into it this:

dn: ou=people,dc=example,dc=com
objectClass: organizationalUnit
ou: people

dn: ou=groups,dc=example,dc=com
objectClass: organizationalUnit
ou: groups

If LDAP is running, shut it down with /etc/init.d/slapd stop.

Use ldapadd to add the LDIF file to our LDAP database:

$ ldapadd -x -D cn=admin,dc=example,dc=com -W -f myldap.ldif

It will ask you for your password that you set during the install.

Fire LDAP back up with /etc/init.d/slapd start and then install Webmin:

$ sudo aptitude install perl libnet-ssleay-perl openssl \
                        libauthen-pam-perl libpam-runtime \
                        libio-pty-perl libmd5-perl
$ wget
$ sudo dpkg -i webmin_1.441_all.deb

You can now navigate to your LDAP server's IP at port 10000 using URL https://your-server-ip:10000/. Note you will be required to enter the root password for the computer at this login screen.

From here we need to configure Webmin to interact with our LDAP environment. Expand "System" and then select "LDAP Users and Groups." Click "Module Config" at the top of the page and find the following option and enter this custom data:

Base for users  ou=People,dc=example,dc=com
Base for groups     ou=Groups,dc=example,dc=com

Click save at the bottom. You will be returned to the previous screen where you can now add LDAP users and groups. This is now a functioning LDAP server. You can query it from the command using ldapsearch:

Whole database:

$ ldapsearch -x -h <your-server-ip> -b "dc=example,dc=com"

User search:

$ ldapsearch -x -h <your-server-ip> -b "dc=example,dc=com" '(uid=blah)'

I did most of this from memory so you'll have to forgive me if I missed a couple steps. Enjoy.

share|improve this answer

I don't think any LDAP server is gonna be easy until you brush up on your LDAP a little; most of the concepts are shared across them.

For Windows it might be worth your while looking at Active Directory Application Mode, which gives you fairly basic (but comprehensive enough for development requirements) LDAP functionality without all of the Domain/DNS/etc baggage that comes with full AD.

share|improve this answer
The link in your answer is broken. Is there any way you can fix it? – Jonathan van de Veen Oct 15 '15 at 9:13

@ m0dlx - OMGosh - the system requirements for OpenDS are 2GB RAM - ROFL! Yes, I know, it's a Java thing but if you wanna stick with Java - and certainly if you're recommending Apache Directory Studio - then I would say also take a look at Apache Directory Server.

Another way to go, and use just a very small fraction of system resources by comparison, is phpLDAPadmin

Also, on the Java side - there is Atlassian Crowd which is awesome: Again though, make sure you have the RAM for it ;-)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.