DEV Community

Cover image for Planning a Self-Hosted Matrix Rollout: Lessons From the European Commission's 40,000-User Deployment
jamilxt
jamilxt

Posted on Originally published at jamilxt.com

Planning a Self-Hosted Matrix Rollout: Lessons From the European Commission's 40,000-User Deployment

On November 19, 2026, Element published a write-up of how the European Commission rolled out Matrix to more than 40,000 staff. The post summarizes a talk at The Matrix Conference 2026 by two people who ran the project: Diana Gheorghe, Head of Sector for Digital Workplace Communication and Collaboration Services, and Alexandru Vignide, Service Delivery Manager for the Commission's chat tool. The Hacker News discussion has passed 700 points and 370 comments.

The talk and the HN thread spend a lot of time on digital sovereignty. This article reads the same talk as a project plan. The Commission made a small number of clear decisions, then hit four scaling problems that a pilot did not show. If your team is thinking about running its own Matrix server, for 50 people or 5,000, the same decisions are waiting for you.

I have not run a Matrix deployment myself. Everything about the Commission below comes from Element's write-up of the talk. The configuration examples come from the official Synapse configuration manual. Synapse is the original Matrix homeserver (the server program that stores accounts and rooms), written in Python. The latest release at the time of writing is v1.165.0, published November 10, 2026.

What the Commission built, in dates

The timeline in the write-up is short:

  1. Summer 2025: the Commission started working with Matrix.
  2. December 2025: the architecture and engineering team delivered a proof of concept. It was approved as a Commission-wide service.
  3. January to June 2026: the team built the production infrastructure plus the hosting and operations around it.
  4. Pilots: first a laptop pilot covering the desktop and web clients, then a mobile pilot through the Commission's mobile device management (MDM) platform.
  5. July to September 2026: the laptop rollout reached all Commission users in waves.

The result is a tool built on Matrix by Element, run by the Commission itself, with more than 40,000 users. A mobile rollout and federation are still being explored.

Nine months from proof of concept to every laptop is fast for an organization of that size. Note where the time went: about six months on production infrastructure and operations before the rollout waves began.

Decision 1: write down why you are self-hosting

The Commission did not start with software. It started by defining what "sovereignty" meant for them. Their answer had five dimensions:

  • resilience and business continuity
  • vendor diversity
  • control over their data
  • ownership of the platform
  • bargaining power in procurement, meaning the ability to negotiate with a supplier or walk away from one

For internal chat, they ranked resilience, data ownership and interoperability (separate systems being able to talk to each other) as the top needs. That ranking is what pointed them to Matrix, which is an open protocol rather than a single product.

You can copy this step. Before you compare chat servers, write down which of these reasons apply to you and rank them. When someone later asks "why is this harder than Slack?", you can point to the reason you accepted the cost.

Decision 2: decide who runs the servers

Self-hosted does not have to mean your own data center. The Commission's service runs with sovereign cloud providers chosen through a hosting tender awarded earlier in 2026. In the write-up's words, sovereign "means choosing who you depend on, and on what terms."

They also did not build the Matrix stack from scratch. They chose Element Server Suite Pro (ESS Pro), Element's commercial distribution, and operate it themselves.

For smaller teams, Element publishes a free edition. The ess-helm repository describes three editions. ESS Community is AGPL-3.0 licensed and "tailored to small-/mid-scale, non-commercial community use cases", deployed with Helm charts on Kubernetes. ESS Pro is aimed at professional setups "with more than 100 users up to massive scale in the millions". According to that README, Pro adds automatic scaling, in-cluster high availability, LDAP/SCIM user lifecycle management, media malware scanning and auditing.

Read the license terms before you pick. For commercial use, ESS Community is not the intended edition, so the choice is ESS Pro or plain Synapse with your own operations work.

Decision 3: connect the login people already use

The Commission connected the service to EU Login, the sign-in staff already use every day. The write-up's reason is simple: a new tool is easier to adopt when login feels familiar.

In Synapse, single sign-on (SSO) through an OpenID Connect (OIDC) identity provider is set with oidc_providers. The manual also documents attribute_requirements, which lets you allow only users whose identity claims match certain values. A minimal shape looks like this:

oidc_providers:
  - idp_id: company
    idp_name: "Company Login"
    issuer: "https://login.example.com/"
    client_id: "synapse"
    client_secret_path: /run/secrets/oidc_client_secret
    attribute_requirements:
      - attribute: groups
        value: "staff"
Enter fullscreen mode Exit fullscreen mode

Two notes from the manual. client_secret_path keeps the secret out of the config file. And idp_id must not change later: if it changes, users who log in through that provider "will no longer be recognised as the same user". Newer deployments can instead hand authentication to the Matrix Authentication Service (MAS), which Synapse enables with a matrix_authentication_service block.

Account creation is a product decision

The Commission chose user-led account creation. An account exists only after a person registers. They did not pre-create 40,000 accounts.

That choice had a side effect. During the rollout, you could not find a colleague who had not registered yet. According to the write-up, this made the search problem (described below) feel worse while adoption was still growing.

If you want to avoid that, the alternative is to pre-provision accounts from your directory. Synapse's user admin API supports PUT /_synapse/admin/v2/users/<user_id> to create or modify an account, and ESS Pro lists LDAP/SCIM lifecycle management as a feature. Pre-provisioning costs more setup work. User-led creation is cheaper but makes the early weeks feel empty. Pick one on purpose, and tell users which one you picked.

Decision 4: keep federation off until you have governance

Federation means your server can talk to Matrix servers run by other organizations. It is the main reason many people choose Matrix. The Commission still has it turned off.

The write-up says connecting to outside servers is "still under assessment". The technical side is being tested in non-production environments. The harder part is governance: which partners, on what terms, with what scope, and how security and privacy are handled. As Diana Gheorghe put it, there is no point writing policies the technology cannot deliver, so the technical check comes first.

In Synapse, an empty allow list is the documented way to disable federation:

federation_domain_whitelist: []
Enter fullscreen mode Exit fullscreen mode

The manual adds two cautions. First, it recommends also firewalling the federation listener, "rather than relying purely on this application-layer restriction". Second, a non-empty list does not stop your server from joining rooms that other servers are in. It is really meant for a "private federation", where a fixed group of servers all list each other. If you later federate with a few partner organizations, that is the pattern to plan for.

The four problems a pilot did not show

The talk listed four problems that appeared only at full scale. Each one maps to something you can plan for.

1. People on different servers could not find each other

The Commission runs several Synapse homeservers. Early on, users on one server could not always find users on another. The Commission's teams worked with Element on a fix, and now a plain user search finds anyone in the Commission, whichever server they are on.

On a single server, the relevant setting is the user directory. By default, Synapse search only returns users in public rooms or users who share a room with you. For a workplace, you usually want everyone searchable:

user_directory:
  search_all_users: true
Enter fullscreen mode Exit fullscreen mode

The manual notes that this searches all users "known to the homeserver". Search across several separate homeservers is a harder problem, which is why the Commission needed vendor help. If you plan to split users across servers, test cross-server search in the pilot, with real directory sizes.

2. Live presence slowed the service down

Presence is the online/away indicator next to each name. As more users joined, the load from presence started to affect performance, so the team switched it off. They are now looking at a user status feature being developed with Element as the replacement.

Synapse documents the switch directly:

presence:
  enabled: false
Enter fullscreen mode Exit fullscreen mode

Recent versions also expose tuning options under presence, such as last_active_granularity, which the manual says reduces "the rate of presence updates sent to other users and servers" when set higher. If you keep presence on, load-test it with realistic numbers of users and rooms. Do not judge it from a pilot of 200 people.

3. Waves of new users meant uneven load

Rolling out in waves over three months meant demand rose in steps, not smoothly. The team tuned the infrastructure to adjust itself automatically.

In plain Synapse, the main scaling tool is workers. The workers documentation says small instances should run as a single process, and larger ones can split work into separate Python processes. Workers need PostgreSQL (SQLite is for demos only) and use Redis to pass updates between processes. If you expect to grow, start on PostgreSQL from day one. Migrating a live database in the middle of a rollout is not something you want to schedule.

4. Hardening could not break daily tasks

Most security hardening was done with the Commission's security teams before rollout, with regular reviews after. The team made sure hardening did not block everyday actions: creating an account, recovering it, or verifying a new device. They also documented those steps clearly for staff.

In Matrix, device verification is part of how end-to-end encryption (E2EE, where only the devices in a conversation can read messages) works. That makes account recovery and new-device steps a common place for users to get stuck. Write the guide before rollout, not after the first support ticket.

Why Matrix needs more server resources than simpler chat

In the HN thread, a commenter whose profile lists him as Matrix.org project lead and Element CEO/CTO explained where the cost comes from. Matrix copies each room's state (who joined, names, permissions, room settings) between all servers in the room, as a graph of events. In a room with 100,000 users, each server keeps at least 100,000 state events. When the state changes, each server runs a merge step the project calls "state resolution". A simple implementation loads all of the room's state to do it, and that is "typically where the heaviness comes from".

What you get in return, he wrote, is decentralized access control and resilience when networks split. He also said nothing in the protocol makes this heavy by nature, and mentioned a fork shown at the Matrix Conference that cut CPU use 10x by moving the hot path from Python to Rust. Treat that as a statement about work in progress, not about the release you install today.

The practical point for planning: very large rooms cost more than many small rooms. A single "all staff" room with tens of thousands of members is the expensive case. If you plan to have one, include it in your load tests.

Matrix compared with a SaaS chat suite

The most common question the Commission gets is whether Element replaces Microsoft Teams, or consumer apps like Signal and WhatsApp. Their answer is "neither, directly". As the write-up puts it, Teams bundles communication, collaboration and a whole platform behind it, so there is no one-to-one swap. Element is positioned as an internal tool for specific uses, including secure communication, where the existing stack does not fully meet their needs.

That framing helps with a fair comparison:

  • Control: self-hosted Matrix gives you the data, the servers and the choice of supplier. A SaaS suite gives you a contract.
  • Operations: with Matrix, upgrades, backups, scaling and security reviews are your job (or your hosting partner's). With SaaS, they are the vendor's.
  • Scope: a suite like Teams covers chat plus collaboration tools. A Matrix chat service is one piece, and other tools stay separate.
  • Encryption trade-offs: E2EE protects messages but makes some things harder. In the HN thread, one commenter whose small team tried Element said link previews were off by default and giving people or AI agents access to full channel history took extra steps. That team moved to Zulip. An Element engineer replied that link previews got many changes this year, including optional previews in encrypted rooms.
  • Interoperability: Matrix can connect separate organizations through federation. With SaaS, cross-company chat depends on what the vendor supports.

On the server side, URL previews are also off by default in Synapse. The manual says url_preview_enabled defaults to false, and if you enable it, you must also set url_preview_ip_range_blacklist so the server cannot be used to reach internal addresses.

The Commission also stressed expectation-setting: people compare a work tool with the apps they use at home and look for a feature-by-feature match. Saying clearly what the tool is for is part of the rollout.

A rollout checklist you can copy

Based on the Commission's decisions and the Synapse documentation:

  1. Write down your reasons for self-hosting (resilience, data control, supplier choice, interoperability) and rank them.
  2. Decide who runs the servers: your team, a hosting partner, or a managed distribution. Check the license of the edition you pick.
  3. Start on PostgreSQL, so you can add workers later.
  4. Connect SSO through oidc_providers or MAS, and never change idp_id after launch.
  5. Choose user-led or pre-provisioned accounts, and tell users which one you chose.
  6. Set user_directory.search_all_users: true and test search with your real directory size, across every homeserver you run.
  7. Set federation_domain_whitelist: [] and firewall the federation port until governance is agreed.
  8. Load-test presence, or plan to turn it off.
  9. Decide on URL previews and set the IP blocklist if you enable them.
  10. Write and test the device verification and key recovery guide before the first wave.
  11. Roll out in waves, and plan for load to rise in steps.
  12. Set expectations: say which jobs the tool replaces and which it does not.

The Commission summed up its own lessons in three lines. Sovereignty depends on operational control and trustworthy partners, and hosting location is only one part of it. Adoption depends on everyday usability. Interoperability needs governance as well as technology.

None of those is a server setting. Which of these decisions is your team still missing?

Sources

Top comments (0)