Synapse user directory: search all users or shared rooms only

Synapse's user directory decides who appears when staff search for colleagues in Element. This page covers the search_all_users setting, the privacy cost on a federated server, and when a dedicated directory worker helps.

On this page

Making colleagues findable in Element search on Synapse

If staff cannot find each other in Element search, the cause is usually the user directory, not the client. On Synapse, the user directory only lists users who share a room with the searcher or who sit in a public room, and that default is set by user_directory.search_all_users, which is false unless you change it. On an internal server where everyone should be reachable by name, you can set it to true so search returns every known user on the homeserver. Teams usually make this switch when new hires cannot be found before they have joined any shared rooms, or when onboarding depends on people messaging colleagues directly.

Before you change the setting, confirm which users Synapse counts as known. Accounts created through your identity provider, imported accounts and service or bot accounts can all appear in results, so review how many accounts exist and whether any should stay hidden. Check the setting in the configuration manual for your installed Synapse version and test with a few accounts from different teams. Also confirm that your client, Element Web, Element X or another, passes the search to the homeserver as you expect, since search behavior differs between clients and versions.

The trade-off changes on a federated server. With search_all_users set to true, a user on your server can search for and see the profiles of users on other servers they have never shared a room with, which may expose names and avatars to outsiders and creates a privacy question for your data protection team. Decide this with that team before enabling it, and keep the default if your server federates with organizations you do not trust. If search load grows, the workers documentation describes a dedicated worker for user directory updates through update_user_directory_from_worker, which can only run as a single process and cannot be load-balanced, so plan one designated worker rather than several.

Which user directory setting fits your server

This table compares user_directory.search_all_users set to false and true, plus the update_user_directory_from_worker option, for an internal server and a federated one. Read each row as a question about your server type, then check the search result and the trade-off that follows. The main takeaway is that a true setting makes search broader but exposes more user identities on a federated server.

Setting or optionInternal only serverFederated serverTrade-off to weigh
search_all_users: false (default)Search returns users who share a room with the searcher or who are in public roomsSearch returns only users who share a room or are in public rooms, including remote users once they share a roomLowest exposure, but a new colleague may not appear until they share a room
search_all_users: trueSearch returns all known users on the server, so colleagues are findable before any shared room existsSearch returns all users the server knows about, which can include remote users and expose local accounts to any searcherBetter findability for staff, but a wider directory of identities that the privacy review must accept
Who the setting suitsCompanies that want every employee findable in Element search from day onePublic or community servers where open discovery is intended and the operator accepts the exposureConfirm with your privacy and HR owners before enabling it on any server with external users
update_user_directory_from_workerNot needed on a single-process serverDesignates one worker to update the directory on a worker-based deploymentOnly one worker can be designated, and it cannot be load-balanced
Dedicated user directory workerHelpful when directory updates slow the main process on a busy serverHelpful for large federated servers with heavy user churn, after you confirm the loadAdds a worker, Redis replication and routing to maintain
Verification stepCreate two test accounts with no shared room and confirm search results match your choiceTest search from an account on another server and from a shared roomRetest after each Synapse upgrade, since search behavior depends on your configured setting

How the user directory is built and searched

The user directory is the index that Synapse uses to answer a user's search in Element. It is built from the users the homeserver knows about, and the setting user_directory.search_all_users decides how far that index is exposed. By default the value is false, so a search returns only users who share a room with the searcher or who are in a public room. Setting it to true makes the search return all known users. For an internal server, the practical question is therefore which accounts the homeserver knows about and which rooms your staff share, because those two facts define what a colleague can find before any directory setting is changed.

Visibility comes down to three groups. Users who share at least one encrypted or unencrypted room with the searcher appear. Users who are members of a public room that the searcher can see also appear. Everyone else is hidden under the default. Element shows these results in its invite and start-chat dialogs, but the exact list of fields, avatars and ordering depends on the Element version your staff run, so confirm the behavior with a test pair of accounts on your own build before you tell users what they will see. Accounts that were created but never joined a room are a common surprise, since they are not reachable by name under the default setting.

Before you change search_all_users, decide whether your staff should be able to find people they have never shared a room with, and whether the homeserver is federated. On a federated server, a true value means the index can include users from other servers that your server has seen, so the setting exposes more than your own staff list. Record the decision, test it with a non-admin account, and confirm with your Synapse version's configuration manual how the setting interacts with your room directory and federation policy before rollout.

How user directory updates reach search

The flow starts when an account is created or a user joins or leaves a room. Synapse writes that change to the user directory tables, either in the main process or in a single worker designated with update_user_directory_from_worker. When a colleague types a name in Element, the search request reads those tables, and the user_directory.search_all_users setting decides whether the result covers every known user or only users who share a room or sit in public rooms. Check which path your deployment uses before you test search.

How membership changes feed the user directory and how search scope is decided.

Configuring search_all_users on an internal server

This sequence confirms that the server is closed to federation, enables search across all known users in Element, and proves the change with test accounts, leaving a record that an administrator can review later.

  1. Confirm the server is internal and not federated

    The platform owner and the Synapse administrator check the federation settings before touching the directory. Open homeserver.yaml and confirm that federation_domain_whitelist is set to an empty list, which disables federation, and that the federation listener is not reachable from outside your network. Check the firewall rules and the reverse proxy routes for port 8448 and for any delegation records that point at this server. Do not continue until you can state in writing that no other homeserver can reach this one. The output is a short note with the setting values, the firewall check and the name of the person who verified them.

  2. Record the current directory behavior

    Before changing anything, the administrator logs in as a test account and searches for a colleague who shares no rooms with them. Synapse defaults user_directory.search_all_users to false, so the expected result is that the colleague does not appear unless they share a room or sit in a public room. Save the search result and the configuration file version as a baseline. This baseline lets you show later that the only change was the one setting. The output is a dated baseline entry that names the test accounts used.

  3. Set search_all_users in homeserver.yaml

    The administrator edits the user_directory block in homeserver.yaml and sets search_all_users to true. Keep the rest of the block unchanged, and keep the file under version control or a copy of the previous version so the change can be reverted. Validate the YAML syntax with the tooling your team uses before the next step. Confirm that the key sits under user_directory and not at the top level, because a misplaced key is silently ignored. The output is a reviewed diff that shows one changed line.

  4. Restart Synapse and check the startup log

    The administrator restarts the Synapse process, including any worker processes that run from the same configuration, using the service manager your deployment uses. Watch the startup log for configuration errors and confirm the main process starts without warnings about the user directory. If you run workers, check that the worker handling user directory updates is running, since the Synapse workers documentation designates a single worker for these updates. The output is a clean startup log and a note of the restart time.

  5. Test with accounts that share no rooms

    Create or use two test accounts that belong to no common room and to no public room. Log in as the first account in Element and search for the second by display name and by Matrix ID. The second account should now appear. If it does not appear, wait for the directory to catch up, then check that both accounts exist on this server and that the searching account is not on a federated server. Repeat the search from the second account. The output is two recorded search results, each showing the expected account.

  6. Check that rooms and profile data still behave as expected

    Verify two points that matter for the rest of the deployment. First, confirm that a user with no profile data still follows your display name and avatar rules, because search results reflect the profile data in the directory. Second, confirm that the account you use to search can still see only rooms it is authorized to join, since this setting changes user search and not room access. Log the findings with the test accounts. The output is a pass or fail note against each point, with any exceptions assigned to an owner.

  7. Document the setting in the change record

    The administrator adds an entry to the change record with the date, the server name, the key and value changed, the file version, the test accounts and their results, and the name of the approver. Include the reason for the change, such as making colleagues findable on an internal server, and the privacy trade-off that the directory now lists every known user. Store the record where your security and compliance reviewers can find it. The output is a closed change record that an auditor or new administrator can read without asking the original owner.

The privacy cost of searching all users on a federated server

Turning on user_directory.search_all_users trades convenience for visibility, and on a federated server that visibility can reach people outside your organization. The cards below cover what becomes searchable, who can reach the search, and what to review before changing the default.

User IDs and display names exposed

With search_all_users set to true, any local account that can log in can search for every user the server knows about, including IDs and display names of people they share no room with. On an internal server this is usually the goal. Check whether display names contain sensitive detail such as roles, customer names or employee numbers, because those become searchable by anyone with an account.

Reachability through federation

A federated server can be contacted by other homeservers, so the question is whether those servers can take part in the search. Review federation_domain_whitelist and the federation listener before enabling the setting. The docs recommend firewalling the federation listener too, so confirm that the directory is not reachable by remote servers you did not intend to serve.

Synapse configuration manual

Dependence on another server's account policy

On a federated server, the accounts that appear in results include users registered on other servers only where they have shared rooms with local users, so your directory reflects the registration and abuse controls of those servers too. Ask whether your own registration is closed, whether it is open to the public, and whether you trust the identity of accounts on the servers you federate with before publishing their names.

Directory visibility for new staff

New employees can find colleagues in search on their first day, which speeds onboarding. The same search also reveals the structure of the organization to any account, including contractors, guests or a compromised login. Decide which account types should be able to search, and whether a guest account should see the full list before it is granted access.

Offboarding and stale accounts in results

Deactivated or departed accounts can remain in the known-user set, so they may still appear in search long after the person has left. Build the offboarding step to deactivate the account, remove it from rooms and confirm that it no longer appears in a test search. Review how your offboarding process handles accounts that were never in a shared room, because those are the entries most likely to linger.

Review checklist before enabling

Before changing the default from false, confirm which accounts can log in, which servers can federate with yours, what display names reveal, and who must be able to search. Run a test search from a standard account and from a guest account on a staging server. Record the decision and the review date so the setting is revisited when federation or registration policy changes.

When a dedicated user directory worker helps

A single-process Synapse server does not need a separate directory process. The main process maintains the user directory itself, and for a small user base the search index stays small and cheap to update. Adding workers here adds Redis, replication settings and routing rules without a matching gain in search speed, so the simpler layout is usually the right one until traffic or user count justifies splitting out roles.

  • Keep the default layout: Leave update_user_directory_from_worker unset so the main process handles directory updates.
  • Set search scope first: Decide on user_directory.search_all_users before considering any worker change, since scope affects what users see far more than process layout does.
  • Watch for the trigger: Revisit the layout when directory updates start competing with client traffic on the main process or when the user count grows substantially.
  • Avoid premature splitting: A server that is not yet under load gains no benefit from extra processes, and each one is another thing to upgrade and monitor.
  • Record the current state: Document that the main process owns directory updates so the next operator does not add a worker without a reason.

Before changing anything, confirm the user count, the load pattern and whether directory updates are a measured problem or an assumed one.

Security and operational checks for the directory

Turning on search across all users widens what every account can discover, so the change needs guardrails around who can edit the config, how accounts are created, and how the directory worker behaves over time. The cards below cover the checks that keep that wider visibility intentional and reversible.

Restrict access to config and admin API

Anyone who can edit homeserver.yaml or call the Synapse admin API can flip user_directory.search_all_users and change who is visible. Limit file write access to the operators who own the Synapse host, and confirm that the admin API listener is not reachable from the public internet or from general staff networks. Check the setting after each deployment, since a config management run can silently overwrite a manual edit.

Synapse configuration manual

Log and review account creation

Search across all users only helps if the accounts it exposes are the right ones. Review how accounts are created, whether through self-registration, an identity provider, or manual admin creation, and keep a record of who created each account and when. A periodic review of recently created accounts shows whether unexpected users are appearing in colleagues' search results.

Monitor the directory worker

If you run a dedicated worker for directory updates, confirm that exactly one worker is designated for update_user_directory_from_worker and that it is not placed behind a load balancer. Watch its logs and resource use after restarts, and alert when it stops processing updates, because stale results will look like missing colleagues to users. Confirm the failover approach with your own platform team before relying on it.

Handle deactivated users

Confirm how deactivated accounts appear in search results once you widen visibility, and test the path from a leaver's identity provider record to a deactivated Matrix account. Decide whether deactivated users should be removed from directory results and whether their rooms need ownership changes. Document the steps so offboarding does not depend on one administrator remembering them.

Align with registration and auto-join

Search visibility interacts with how users join the server. Check whether open registration is enabled, which identity provider links accounts, and whether auto_join_rooms places every new user into shared rooms. Any of these can create more shared-room connections than you expect, so review them together before and after changing the directory setting.

Version the change in Git

Store homeserver.yaml and related override files in version control so the directory setting has a reviewed history and a clear rollback point. Require a pull request for changes to user directory options, and record the Synapse version next to each config revision. Versioned config also makes it easy to show an auditor when visibility was widened and who approved it.

Questions teams ask before changing the user directory

Is changing the user directory setting really a one-line change?

Yes, the change itself is one line: setting user_directory.search_all_users to true in the Synapse configuration file, then restarting the homeserver. The setting defaults to false, so search returns only users who share a room with the searcher or who are in public rooms. The line is simple, but the consequences are not. Once it is enabled, every local account that is known to the server becomes searchable by every other local user in Element. Before you make the edit, confirm which accounts exist, which of them are service or bot accounts, and whether your identity provider already limits who can sign in. Treat the change as a directory policy decision with a short test plan, not as a config tweak.

What does the team need before changing user directory search?

The team needs three things in place before the change goes live. First, admin access to the Synapse configuration and a way to restart the homeserver during an agreed window. Second, a written test plan that covers a normal user search, a search by display name and by Matrix ID, a check that deactivated accounts do not appear, and a check that service accounts behave as expected. Third, sign-off from the owner of the identity source, usually the team that runs your identity provider or HR feed, because that owner decides which people should be findable. Also confirm who receives the rollback instruction, since reverting the setting is simple but users may already have seen the wider results.

Can our own administrators make this change without a partner?

Yes, a team with Synapse experience can make the change alone, and for a small internal server with a clear directory policy that is often the right path. The work is the configuration edit, a restart, and testing from several accounts. Where teams need outside help is in the surrounding decisions: how the directory relates to the identity provider, whether the server also runs workers, and how the change is documented for auditors or privacy reviewers. Internal teams should check the Synapse configuration manual for the exact key and the version they run, and confirm the behavior in a staging environment that mirrors production user data.

When is a dedicated user directory worker worth the effort?

A dedicated worker is worth considering when the directory update load grows enough that the main process or a shared worker is slowing the homeserver, or when you already run a workers setup and want directory updates isolated. The update_user_directory_from_worker setting designates a single worker for user directory updates, and that worker cannot be load-balanced, so you need one dedicated process rather than several. The setting does not change who can be found, so it does not fix the privacy question. Add a worker only after you have measured a need, because each worker adds configuration, Redis replication and an operational component to monitor, back up and upgrade.

How does federation change the privacy trade-off for user search?

On an internal server that does not federate, enabling search across all users mostly exposes your own staff directory to your own staff. On a federated server, the picture is different. Users on other homeservers can be known to your server through shared rooms or invitations, and widening search can make more accounts discoverable across the boundary than your policy intends. Synapse's federation settings, such as federation_domain_whitelist, limit which domains you talk to, and an empty list disables federation entirely. Decide whether your server must federate at all before you widen search, and document which accounts are meant to be findable by people outside the organization.

What should a partner scope and quote from written requirements?

A partner should scope the work from written requirements, not from the config key alone. The useful inputs are the intended search policy (all staff, department only, or shared rooms only), the identity sources and which accounts are service or guest accounts, whether federation is on and to which domains, whether workers are already in use, the Synapse version and database in production, and the staging environment available for testing. From those, the quote should name the review of the current configuration, the change and rollback plan, the test cases and their evidence, the documentation for privacy and identity reviewers, and whether a worker design is included. Ask for each item to be listed as a deliverable, with the owner and the acceptance test written down. DeployOpen does not publish a price list, so the quote follows from that written scope.

What do we need to confirm about our Synapse version before we change it?

Confirm the Synapse version in production and read the upgrade and configuration notes for that version before editing the file. Check that the key is documented for your release, since configuration options can change between versions. Also confirm your database and Python versions meet the upstream floors for the release you run, because Synapse drops support for older versions once they reach upstream end of life. If the current version is behind, plan the upgrade as its own change with its own test window, rather than bundling it with a directory policy decision. Record the version, the config diff and the test results so the change can be reviewed later.

How DeployOpen scopes Synapse directory and search changes

DeployOpen starts this work by writing down the server type and federation policy before any setting changes. The first question is whether the Synapse homeserver is internal only or federates with other servers, because the answer decides whether user_directory.search_all_users exposes colleagues only or also exposes accounts on remote servers. We record the server_name, the federation_domain_whitelist value, whether the federation listener is firewalled, and which accounts can already see each other through shared rooms. The written scope names the Synapse version in use and confirms any change against the Synapse configuration manual for that release.

Next, the search behavior is agreed in writing with the security and HR owners before anyone edits the configuration. The decision is who should be findable by whom: all known users, or only users who share a room or sit in a public room. HR often needs to confirm how leavers, contractors and external guests are handled, and security needs to confirm what a directory lookup reveals on a federated server. The agreed rule, its owner and the review date go into the change record, so the setting is not flipped later by someone who never saw the discussion.

DeployOpen then tests with staged accounts on a non-production copy: internal users, a guest, a deactivated account and, where federation is on, an account on a remote server. Each account searches for the others in Element, and the results are compared with the agreed rule. If update_user_directory_from_worker is used, the test also checks that a single designated worker handles directory updates, since that worker cannot be load-balanced. The final configuration, any worker changes, the test results and the rollback steps are documented in infrastructure the client controls, so the client's own team can rerun the checks after future Synapse upgrades.

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.