Skip to main content
Open WebUI supports LDAP and Active Directory integration for enterprise user authentication. Users can sign in with their existing directory credentials without creating separate accounts.

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

For production deployments, always use LDAPS (LDAP over TLS) to encrypt credentials in transit.

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

  1. User authenticates via LDAP
  2. Open WebUI reads the LDAP_ATTRIBUTE_FOR_GROUPS attribute
  3. 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
  4. 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
Check:
  • 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_BASE includes the user’s organizational unit
  • LDAP_ATTRIBUTE_FOR_USERNAME matches the login username format
  • Service account has read permissions
  • LDAP_SEARCH_FILTERS don’t exclude the user

Group Sync Not Working

Problem: Groups not appearing or syncing Check:
  • ENABLE_LDAP_GROUP_MANAGEMENT=true is set
  • LDAP_ATTRIBUTE_FOR_GROUPS matches your directory schema (usually memberOf)
  • User’s LDAP entry contains group memberships
  • Group DNs can be parsed (contain CN= component)

Certificate Validation Errors

Security Best Practices

Important Security Considerations:
  1. Always use TLS - Set LDAP_USE_TLS=true and LDAP_SERVER_PORT=636
  2. Service Account - Use dedicated service account with minimal read-only permissions
  3. Strong Passwords - Store LDAP_APP_PASSWORD securely (use secrets management)
  4. Certificate Validation - Set LDAP_VALIDATE_CERT=true in production
  5. Firewall Rules - Restrict LDAP server access to Open WebUI instances only
  6. Regular Audits - Monitor LDAP authentication logs for suspicious activity

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.1 Python library

Next Steps