Prerequisites
- LDAP or Active Directory server accessible from Open WebUI
- Service account with read access to user directory (optional but recommended)
- LDAP search base DN and user attributes
Configuration
Basic LDAP Setup
Set these environment variables to enable LDAP authentication:TLS/SSL Configuration
Active Directory Configuration
For Microsoft Active Directory, use these recommended settings:OpenLDAP Configuration
For OpenLDAP servers:Group Synchronization
Enable automatic group synchronization from LDAP to Open WebUI:How Group Sync Works
- User authenticates via LDAP
- Open WebUI reads the
LDAP_ATTRIBUTE_FOR_GROUPSattribute - For each group DN, Open WebUI:
- Creates the group if it doesn’t exist (when
ENABLE_LDAP_GROUP_CREATION=true) - Adds the user as a member
- Creates the group if it doesn’t exist (when
- Groups are synchronized on each login
Group names are extracted from the CN (Common Name) component of the group DN.
For example:
CN=Engineering,OU=Groups,DC=company,DC=com becomes “Engineering”Docker Compose Example
Troubleshooting
Connection Issues
Problem: Cannot connect to LDAP server- Network connectivity to LDAP server
- Firewall rules allow port 389 (LDAP) or 636 (LDAPS)
- Certificate validation if using TLS
Authentication Failures
Problem: Users cannot log in Check:LDAP_SEARCH_BASEincludes the user’s organizational unitLDAP_ATTRIBUTE_FOR_USERNAMEmatches the login username format- Service account has read permissions
LDAP_SEARCH_FILTERSdon’t exclude the user
Group Sync Not Working
Problem: Groups not appearing or syncing Check:ENABLE_LDAP_GROUP_MANAGEMENT=trueis setLDAP_ATTRIBUTE_FOR_GROUPSmatches your directory schema (usuallymemberOf)- User’s LDAP entry contains group memberships
- Group DNs can be parsed (contain
CN=component)
Certificate Validation Errors
Security Best Practices
Implementation Details
The LDAP integration is implemented in:- Configuration:
backend/open_webui/config.py:4109-4200 - Authentication logic:
backend/open_webui/routers/auths.py:315-573 - Uses
ldap3==2.9.1Python library
Next Steps
- SCIM Provisioning - For automated user lifecycle management
- RBAC - Configure role-based access control
- OAuth SSO - Additional SSO options