Mattermost Active Directory and LDAP login setup

Mattermost can sign users in with their directory credentials and keep profiles current through AD/LDAP sync. This page covers the supported setup path, the identity mapping decisions, and the checks that confirm access works before rollout.

On this page

Mattermost Active Directory and LDAP login setup: what it covers

If you want staff to sign in to self-hosted Mattermost with their directory credentials instead of a separate password, the supported method is the AD/LDAP configuration in the System Console. User synchronization is a separate concern: login setup decides how a person authenticates, while sync keeps profiles current and deactivates leavers, and you should plan both deliberately rather than assume one implies the other. This page walks through the System Console setup wizard, the attribute Mattermost uses as the unchanging user ID, admin filters, flattening of nested groups, and optional multi-factor authentication layered on top of directory sign-in.

The page does not cover SAML, OpenID Connect, Google or GitLab sign-in, which have their own sibling pages, and it does not cover enforcing MFA for email and LDAP accounts, account provisioning and deprovisioning choices, or moving existing accounts to a new authentication method. Where those topics affect your directory setup, the relevant sections point to them. If you are weighing directory login against a federated identity provider, read the sibling pages first, because the choice changes which attributes and group rules you need to prepare.

The Mattermost pricing page lists AD/LDAP user sync from the Professional plan onward, so confirm which plan your organization holds before you plan the work. Check the plan against your license in the System Console and against the current pricing page, because plan contents can change between releases. Ask your Mattermost account contact to confirm in writing that the directory features you need are included in your subscription, and record the answer alongside your directory access requirements.

Prerequisites for Mattermost Active Directory and LDAP login setup

Directory login touches four teams' work: the Mattermost server, its database, the directory itself and the network between them. Settle these prerequisites before opening the System Console, because most failed setups trace back to an unclear version, an unreachable domain controller or an unowned decision. Confirm the directory type and version against current Mattermost LDAP documentation before you start.

Mattermost server version and channel

Decide between a monthly server release and an Extended Support Release before any configuration. The v11.7 Extended Support Release was released on 2026-05-15 with support ending 2027-05-15, and monthly releases ship on the 16th of each month. Record the exact version you deploy, because LDAP settings and the System Console screens can change between versions. Confirm the current release channel guidance against the Mattermost releases page before you commit.

Server releases

PostgreSQL as the database

Mattermost stores user records, including the directory-linked identifiers, in PostgreSQL. Confirm the database version and that it is reachable from every Mattermost application node, and plan backups before the first sync. Changing the authentication method for existing accounts later is far harder than getting the first load right, so take a restorable backup of the database before running any directory sync.

Directory service and domain controllers

Identify which directory holds the accounts (Active Directory or another LDAP directory), its version, and the domain controllers Mattermost will query. Note the forest and domain structure, where user and group objects live, and whether the users you need sit in one search base or several. Ask the directory team which controllers serve the site where Mattermost runs, since a stale or distant controller produces slow or inconsistent logins.

Read-only bind account

Create a dedicated service account that Mattermost uses to search the directory. It needs read access to the user and group objects in the search bases and no interactive logon rights or administrative group membership. Store its password in a managed secret store, set a rotation date, and record who can reset it. A shared administrator account here is the most common way directory credentials leak into application logs and runbooks.

Network paths and TLS certificates

Open the network path from each Mattermost node to the domain controllers on the LDAP port your directory uses, and confirm firewalls allow it in both directions where required. Use TLS for the connection, and have the directory team supply the certificate chain Mattermost must trust, including any internal certificate authority. Test the path from the actual application hosts, not from a workstation, because firewall rules often differ between them.

Ownership of directory and Mattermost

Name one owner for the directory schema, accounts and groups, and a separate owner for the Mattermost server, its settings and its upgrades. Decide who approves changes to the search filters and who receives alerts when a sync fails. Most directory login problems surface as access changes that neither team expected, so a documented owner on each side shortens troubleshooting considerably.

How a directory login reaches Mattermost

The flow starts when a user submits directory credentials to the Mattermost server inside its own network zone. The server binds with the service account and searches the directory using the configured filter and ID attribute. It then re-authenticates the user's password against the directory, and this is where the trust boundary is crossed. After a match, Mattermost creates or updates the local profile in PostgreSQL and may prompt for a TOTP code before the session starts. Confirm that the filter returns exactly one user and that the service account can read the directory.

Directory login path across the trust boundary between Mattermost and the directory.

Configuring AD/LDAP login in the System Console

This sequence takes a self-hosted Mattermost server from an unconfigured directory connection to a working login for directory users, with group and admin filters and sync turned on. Each step ends with a check that confirms the setting before the next one builds on it.

  1. Prepare the bind account and test connectivity

    The directory team creates a read-only bind account with permission to search the user and group containers, and the platform team confirms from the Mattermost host that the directory server answers on the planned port. Ask the directory team which attributes the bind account can read, since missing permissions often appear later as empty profiles rather than as an obvious error. The step is closed when a directory query run from the Mattermost host returns the expected test user with the bind account's credentials.

  2. Run the AD/LDAP setup wizard

    A Mattermost system administrator opens the System Console, selects the AD/LDAP section and starts the setup wizard. The wizard captures the connection settings that the rest of this sequence fills in, so the administrator should have the directory details from the previous step ready. The step is closed when the wizard opens with the AD/LDAP settings page visible and the save action is available without errors.

  3. Set the server address, port and TLS options

    Enter the directory server hostname, port and TLS mode, and confirm that the certificate presented by the directory server is trusted by the Mattermost host. Use an encrypted connection and avoid unencrypted binds on any network that crosses a segment you do not control. The step is closed when the settings save and the connection test reports that the server was reached over the chosen transport.

  4. Enter the bind credentials and base DN

    Enter the bind account distinguished name and password, then set the base DN to the narrowest container that holds the people who should be able to sign in. A broad base DN increases the number of accounts Mattermost will evaluate and can pull in service or disabled accounts. The step is closed when the bind test authenticates successfully and the base DN returns the expected count of test users in the directory query.

  5. Set the user filter and the unchanging ID attribute

    Define a user filter that matches only active, human accounts in the base DN, then choose an ID attribute that never changes for a person, such as objectGUID in Active Directory, rather than a name or email that can be edited. Confirm the choice with the directory team, because changing the ID attribute later can disconnect existing users from their accounts. The step is closed when the filter returns only the intended users and the ID values are identical across two separate queries.

  6. Map the login, username and email attributes

    Choose the login attribute that users type at the sign-in prompt, then map the username and email attributes to the directory fields your organization maintains. Check that the username values meet Mattermost's username rules and that no two users would map to the same name. The step is closed when a test user's sample lookup shows the expected username and email values with no conflicts reported by the connection test.

  7. Run the connection test and a non-admin test login

    Run the connection test from the console, then sign in with a non-admin directory account from a separate browser session. Confirm that the new account is created with the expected username, email and display name, and that the account has no administrator role. The step is closed when the test login succeeds and the user profile in the System Console matches what the directory holds for that person.

  8. Configure group and admin filters, then enable sync

    Add group filters only if access must be limited to specific directory groups, and set the admin filter to a dedicated group so that system administrator rights follow directory membership. Nested group membership may need flattening in the group configuration, so test a user who belongs to a nested group before relying on the result. Enable synchronization last, and confirm that a deactivated test account in the directory is marked inactive in Mattermost after the next sync run. The step is closed when group membership, admin assignment and deactivation behave as the directory team expects.

Mapping directory attributes to Mattermost user fields

This table compares each directory attribute Mattermost reads during LDAP sync with the profile field it fills, who owns the value, whether sync overwrites it, and what breaks if it changes. Read it before you pick attributes in the System Console, because the ID attribute is the one choice that is hard to undo. Confirm every attribute name against your directory schema and the current Mattermost LDAP field list.

Directory attributeMattermost fieldOwner and sync behaviorWhat breaks if it changes
ID attribute (unchanging identifier)Auth data (LDAP ID)Directory owns it. Sync uses it to match the account on every run and does not expect it to change.Mattermost stops matching the existing account, so a duplicate user may be created and message history can appear under the wrong identity.
Login attribute (username)UsernameDirectory owns it. Sync overwrites the Mattermost username at each run when the directory value changes.Users who type their old username cannot sign in, and mentions and links that used the old name may stop resolving.
Email attributeEmail addressDirectory owns it. Sync overwrites the stored address at each run.Notification delivery, password reset and any email-based MFA or invitation flow can target the wrong address.
First name attributeFirst nameDirectory owns it. Sync overwrites the value at each run, so edits made in Mattermost are lost.Display names change across channels and member lists, and search results may look inconsistent until the next sync.
Last name attributeLast nameDirectory owns it. Sync overwrites the value at each run.Same effect as first name. Display names combine both fields, so a partial change can produce odd labels.
Nickname attribute (where used)NicknameDirectory owns it if you map it. Leave it unmapped if users should set their own nickname in Mattermost.Unmapped fields stay user-editable. Mapping a field that the directory leaves empty can clear values users set.
Position attribute (where used)PositionDirectory owns it. Sync overwrites the value at each run, so it tracks job title changes in the directory.Stale titles appear in profiles if the attribute is mapped to the wrong source or the directory does not maintain it.
Admin and guest filters (not profile fields)System roles and account statusDirectory owns group membership. Filters are evaluated on each sync and can deactivate accounts that stop matching.A filter change can deactivate large groups of users at the next sync. Test the filter against a sample before enabling it.

Why the unchanging ID attribute decides whether accounts survive renames

The ID attribute is the key Mattermost uses to link a directory object to a local account, so it must hold the same value for the life of the person it belongs to. A value such as a sAMAccountName, an email address or a display name changes when someone marries, moves department or is renamed for other reasons. When the key changes, the next sync no longer finds the account it created earlier, so Mattermost treats the person as new. The choice of ID attribute is therefore one of the few decisions in this setup that is hard to reverse cleanly once real users and messages exist.

The failure pattern is predictable. A mutable attribute is chosen, a person's email or username changes in the directory, and the sync creates a second account while the original stays behind. The old account keeps the message history, channel memberships and any system admin role, but it can no longer sign in through the directory. The new account starts empty, and the person may find that their admin rights or team roles did not carry over. Multiply this across a department restructuring and the cleanup becomes a manual reconciliation project, with support tickets from users who cannot find their conversations.

Before the first production sync, pull the candidate attribute for a sample of users, including people who have changed names or departments, and confirm the value is present, unique and stable across at least one known change. Check the attribute against your directory's own documentation, then confirm the ID attribute choice and its behavior with the Mattermost documentation for the release you run, since sign-in and sync settings have changed between versions. Record the decision in your runbook, because changing it later usually means migrating existing accounts.

Choosing admin filters and group handling for your directory layout

When every user sits in one organizational unit and group membership is shallow, the user filter can be a simple scope over that unit and the group filter can match groups directly. The main question is not how to reach users but which accounts should be active. A filter that matches the whole unit will also pick up service accounts, shared mailboxes and disabled accounts unless you exclude them explicitly. The admin filter in this layout usually points at one named security group, so granting or removing Mattermost system admin rights becomes a directory change that is easy to audit.

  • User filter scope: Limit the search to the unit and exclude disabled accounts so that leavers stop signing in after the next sync.
  • Group filter: Match only the groups Mattermost needs for team or channel mapping, not every group in the unit.
  • Admin filter: Point it at one tightly controlled group, and keep its membership small and reviewed.
  • Service accounts: Confirm that bind accounts and automation identities do not satisfy the user filter.
  • Change control: Record who may add members to the admin group, since that membership grants system console access.

Before enabling any filter, test it with a named set of accounts: one standard user, one administrator, one disabled account and one service account, and confirm the result for each.

Securing the directory bind and login path

Directory sign-in puts your domain controllers in the path of every Mattermost login, so the bind account, transport, search scope and admin mapping need the same care as any other privileged integration. The cards below cover the controls that limit what a compromised Mattermost server or bind credential could reach, and the checks to run before go-live.

Dedicated read-only bind account

Create a separate service account in the directory for the Mattermost bind, with read access to the user objects and attributes that Mattermost needs and no membership in administrative groups. Do not reuse a person's account or a domain administrator credential. Store the bind password outside plain configuration, rotate it on a fixed schedule, and confirm with your directory team how a rotation will be coordinated with the sync job so logins do not fail silently.

TLS with certificate validation

Connect Mattermost to the directory over LDAPS or StartTLS, and have the server validate the directory's certificate chain against a trusted CA rather than skipping verification. Plaintext binds expose the bind password and user credentials on the network. Confirm the certificate's subject name matches the host Mattermost connects to, and confirm the CA certificate is installed on every Mattermost node in a cluster.

Narrow search bases and filters

Point the user search base at the organizational units that hold people who should sign in, not the forest root. Add a user filter that excludes disabled accounts, service accounts and other non-human objects. A broad base lets Mattermost enumerate directory data it has no need for, and makes sync slower and harder to audit. Test the filter with a sample of accounts, including a leaver, before enabling it for all users.

Admin filter limited to a security group

Grant Mattermost system admin only to members of a named, tightly controlled security group, and confirm the admin filter matches that group and nothing broader. A filter that matches a wide department group would make every member a system administrator. Review group membership on the same cadence as privileged access reviews, and remember that changes to the group take effect at the next sync.

Optional TOTP MFA on directory sign-in

You can require a TOTP code in addition to the directory password for LDAP accounts. Once enforced, users without MFA enrolled are blocked until they set it up, so plan enrollment, a help path for lost devices and a communication to users before switching enforcement on. The MFA setup itself is covered on the sibling MFA page. Confirm with your team how it interacts with any upstream MFA already applied by the directory.

Logging directory sign-ins and sync runs

Record directory sign-in attempts, failed binds and sync results, and forward them to the log platform your security team already reviews. Sync runs show deactivated leavers and attribute changes, which are the events most often questioned in an access review. Confirm where Mattermost writes its logs on your deployment, how long they are retained, and who can read them, since the logs may contain usernames and directory identifiers.

Common Mattermost LDAP login failures and their fixes

This table lists the LDAP login failures teams meet most often in Mattermost, with the likely cause, how to confirm it and the fix for each. Check the System Console logs and your directory's own event logs first, because they usually show which step failed before you change any setting.

FailureLikely cause and how to confirmFix
Connection test fails on certificate or portThe server cannot reach the directory on the configured host and port, or the TLS certificate chain is not trusted by the Mattermost host. Confirm with the connection test error in the System Console, the Mattermost server logs, and a network test from the Mattermost host to the directory port.Confirm the LDAP server host, port and TLS setting with your directory team, open the required port through the firewall, and install the internal certificate authority on the Mattermost host so it is trusted. Retest the connection before moving on.
Bind succeeds but no users are foundThe base DN or user filter does not match where user objects sit, so the search returns zero entries. Confirm by running the same search with your directory's own query tool and comparing the base DN and filter to the result.Correct the base DN to the container that holds the users, simplify the user filter, and retest. Check that the bind account has read access to the user objects it needs to search.
Duplicate accounts after an ID attribute changeThe ID attribute was set to a value that changes, such as an email address or display name, so a returning user is matched as a new account. Confirm by comparing the stored AD/LDAP ID on the old and new accounts in the System Console user records.Set the ID attribute to a value that does not change for the life of the account, such as a unique directory identifier, and agree this with your directory team before first sync. Resolve existing duplicates through a planned account merge or migration, not by deleting accounts that hold message history.
Admin rights missing because the admin filter excludes nested membersThe admin filter checks direct group membership only, so users who inherit admin rights through nested groups do not match. Confirm by testing the admin filter against a known admin user and checking whether that user is a direct or nested member.Flatten the group membership the filter reads, or add the admin group as a direct membership for the users who need the role. Confirm the change with a test sign-in and a System Console check of the user's role.
Deactivated directory users can still reach a sessionSessions issued before the account was disabled remain valid until they expire, and sync may not have run since the change. Confirm by checking the account status in the directory, the last sync time in the System Console, and the active sessions for that user.Confirm that AD/LDAP sync runs on a schedule that suits your offboarding process, deactivate the user in Mattermost if sync has not run, and revoke active sessions. Test the offboarding path with a test account before relying on it.
MFA prompts block service or desktop clientsEnforced MFA applies to every LDAP sign-in, including clients that cannot answer a one-time code prompt, such as service accounts and some desktop sessions. Confirm by reviewing which accounts and clients fail and whether the failure follows the MFA prompt.Confirm which clients and accounts must be excluded or changed with your security team before enforcing MFA, and check the current MFA guidance for each client type in the Mattermost documentation. Enforce MFA only after testing each client.

Questions buyers ask before setting up Mattermost LDAP login

Do we need an Enterprise plan for Mattermost AD/LDAP login, or does Professional cover it?

According to the Mattermost pricing page, AD/LDAP user sync is included from the Professional plan, so a Professional subscription covers the directory setup described on this page. Plans are sold as prepaid annual subscriptions based on seat licenses, and the pricing page lists no public prices, so you must request a quote. Confirm the current plan terms with Mattermost sales before you buy, because feature placement can change between releases. High availability and FIPS 140-3 compliance sit in the Enterprise tier, so if those are on your roadmap, decide the plan with them in view.

How long does a single-domain Mattermost LDAP setup take?

The duration depends mainly on the directory, not on Mattermost. A single domain with one clean user object class, a clear group structure and a readable service account moves quickly, while nested groups, multiple organizational units, inconsistent attributes or unclear ownership of the directory add review and testing time. Other drivers are the number of test accounts you need, how many login paths you must validate (web, desktop and mobile), and your change window for the production System Console change. Ask any partner for a fixed-scope plan that lists the directory discovery, test cycle and cutover steps, rather than a single headline number.

What does our team need to provide before LDAP login can be configured?

Prepare the inputs before anyone opens the System Console. You need a bind account with read access to the users and groups in the search base, the directory host names and ports for the connection, and the exact search filters and attribute names that identify users. Add a set of test accounts covering normal users, a disabled account and an account in the admin group, plus a named owner in the directory team who can answer attribute questions. Your change approval process should cover the production switch and a rollback plan, because login changes affect every user at once.

Can an internal Mattermost admin set up LDAP login alone?

A capable internal admin with directory access can usually complete the basic System Console setup, but the work crosses several teams. The directory owner must confirm the unchanging ID attribute, the admin filter and how nested groups are handled, and the security team must review the bind account and TLS settings. Outside help is most useful for directory questions that stall testing, for flattening nested groups correctly, for validating the setup across web, desktop and mobile, and for adding optional MFA. Ask any partner to state which of those items sit in their fixed scope and which remain with your team.

How is the cost of LDAP login setup structured?

The cost has four parts: internal time from the directory, security and Mattermost teams, the Mattermost subscription that includes AD/LDAP sync, and any partner engagement. The subscription is recurring and the setup labor is usually one-time, though you will also pay for later upkeep such as directory changes, Mattermost upgrades and periodic testing. Costs rise with directory complexity, the number of login paths, the number of test cycles and the need for MFA or change windows. When you request a quote, ask for the scope in writing, the deliverables, the test plan, what is excluded and what ongoing support costs. DeployOpen does not publish a price list, and each quote follows from the written scope.

How does LDAP login compare with SAML or OIDC, and does LDAP deactivate leavers?

LDAP login authenticates users against your directory directly, while SAML and OpenID Connect delegate sign-in to an identity provider. Whichever method you choose for sign-in, AD/LDAP sync is the mechanism that keeps profiles current and deactivates departed users, so if you run SAML, you should enable LDAP sync alongside it. Teams often keep LDAP login for a stable directory and add SAML later, so plan the user identifier and the switch carefully. Confirm with Mattermost which combinations are supported for your version and review the Mattermost documentation on SSO and sync before you commit.

What checks show that deactivation and login work correctly after setup?

Test with real directory accounts in a non-production instance before any switch. Confirm that an active user can sign in on web, desktop and mobile, that a disabled directory account cannot sign in after the next sync, and that an account in the admin group receives the expected role. Check that users keep the same Mattermost identity after a username or email change, which depends on choosing the right unchanging ID attribute. Record the results, keep the bind account's permissions documented, and repeat the tests after each Mattermost upgrade. Ask any partner for the test cases and evidence they will deliver with the configuration.

How DeployOpen scopes and delivers Mattermost directory login

DeployOpen plans Mattermost directory login as a fixed-scope piece of work inside infrastructure you control. The engagement covers the directory connection, the System Console settings, admin filters, group handling and the test and handover records your identity and security teams need to review.

How we scope

  • We record the directory layout, the bind account, and the attribute that will serve as the unchanging user ID before any configuration starts.
  • We agree in writing which user and group filters, nested group rules and admin filters the Mattermost login will use.
  • We confirm whether optional MFA is in scope and which Mattermost plan level your organization holds for AD/LDAP sync.

How we build

  • We configure the LDAP connection in the System Console setup wizard on a test server first, then document each setting and its reason.
  • We test sign-in, failed sign-in, locked and disabled accounts, and nested group flattening with named test users from each group.
  • We confirm the directory bind credentials are stored and handled according to your own secrets practice, not in shared configuration files.

How we hand over

  • You receive a written configuration record listing each System Console setting, filter, and attribute mapping with its stated purpose.
  • You receive test evidence showing which accounts signed in, which were refused, and how deactivated users were handled.
  • We walk your identity and platform teams through the runbook for changing filters, rotating the bind account, and reviewing sync results.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, and the retainer scope is agreed in writing.
  • We can retest the directory login after Mattermost server upgrades, which move on monthly releases and Extended Support Releases.
  • Changes to directory structure, group ownership or MFA rules go through a documented review before they reach production.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.