Running a closed, non-federated Matrix server for data residency

A closed Synapse homeserver keeps chat data in your infrastructure only if federation, outbound requests and administrative access are configured and evidenced. This page maps the GDPR transfer requirements to those settings and names what they do not solve.

On this page

Does a closed Matrix server keep chat data in your infrastructure?

A regulated organization that wants chat data to stay inside its own infrastructure needs two answers: which settings on a self-hosted Synapse server keep data where you put it, and which obligations depend on things no homeserver setting controls. On the first question, Synapse gives you three levers. The federation_domain_whitelist setting restricts federation to listed domains, and an empty list disables it entirely, so messages do not leave for other homeservers. The ip_range_blacklist setting blocks the server's outgoing requests to listed CIDR ranges, which limits where the server can reach on its own initiative. Running the database, media store and homeserver on infrastructure you operate covers the remaining storage question. Confirm each setting against the configuration manual for the Synapse version you run, and firewall the federation listener as the docs recommend, because a configuration value alone is not an enforced network boundary.

These settings do not settle the transfer questions. Under the GDPR, the EDPB's Guidelines 05/2021 treat storage in a cloud outside the EEA, and remote access from a third country even for support, as transfers. A homeserver that is closed to federation can still be hosted by a provider whose staff or infrastructure sit outside the EEA, so the hosting contract, support access and backup locations all need review. Third-country authority access is also outside the server's control: the US CLOUD Act reaches providers regardless of data location, and Article 48 limits how foreign disclosure orders are enforced in the EU. No Synapse setting addresses these exposures. Certification is also outside the server: the GDPR requires no audit or certificate, and DeployOpen prepares systems, configuration evidence and controls for your assessors but does not issue audit reports, attestations or certifications. Ask your legal and compliance teams to map each hosting location and access path before you rely on the server for residency.

Mapping GDPR transfer requirements to Synapse settings

This table maps each GDPR transfer requirement to the Synapse setting that can help meet it, the configuration it needs, and what stays with your legal, contractual and operational controls. Read it as a boundary: server settings limit where messages can flow, but they do not decide whether a transfer is lawful or whether an outside party can compel access to data you hold.

RequirementSynapse capabilityConfiguration neededOutside the server settings
Article 44 transfers, including onward transfersfederation_domain_whitelist restricts federation to listed domains; an empty list disables federationSet an empty or narrowly listed whitelist, and record each permitted partner domain and why it is allowedWhether a partner's own hosting or sub-processing is a third-country transfer, and any transfer mechanism you rely on
EDPB 05/2021: remote access and cloud storage outside the EEAip_range_blacklist blocks outgoing requests from Synapse to listed CIDR ranges; defaults cover private and reserved rangesConfirm the blacklist is active, add ranges for any service you must not reach, and test outbound calls from the hostHosting location, vendor support sessions with screen access, backup locations and administrator access from outside the EEA
Article 32 security of processingFirewalling the federation listener on port 8448 closes the inbound federation path that the whitelist alone does not coverBlock port 8448 at the network edge, restrict the listener to approved hosts, and log denied connectionsEncryption keys, staff access reviews, incident response and testing evidence that an assessor will ask for
Article 48: third-country disclosure ordersNo Synapse setting prevents a foreign authority from compelling a provider with access to your dataChoose hosting and support providers after assessing their exposure to third-country law, and keep keys under your controlLegal assessment of each request, contractual notice duties, and whether an international agreement applies to recognition of the order

Which Synapse controls restrict federation and outbound traffic

Synapse offers several settings that keep a homeserver from talking to other servers or reaching internal networks. Each one covers a different path, so a closed deployment needs more than one of them. Review them together, then confirm each change against the network rules that actually enforce it.

Empty federation domain whitelist

Setting federation_domain_whitelist to an empty list disables federation, so the server does not exchange events with any other homeserver. This stops room joins and message exchange with outside servers at the application level. It does not stop your own users from using the homeserver's public client API, and it does not stop the listener from accepting connections if the port stays open. Check the effective setting after every config change.

Configuration manual

Partner domain allowlist

When a partner must connect later, list only its exact domains in federation_domain_whitelist. Every domain not on the list is refused, which keeps the set of connected servers small and reviewable. The allowlist controls which servers are accepted, not what they do after connecting, so room membership and retention still need governance. Ask each partner for the server name it uses, since a name that differs from its web domain will not match.

Firewalling the federation listener

Synapse serves federation on port 8448 by default, and the configuration manual recommends firewalling that listener in addition to the whitelist. A network rule blocks connections before any Synapse logic runs, so a misconfigured whitelist cannot expose the port. Confirm the rule at the host, load balancer and cloud security group layers, since any one of them can open the path. Also check whether a reverse proxy forwards the federation listener to the public internet.

Outbound blocking with ip_range_blacklist

ip_range_blacklist stops Synapse from making outgoing requests to listed CIDR ranges, such as URL previews, identity lookups or push and integration calls. Its defaults cover private and reserved ranges, which limits server-side request forgery toward internal services. The setting covers only requests made by Synapse itself. It does not restrict containers, sidecars or other processes on the same host, so keep egress firewall rules in place as well.

Configuration manual

Fixed server_name for identity

The server_name setting fixes the domain used in every user ID and room ID, such as @user:example.com. Changing it later does not rename existing accounts or rooms, so it must be settled before the first user is created. A closed deployment still depends on it, because clients and any future federation identify your data by this name. Record the value in your architecture documentation and in the data residency register.

Delegation settings to review

Delegation lets user IDs on one domain be served from another host reached on port 443, which changes where federation and client traffic goes. A delegation record that points to a host outside your infrastructure would route federation elsewhere even when the whitelist is empty. Review the well-known responses and DNS records for the server name, and confirm that they point only to hosts you run. Repeat the review after any DNS or proxy change.

Federation docs

Configuring a closed Synapse homeserver step by step

This sequence turns a default Synapse install into a homeserver that does not federate, cannot make arbitrary outbound requests, and admits users only through your own identity provider. Each step ends with a check that proves the setting is in force.

  1. Fix the server name and hosting location

    The platform team sets server_name in homeserver.yaml to your own domain before any users or rooms exist, because that value becomes part of every user ID and room ID. Record the data center or cloud region where the homeserver, PostgreSQL, media store and backups will run, since this is the location your data residency position depends on. Done when the configured name matches the domain your clients will use and the hosting location is written into the change record.

  2. Set the federation domain allowlist

    Set federation_domain_whitelist in homeserver.yaml to an empty list if no partner server may connect, or to the exact domains of approved partners if some may. The security owner signs off on the list before it is applied. Restart the homeserver and confirm that a room invitation from an unlisted domain is refused, which shows the allowlist is active rather than only present in the file.

  3. Firewall the federation listener

    The Synapse configuration manual recommends firewalling the federation listener in addition to the allowlist, so an application-level setting is not the only control. Block inbound traffic to port 8448 at the host firewall, load balancer and any cloud security group, and remove any reverse proxy rule that forwards it. Confirm the result from a host outside your network: the port should not answer, while client traffic on port 443 still works for your own users.

  4. Block outbound requests to private and reserved ranges

    Review ip_range_blacklist, which controls the CIDR ranges Synapse may not contact when it makes outgoing requests such as URL previews or media fetches. Its default covers private and reserved ranges, so keep those defaults and add your internal management networks and any address space that should never be reached from the homeserver. Then review egress rules at the network layer so the homeserver can only reach the services it needs, such as the database, Redis, the identity provider and your mail relay. The check is an outbound test from the homeserver host to an address outside the allowed list, which should fail.

  5. Restrict sign-in to your identity provider

    Configure single sign-on through your identity provider, using oidc_providers or saml2_config in Synapse, or through Matrix Authentication Service if your deployment uses it, then disable open registration so no account can be created from the login screen. Confirm which login methods Synapse still offers and remove any that bypass your identity provider. Test that a new user without an assigned identity account cannot register, and that a deprovisioned user cannot sign in.

  6. Verify from outside the network

    Run the checks from a system that sits outside your network, not from an administrator's workstation inside it. Confirm that federation endpoints on port 8448 do not respond, that the client API responds only through the approved reverse proxy, that an external server cannot join or invite into your rooms, and that the homeserver cannot reach a blocked range. Keep the test commands and their output as evidence, and retest after every configuration or network change.

  7. Record settings as change-controlled configuration

    Store homeserver.yaml, the firewall rules, the egress policy and the identity provider settings in version control, and require a reviewed change for each modification. Each change record should name the approver, the reason and the test that confirmed it. Before any Synapse upgrade, read every set of upgrade notes between your current version and the target, because a release can change configuration keys and database schema, and rollback can be difficult once the schema has changed. Repeat the verification step after each upgrade.

Trust boundary for a closed Synapse deployment

The diagram starts with users and SSO inside the organization's infrastructure. Clients reach the Synapse main process and its workers through the reverse proxy, and those processes share state through PostgreSQL and Redis, all within the boundary. The federation listener is blocked at the firewall, so no inbound federation traffic reaches the homeserver. Outbound requests pass through ip_range_blacklist, and any partner connection is a deliberate, allowlisted path set in federation_domain_whitelist. Check that the firewall rule, the allowlist and the outbound range controls each match your written data residency decision.

Components inside the boundary, with the blocked inbound federation path and the one allowlisted partner route.

Evidence an assessor will ask for from a closed Synapse server

An assessor reviewing a closed Synapse server will want proof of three things: that federation is off, that outbound traffic is restricted, and that the configuration and platform underneath are documented and current. The cards below cover the records that show each claim, and the routine that keeps each record accurate over time.

Versioned homeserver.yaml and change records

Keep homeserver.yaml in version control with every change tied to a reason, a reviewer and a date. Pay particular attention to federation_domain_whitelist, ip_range_blacklist and listener settings, since these decide whether data can leave the server. Check monthly that the running file matches the repository, because a config edited directly on the host is the most common gap an assessor finds.

Synapse config manual

Firewall rules and unreachability tests

Record the firewall rules that block the federation listener, which Synapse uses on port 8448 by default, and the outbound rules for the homeserver host. Keep test results showing that an external host cannot reach the federation port and that the server cannot open connections to disallowed destinations. Rerun these tests after every network change and after each Synapse upgrade, and store the output with the date and the tester's name.

Federation domain whitelist history

An empty federation_domain_whitelist disables federation, so the setting itself is the evidence. Keep a dated history of every value it has held, with the approval for each change. An assessor will ask who approved any partner added to the list, when federation was opened, and whether it was closed again. Confirm that the recorded history matches the configuration deployed on each date.

Synapse federation docs

Egress and ip_range_blacklist configuration

Document which outbound destinations the homeserver may reach, including identity providers, push gateways, TURN servers and bridges. Show how ip_range_blacklist is set against the private and reserved ranges it covers by default, and whether any additions were made. Ask your team to confirm the full list of outbound dependencies with each integration owner, since an undocumented dependency is an unexplained data flow.

Hosting and backup location records

Maintain a register that names the data center or cloud region hosting the homeserver, the PostgreSQL database, media storage and every backup copy, with the legal entity that operates each location. Include the location of any administrator access path, because remote viewing from a third country can count as a transfer. Review the register whenever a backup target or support provider changes.

Synapse release and upgrade records

Keep a log of each Synapse version in production, the date it was deployed, the upgrade notes reviewed and the platform floors checked, such as PostgreSQL and Python minimums. Record the rollback plan for each upgrade, since schema changes can make rollback difficult. Check the upstream release list regularly so the log shows the server running a supported release rather than one that has fallen behind.

Synapse upgrade notes

What closing federation does not resolve

Closing federation keeps room traffic off other homeservers, but it does not decide where every copy of your chat data sits or who can compel access to it. Closed federation addresses one data flow only. The federation_domain_whitelist setting and a firewalled federation listener stop server-to-server replication, yet the cloud host, backup target, object storage, log pipeline and support access paths remain outside that control. DeployOpen does not issue audit reports, attestations or certifications for your setup, so the evidence you hand to an auditor or supervisory authority must come from your own records and an independent assessor. Ask your counsel which of your storage locations and administrative sessions count as transfers under Chapter V of the GDPR, and ask each provider where backups are written and which staff can view data in the clear.

The legal exposure follows the provider's jurisdiction, not the homeserver's topology. The US CLOUD Act provision at 18 U.S.C. 2713 requires covered providers to preserve or disclose data in their possession, custody or control whether it sits inside or outside the United States, so a US-parented cloud or support vendor may face such demands even when your servers are in the EEA. Article 48 of the GDPR limits recognition of third-country disclosure orders to those based on an international agreement in force, which is a question to put to counsel for each third-country request path. On transfer adequacy, the Court of Justice invalidated the Privacy Shield in Case C-311/18 (Schrems II) while upholding standard contractual clauses. Commission Implementing Decision (EU) 2023/1795 covers only organizations on the Data Privacy Framework List, and the appeal in Case C-703/25 P is pending, so confirm your provider's current status and the fallback terms in your contract.

Technical measures may not close the gap if an authority's powers exceed what is necessary and proportionate. The EDPB's Recommendations 01/2020 state that where a provider needs clear-text access and the destination's public authority powers go beyond that standard, the EDPB cannot envision an effective technical supplementary measure. Encryption at rest with keys you hold, or end-to-end encryption in rooms, may still be part of your design, but the question for counsel is whether the residual exposure is acceptable and documented. Ask the provider for its government access policy, its notice commitments and its challenge process, and record the answers in your transfer assessment before you accept a third-country processor.

Questions buyers ask before hiring outside help

What drives the cost and effort of a closed, non-federated Matrix server?

Cost follows the scope you agree in writing, and the largest drivers are how many environments you need, how many identity sources and rooms policies must cover, and how much evidence your compliance team expects. Closing federation itself is a configuration step, so most effort goes into the surrounding work: PostgreSQL, reverse proxy, outbound request controls, backups, and documenting the decisions. Quotes should separate one-time build work (design, deployment, hardening, testing) from recurring work (upgrades, monitoring, retainers). Ask for each item to be listed with its owner, and ask what happens if your infrastructure inputs arrive late.

How long does a closed Matrix deployment take, and why does it vary?

Duration depends on your environment more than on the Matrix software. The main variables are how quickly you can provide hosting, DNS, certificates, identity provider access and a decision on which partners may connect later. Scale also matters: a single process homeserver is simpler than one that needs worker processes and Redis replication. Upgrade planning adds time because the Synapse upgrade notes warn that rolling back can be difficult after database schema changes, so each release needs reading and testing. Ask a partner for a timeline tied to named milestones and client dependencies rather than a single number.

What does the work need from our side before it starts?

The work needs inputs from four groups. Network teams must confirm where the homeserver runs, which ports are open internally, and how the federation listener is firewalled. Identity teams must provide the OpenID Connect, SAML or CAS source the server will use, since Matrix Authentication Service uses upstream OpenID Connect providers and does not support SAML directly. Legal and privacy teams must confirm the data categories, retention rules and any transfer restrictions that shape the design. Hosting teams must confirm the infrastructure you control, including backups and the locations where data will be stored.

Can our internal team run a closed Matrix server without a partner?

Yes, many teams can, provided they have operators who know Linux, PostgreSQL, reverse proxies and identity federation. The Synapse documentation gives the core settings, including federation_domain_whitelist and ip_range_blacklist, but the team still needs to test them, document them and keep up with upgrades. Consider whether the team can keep pace with each Synapse release, since the upgrade notes call out dropped Python and PostgreSQL versions. A partner is most useful for the first build, an independent review of your configuration, or a retainer that covers upgrades and testing. Estimate internal effort by listing the skills and hours your team has available each month.

How should we plan for partners that need to connect later?

Plan partner connections as a change to your federation policy, not as a later clean-up. Synapse's federation_domain_whitelist accepts a list of domains, so each partner can be added deliberately after a review of its identity, retention and hosting. Record the approval owner, the business reason and the data that will flow. Test the change in a non-production environment, because the federation listener and outbound request rules interact with your firewall. Note that federated rooms carry history into other servers, so the policy should state how that history is handled before the connection goes live.

Does closing federation make our Matrix server compliant with data protection law?

No. Closing federation reduces one flow of data, but it does not by itself establish compliance with the GDPR. Article 32 security of processing, the breach notification duties in Articles 33 and 34, and the transfer rules in Chapter V all apply to the whole service. The EDPB Guidelines 05/2021 state that remote access from a third country, even only displaying data on a screen, and storage in a cloud outside the EEA are transfers, so your hosting and support access matter as much as federation. The GDPR requires no audit or certificate, and certification under Article 42 does not reduce your responsibility. Independent assessors and your legal team decide what your obligations are.

What does DeployOpen provide for a closed Matrix deployment?

DeployOpen plans, implements, hardens, backs up, documents and supports self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For a closed Matrix server, that can include the homeserver build, identity integration, outbound request controls, testing and the evidence your compliance teams ask for. DeployOpen prepares systems and evidence but does not issue audit reports or certifications. Most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts, and a quote follows from that written scope.

How DeployOpen scopes and delivers a closed Matrix deployment

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own cloud accounts, data centers or air-gapped networks. For a closed Matrix server, that means fixing the federation and outbound request policy in writing before any installation, then handing over evidence your compliance and security teams can review.

How we scope

  • Written scope names the homeserver, the federation policy and the list of domains allowed to connect, if any.
  • Scope records where Synapse, PostgreSQL, media storage and backups will physically run and who can reach them.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.

How we build

  • Set federation_domain_whitelist to an empty list, or to the agreed partner domains, and confirm the setting on the running server.
  • Firewall the federation listener and restrict outbound traffic, using ip_range_blacklist and network egress rules agreed with your team.
  • Test that rooms cannot reach remote servers, that delegation is inactive and that outbound requests fail as designed.

How we hand over

  • Documentation covers the federation policy, network egress rules, the partner onboarding procedure and the reasons each setting was chosen.
  • Runbooks cover how to add a partner domain later, including the review, testing and change record it requires.
  • Handover includes a retest of the closed configuration so your team can repeat the check after upgrades.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainers can cover Synapse upgrade reviews, so federation and egress settings are rechecked against each new release.
  • Ask for the support boundary in writing: which settings DeployOpen maintains and which stay with your operations team.

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.