Engineering problem

Self-Host a Matrix Server with Synapse and Element

Pilot a Matrix homeserver, decide whether to federate, and test new-device recovery before moving a group’s conversations.

Editorial update

Decision in brief

Pilot Synapse with PostgreSQL and Element when you need to administer accounts and rooms under your own domain and can handle upgrades, storage, and recovery. Use a closed pilot if only your users need access. Allow federation when participants need external Matrix rooms or accounts, with moderation and support responsibilities assigned.

Choose room access: Closed pilot — Own users. Federation — External rooms. Either way — Assign support.
Pilot accounts and rooms on your own domain, and assign moderation, upgrades and recovery before opening access.

Decide who should reach your homeserver

Choose the Synapse server name before creating users. It appears in Matrix identifiers and is intended to remain stable. Delegation lets a public identity domain direct traffic to a separate host. Configure server and client discovery as applicable and verify both with external devices before inviting a federated room.

Deploy the official Synapse package or image with TLS, PostgreSQL, restricted account provisioning and media limits appropriate for your pilot. Record the database, media store, configuration and server signing keys needed for recovery. Encrypted message history has a separate recovery path. Verify a new Element session with each test user's recovery key as part of the drill.

Group requirementPilot configurationGo-live check
Family or internal teamClosed homeserver, approved accounts, and the intended phone and desktop clientsConfirm invites, notifications, and encrypted history on a fresh client. Validate the configured federation boundary.
Community across providersFederated homeserver with a stable domain and a moderation ownerInvite a controlled account on a second server, exchange messages and files, and exercise room moderation.
Encrypted rooms with device turnoverElement encrypted backup and a documented key recovery processRecover a representative encrypted event from a clean device without the original session.
Mandatory uptime with no on-call ownerEvaluate managed Matrix hosting using the same fixturesCheck responsibility for database, media, patching, and service recovery against the plan.

What HN operators have actually tried

In a long-running Matrix hosting discussion, pferde reported running a family-only homeserver with federation disabled for years. This is an example of a closed group whose users could satisfy their needs with local membership.

In a separate thread, pkulak described packaging a self-hosted agent for a family Matrix room after building it through repeated use. That experience makes a useful test fixture for integrations. If your group needs one, include a low-privilege test account and check how it behaves across server and client upgrades.

Pilot with three users and two rooms

  1. Choose a test hostname, set up Synapse, PostgreSQL, and TLS, and create three test accounts with public registration disabled. Record the server name, versions, media location, and permitted network paths.
  2. Use desktop and mobile clients to send ten messages and two attachments in both a standard and an encrypted room. Confirm sync, notifications, and new-device decryption. For the federated design repeat with a controlled external account. For the closed design verify the external account is denied.
  3. Take an off-host server backup and restore it to a clean host in an isolated environment with the same test server identity. Sign in from a fresh profile using a stored test recovery key and open the prior attachments and encrypted messages.
  4. Proceed only if all fixtures survive, federation behaves as intended, and restore meets the group's agreed recovery time. For a three-user pilot, try one hour. Stop if losing the original user's device prevents encrypted history recovery or if no one can own upgrades and moderation.

Related articles