In this foundational lab, you will construct a complete enterprise-grade directory service infrastructure from scratch. Starting with nothing more than a physical computer, you will install a hypervisor (VirtualBox or VMware), provision an Ubuntu Linux virtual machine, deploy Docker containerization technology, and finally instantiate an OpenLDAP directory server. You will then populate this directory with a realistic organizational structure including departments, user accounts with full identity attributes, and security groups that mirror real enterprise access control patterns. By the end of this lab, you will have a fully functional LDAP directory capable of authenticating users, querying group memberships, and enforcing role-based access control—the exact same capabilities that power identity management in Fortune 500 companies worldwide.
Imagine you've just joined TechCorp Industries, a multinational technology company with 15,000 employees across 47 countries. On your first day as a Junior IAM Engineer, your manager presents you with a challenge: "We're migrating from legacy authentication systems to a centralized directory service. Before we touch production, I need you to build a proof-of-concept LDAP environment that demonstrates our proposed directory structure."
This lab simulates exactly that scenario. The skills you develop here directly translate to:
Design OU structures for organizations of any size. Used when planning Active Directory forests, Azure AD organizational units, or any hierarchical identity store.
Read and write LDAP Data Interchange Format files. Essential for bulk user imports, directory migrations, and backup/restore operations.
Construct complex search filters to find users, groups, and relationships. Critical for application integration, security audits, and troubleshooting.
Diagnose why logins fail—wrong DN, bad password, account locked, group missing. The #1 skill needed in any IAM support role.
Implement role-based access control using groups. The foundation for every modern authorization system from AWS IAM to Kubernetes RBAC.
Deploy and manage identity infrastructure in containers. Modern pattern used in cloud-native and DevOps environments.
LDAP and directory services power identity management across virtually every enterprise environment:
This lab involves multiple devices and environments. Each code block is tagged with a colored badge indicating exactly where to run the commands. Pay close attention to these badges to avoid running commands on the wrong machine, which could cause errors or unexpected behavior.
Regardless of your host operating system (Windows, macOS, or Linux), we recommend running all lab exercises inside an Ubuntu 22.04 VM. This ensures:
| Component | Minimum | Recommended | Purpose |
|---|---|---|---|
| Operating System | Windows 10, macOS 12+, Ubuntu 20.04+ | Windows 11, macOS 14+, Ubuntu 22.04+ | Hypervisor host platform |
| CPU | Intel Core i5 / AMD Ryzen 5 (4 cores) | Intel Core i7 / AMD Ryzen 7 (6+ cores) | Must support VT-x or AMD-V virtualization |
| RAM (Total) | 8 GB | 16 GB | Host OS + VM allocation |
| RAM (VM Allocation) | 4 GB | 8 GB | Ubuntu + Docker + OpenLDAP |
| Disk Space (Free) | 30 GB | 50 GB | VM disk image + Docker images |
| Network | Internet connection | Stable broadband | Download Ubuntu ISO, Docker images |
Before proceeding, ensure hardware virtualization is enabled in your BIOS/UEFI settings:
How to check: If you see errors like "VT-x is disabled", "Hardware virtualization not available", or "This host does not support Intel VT-x" when creating VMs, restart your computer, enter BIOS setup (usually F2, F12, DEL, or ESC during boot), navigate to CPU or Advanced settings, and enable virtualization.
The following diagram illustrates the complete technical stack you will build in this lab. Each layer represents a distinct component, from your physical hardware at the top to the LDAP directory entries at the bottom.
| Layer | Component | Purpose | Key Configuration |
|---|---|---|---|
| 1 | Physical Host | Runs hypervisor software | VT-x/AMD-V enabled in BIOS |
| 2 | Hypervisor | Creates and manages VMs | VirtualBox 7.0+ or VMware 17+ |
| 3 | Ubuntu VM | Isolated lab environment | 4GB RAM, 40GB disk, NAT networking |
| 4 | Docker Engine | Container runtime | Docker CE with Compose plugin |
| 5 | OpenLDAP | Directory service | Port 389, persistent volumes |
This lab uses simplified security settings for educational purposes. In production environments, you MUST implement:
A hypervisor is software that creates and manages virtual machines, allowing you to run multiple operating systems on a single physical computer. For this lab, you can choose between two popular Type-2 (hosted) hypervisors:
| Feature | VirtualBox | VMware Workstation Player |
|---|---|---|
| Cost | Free (Open Source) | Free (Personal Use) |
| Platforms | Windows, macOS, Linux | Windows, Linux |
| Performance | Good | Excellent |
| Ease of Use | Beginner-friendly | Beginner-friendly |
| Recommended For | macOS users, beginners | Windows/Linux users wanting best performance |
For this lab, we recommend VirtualBox as it works across all platforms and is completely free. The instructions below cover both options—choose the one that suits your environment.
Select your operating system below for platform-specific installation instructions:
If you prefer VMware over VirtualBox, follow these instructions:
Before proceeding to VM creation, verify your hypervisor is working:
If you encounter errors about virtualization, revisit the BIOS settings mentioned in prerequisites.
Now we'll create an Ubuntu 22.04 LTS virtual machine that will serve as our isolated lab workstation. All remaining lab exercises will be performed inside this VM.
Your Ubuntu VM is now fully configured and ready for the lab. You should have:
From this point forward, ALL commands will be run inside the Ubuntu VM unless otherwise noted.