Installing Synapse from the Matrix.org Debian packages

Installing Synapse from packages.matrix.org gives Debian and Ubuntu servers a current, upgradable homeserver, but the package still needs PostgreSQL, a server_name decision and a patch process that reads every upgrade note.

On this page

Installing Synapse from packages on Debian or Ubuntu: what it gives you

The Matrix.org Debian packages are a sound install path if your IT team wants Synapse running on a server it controls, with the operating system's package manager handling the binaries and service unit. They are not a shortcut past the operational work. You still choose the server name, provision PostgreSQL, write the configuration, and decide how upgrades are tested. Synapse is the Python homeserver developed by Element and distributed under AGPL-3.0-or-later, so your legal and procurement teams should review that license before you deploy, and the package repository is the upstream source for that code.

The packages give you a systemd-managed Synapse install with its dependencies pinned to the supported Python and database versions for each release. The upstream documentation recommends PostgreSQL for production, with SQLite supported for small or test installs. Plan the database as a separate component from day one, with its own backups and locale settings, because moving a live homeserver from SQLite to PostgreSQL later is a migration project. Synapse 1.143.0 and later require PostgreSQL 14 or newer, so confirm the database version on your hosts before you pick a release. Check the Synapse upgrade notes for the current platform floors rather than relying on what your distribution ships.

The main alternative routes are the official container image and the Element Server Suite Helm chart on Kubernetes. A package install gives your team direct control of files in /etc/matrix-synapse/ and the host, which suits a single-server deployment with your own patch cadence. Containers and Kubernetes move configuration, secrets and rollbacks into image and chart workflows, and they add orchestration you must run. Distribution packages can lag upstream releases, so confirm which Synapse version your repository provides, and decide whether your patch process will track the Matrix.org repository directly or your distribution's channel.

How the package, config, database and proxy fit together

The diagram starts at the Matrix.org apt repository, which supplies the Synapse package to the host. The package installs the systemd service, which reads homeserver.yaml and connects to PostgreSQL over the internal network. Client traffic enters through the reverse proxy on port 443 and is forwarded to Synapse's client listener. Federation traffic on port 8448 should either reach a separate listener that you firewall to trusted peers or be avoided entirely through delegation. Check that the proxy, not the internet, is the only public path into the listener.

Synapse package, config, database and the public-facing paths around it.

Why distribution packages lag behind Synapse releases

Debian and Ubuntu repositories tend to ship older Synapse builds than the upstream release line. The reasons are tied together: distribution freeze policies, runtime floors that move with each Synapse release, and end-of-life dates for Python and PostgreSQL. Check each one before you decide which package version your patch process can accept.

Distribution freeze policies

A distribution fixes its package set for a release and usually accepts only security and bug fixes after that point. A new Synapse feature or schema change may never reach that release. Before you install, confirm which Synapse version the repository currently offers for your OS release, and record it in your change log so you know exactly what you are running.

Python floors rise with releases

Synapse 1.142.0 and later require Python 3.10 or newer. If your distribution's default Python is older, the newest Synapse cannot run on that base without a different interpreter. Check the interpreter version on the target host against the upstream upgrade notes before you plan a package upgrade.

PostgreSQL floors rise with releases

Synapse 1.143.0 and later require PostgreSQL 14 or newer. A host still running an older PostgreSQL major version will block the upgrade even when the Synapse package is available. Decide early whether PostgreSQL is upgraded on the same host, moved to a separate server, or managed by a database operator, because that choice sets how fast you can follow Synapse.

Support ends with upstream runtimes

Synapse drops support for Python and PostgreSQL versions once upstream reaches end of life. A distribution can keep an older runtime alive longer than upstream supports it, so a package that installs cleanly may fall outside Synapse's supported matrix. Track the end-of-life dates for your runtimes and treat them as a deadline in your patch calendar.

Rollback is harder than install

The upgrade notes warn that rolling back can be difficult because database schema changes between releases are not always reversible. A package manager will downgrade files without reverting the database. Take a verified PostgreSQL backup before every package upgrade, and do not plan on a package downgrade as your recovery path.

Patch process and upgrade notes

Package upgrades still need the same review as any other change. Read the upgrade notes for every release between your current version and the target, check background database updates, and confirm which configuration changes are required. Ask your team to decide who approves a Synapse package version and how quickly security releases are applied.

Synapse upgrade notes

When the package fits and when a container or ESS fits better

A Debian or Ubuntu host that your team already patches with the operating system is the environment the packages suit best. Your team owns the configuration file, the PostgreSQL database, the systemd unit and every upgrade, and the package manager applies new Synapse versions alongside other system updates. Rollback is your responsibility, and the upgrade notes warn that schema changes can make it difficult, so you need a database backup taken before each upgrade.

  • Configuration: Your team edits homeserver.yaml and the files under the configuration directory directly, and keeps them in version control.
  • Database: You create and tune PostgreSQL yourself, including backups and restore tests.
  • Upgrades: Package updates arrive through apt, so you should read the upgrade notes for every release before the package manager runs.
  • Rollback: Restoring a pre-upgrade database snapshot and a pinned package version is the realistic path, so confirm both before you start.
  • Patch process: Schedule Synapse upgrades as a separate change from routine OS patching, so a failed homeserver upgrade does not hide behind an unrelated kernel update.

Confirm with your own change process whether your team can hold the package version and restore a database within your maintenance window.

Package installation options and when each fits

This table compares the four choices to settle before installing Synapse from packages: database engine, process model, federation policy and update cadence. Read each row as a decision with a fit, a trade-off and the facts that constrain it. The main takeaway is that PostgreSQL, a federation policy and a pinned update process are the defaults most production homeservers should start from.

DecisionChoose it whenTrade-off to acceptCheck before committing
PostgreSQLProduction use, expected growth, or any setup that needs a database you can back up and tuneAnother service to install, secure and back up; the database must meet Synapse's version floorConfirm the PostgreSQL version your Synapse release requires (1.143.0 and later need PostgreSQL 14 or newer)
SQLiteShort-lived test servers or a single-user evaluation where you accept it is not the documented production pathFewer moving parts, but the Synapse documentation recommends PostgreSQL for productionConfirm you can migrate off SQLite later, since the upgrade path is not something to plan around
Single processSmall community or internal server with modest traffic and no need to split client, federation or event workSimplest to operate and upgrade, but one process handles all traffic and there is no load splitWatch request latency and CPU on the host before adding complexity
Workers with RedisTraffic has outgrown one process or you need to separate client, federation and event handlingRedis becomes a required component that relays replication between the main process and workers, adding monitoring and failure modesPlan worker types and Redis hosting first; the generic worker handles client, federation and event traffic
Federation with a domain whitelistYou need to talk to a known set of partner homeservers while limiting who can reach youFederation stays enabled for listed domains only, so the whitelist must be maintained as partners changeFirewall the federation listener as the docs recommend, since the whitelist alone does not protect the port
Federation disabledInternal-only deployments or networks where no external Matrix servers should be contactedUsers cannot talk to people on other homeservers; an empty whitelist disables federationConfirm this matches your policy before users are onboarded, since changing it later affects room membership
Apt pinningProduction servers where every Synapse version change should go through your change process and test windowYou must review and apply upgrades manually, and you take on the upgrade-notes reading for each releaseRead the upgrade notes for every version between your pin and the target, since rollback can be difficult
Automatic updatesLab or low-risk servers where the team accepts unattended package changes and has tested backupsA release can change the database schema without a human reviewing the notes firstConfirm backups and a restore test exist before enabling unattended upgrades on a database-backed service

Installing Synapse from packages.matrix.org step by step

This sequence takes a clean Debian or Ubuntu server to a running Synapse homeserver with a fixed server_name, a PostgreSQL database and a verified test login. Each step ends with a check you can repeat before moving on.

  1. Confirm the host meets version floors

    Your platform engineer checks the operating system release, the installed Python and the PostgreSQL server before anything else is installed. Synapse 1.142.0 and later need Python 3.10 or newer, and 1.143.0 and later need PostgreSQL 14 or newer. Check the release you plan to install against the upgrade notes, since Synapse drops support for versions that reach upstream end of life. Run the Python and PostgreSQL version commands and record the output. The step is done when both versions meet the floor for the release you chose.

  2. Add the Matrix.org repository and signing key

    The person who administers the server adds the Matrix.org package repository and its signing key to apt, so the matrix-synapse package comes from the publisher rather than the distribution archive. Distribution packages often lag the upstream release, so this step decides which Synapse versions you can receive. Run an apt update and then check the package policy for matrix-synapse. The step is done when apt lists the Matrix.org origin as the source of the package and the update completes without signature errors.

  3. Install the Synapse package

    Install the matrix-synapse package with apt. The Debian package prompts for a server name during installation, so enter the permanent name you chose for your user IDs and confirm it. Installing the package also creates the service account and directory layout that the rest of the steps use. Check the installed version with the package query command and compare it with the release you planned. The step is done when the package shows as installed and the version matches your plan.

  4. Review homeserver.yaml and fix server_name

    Open the generated homeserver.yaml and confirm that server_name matches the value you decided on, because changing it later changes how users and rooms are identified. Check the listener section, the database section (which should point to PostgreSQL rather than SQLite for production), and the federation_domain_whitelist setting. Set registration to disabled unless you have a planned sign-up process, and set report_stats to match your policy. Keep the file readable only by the service account. The step is done when every setting you reviewed matches the written design for the server.

  5. Create the PostgreSQL database with the correct locale

    The database administrator creates a dedicated PostgreSQL role and an empty database for Synapse, owned by that role. The database must be created with the locale that the Synapse documentation requires for PostgreSQL, and the value should be confirmed in the current upgrade and PostgreSQL setup notes before you run the command. Set the database connection values in homeserver.yaml to match. Verify by connecting as the Synapse role and listing the databases to confirm the encoding and collation. The step is done when the Synapse role can connect, and the collation shown matches the documented requirement.

  6. Start the service and read the status

    Enable and start the matrix-synapse service with systemd, then read its status. On the first start, Synapse creates its schema in the empty database, which can take some time on a new server. Read the journal output for the service and look for database errors, configuration parse errors or listener binding failures. Fix any error before you continue, because a partial schema is harder to recover than a clean install. The step is done when the service reports active, and the log shows the listeners starting without errors.

  7. Verify listeners and federation settings

    The network engineer checks that the client listener answers on the local interface and the federation listener on its configured port, and that the reverse proxy or firewall rules match the design. Request the client versions endpoint on the local address, and confirm that the federation port is reachable only from the networks you intend. Review federation_domain_whitelist: an empty list disables federation, and the Synapse docs recommend firewalling the federation listener as well. The step is done when the endpoints respond as designed and federation exposure matches your written policy.

  8. Run a test login and record the result

    Create a test account with the register_new_matrix_user command run as the Synapse service account, then sign in with a Matrix client pointed at the server. Confirm that the login succeeds, that the user ID shows the server_name you set, and that a test room can be created. Delete the test account afterward and record the result, the Synapse version and the config file hash in your change log. The step is done when the test login works, the user ID is correct and the test account is removed.

Fitting Synapse package upgrades into your patch process

Synapse packages move faster than most distribution repositories, and each release can change the database schema and the platform it needs. The practices below turn a package update into a controlled change: read the notes, protect the data, schedule the window, plan for a limited rollback, and track the runtime floor before Synapse forces the issue.

Read every set of upgrade notes

Read the upgrade notes for every release between your installed version and the target, not only the newest one. Changes that matter often appear in an intermediate release, such as a new required setting, a deprecated option or a database step. Record each note that affects your configuration and confirm it against your homeserver.yaml before the package install.

Synapse upgrade notes

Back up the database first

Take a consistent PostgreSQL backup and copy the signing key and homeserver.yaml before any package upgrade. Test that the backup can be restored on a separate host, because a Synapse upgrade that runs database migrations cannot be reversed by reinstalling the old package. Keep the media store in the same recovery plan, since the database and media files must match.

Schedule upgrades in a change window

Apply package upgrades in an agreed change window with users notified, rather than when the unattended upgrade timer fires. Some releases run background database updates after the process starts, so allow time to watch logs and confirm the homeserver answers client and federation requests. Name an owner who can stop the change and decide whether to roll back.

Plan for limited rollback

Assume you cannot return to the previous version once the database schema has changed. Synapse's upgrade notes warn that rolling back can be difficult because of schema changes between releases. Your recovery path is usually a restore from the pre-upgrade backup, so confirm the restore time with your team and agree who approves that step.

Track Python and PostgreSQL end of life

Synapse drops support for Python and PostgreSQL versions once upstream support ends, and it raises its floors in releases. Check the distribution's Python and PostgreSQL versions against the Synapse requirements before you pin the target release. Schedule the platform upgrade as its own change so it lands before the Synapse release that requires it.

PostgreSQL 14 floor
1.143.0

Questions teams ask before installing Synapse from packages

How much effort does a Synapse package install take, and what drives it?

The install itself is short, but the effort depends on what surrounds it. Effort rises with the number of components you must stand up: the server name and DNS records, certificates, a reverse proxy, a PostgreSQL instance with the correct locale, SMTP for password resets, and any single sign-on connection. Each of these needs an owner, a change ticket and a test. Expect the most time in decisions you cannot undo, such as the permanent server name and the federation policy, and in verifying that clients and federated servers reach the homeserver correctly. Ask any partner to split their quote into those components so you can see which ones your team already covers.

Can our internal team install Synapse from packages without outside help?

Yes, a team with Linux administration, PostgreSQL and reverse proxy experience can usually do it, provided it reads the upgrade notes for each release and keeps a rollback plan. The risk sits in the parts that rarely appear in a quick guide: database settings, forwarded headers, federation exposure and secrets handling. Check whether your team has run a Python service on a current Debian or Ubuntu release, has a PostgreSQL DBA or a named owner for the database, and can test restores before go-live. If two or more of those are missing, outside help is worth pricing.

What does the installation need from our environment?

Plan for six inputs before the first package is installed:

  • A permanent server name and DNS records for the homeserver host, agreed with the identity owner.
  • A valid TLS certificate and a reverse proxy that forwards the client and federation paths.
  • A PostgreSQL instance you can back up, with the database created using the locale Synapse requires.
  • An SMTP relay for account email, plus a mailbox or alias for operator contact.
  • Outbound network rules for federation, or a documented decision to restrict it.
  • A patch calendar that includes Synapse releases, the operating system and PostgreSQL, with a named person who reads each upgrade note.
How long will the install and first upgrade take in our environment?

No general duration applies, because the time depends on your server, database, network approvals and change windows. The fastest path is a test host that mirrors production, where the team can measure the install, confirm delegation and run one upgrade. Ask any provider for a timeline built from that test, listing each dependency, such as DNS propagation, certificate issuance and approvals for firewall changes. Upgrades usually take longer than installs, because they include database schema changes and a tested restore point. Confirm the expected duration against the upgrade notes for the version you plan to run.

Why do distribution packages lag behind Synapse releases, and does that matter?

Distribution repositories often ship older Synapse builds than the packages on packages.matrix.org, because each distribution tests and freezes its own release cycle. Lag matters when you need a security fix or a feature that the packaged version does not include. Check which Synapse version your operating system provides, compare it with the current release on the Synapse releases page, and decide whether to use the upstream repository and track it under your patch process. Record the source you chose so future upgrades start from a known state.

Do package upgrades fit into our existing patch process?

They fit if you treat Synapse as a stateful application rather than a routine operating system update. Before each upgrade, read every set of upgrade notes between your current and target version, take a database backup, and confirm the platform floors, such as the PostgreSQL and Python versions the release requires. The upgrade notes warn that rolling back can be difficult because of database schema changes, so the restore procedure matters more than the rollback command. Add a test upgrade in a staging environment to the calendar before each production window.

When does a partner's fixed-scope engagement make sense?

A fixed-scope engagement makes sense when the scope, deliverables and timeline can be written down before work starts and your team lacks the time or skills to build them. DeployOpen plans, implements, hardens, documents and supports self-hosted platforms inside your own infrastructure, and most engagements are fixed-scope with terms agreed in writing. It also suits a first install that must pass a security or compliance review, because the documentation and evidence come out of the build. Ongoing upgrades can move to a retainer. DeployOpen does not publish a price list, so ask for a quote built from a written scope that lists the components above.

What a DeployOpen Synapse package engagement covers

A DeployOpen package engagement for Synapse starts with a written scope that names the target hosts, the Debian or Ubuntu release, the Synapse package version to install, and the components that will sit around it. Typically that covers the Synapse install from the Matrix.org package repository, the homeserver.yaml and signing key setup, the systemd service, PostgreSQL as the database, the reverse proxy and federation listener decisions, and the update procedure your team will follow afterward. The scope also states what is out of scope, such as Redis-backed workers, Matrix Authentication Service, SSO integrations or Element Web hosting, so that those can be quoted separately. Deliverables are agreed in writing before work begins, and a quote follows from that written scope. Ask for the exact list of deliverables, the environments covered (for example, staging and production), and whether the package install will be tested against a restore from backup.

Handover is where a package-based install either becomes operable or stays dependent on the partner. Ask for the configuration as files in version control with secrets kept out of the repository, a record of the decisions made (server_name, federation policy, database locale and retention), a runbook for applying package updates, and a tested procedure for restoring PostgreSQL and the media store. Confirm also how the upgrade notes for each Synapse release will be reviewed before a package update, who approves it, and whether a rollback point is taken first, since the upstream notes warn that rolling back can be difficult because of database schema changes. Your team should confirm which of these deliverables are included in the fixed scope and which are offered as ongoing support, since update work recurs for as long as you run Synapse.

How DeployOpen delivers Matrix homeserver installs

DeployOpen plans, installs and hands over Synapse from the Matrix.org Debian packages inside infrastructure you control. We agree the scope in writing first, then build, test and document the server so your own team can run and patch it.

How we scope

  • Confirm the Debian or Ubuntu release, host count and whether Synapse runs on one server or in a planned worker layout.
  • Agree in writing which packages, PostgreSQL version, reverse proxy and email settings are in scope.
  • Record your patch process, package source mirror and change window so upgrade steps match your controls.

How we build

  • Install Synapse from the packages.matrix.org repository, pin the release and set up the Python and PostgreSQL floors it requires.
  • Configure server_name, federation settings and the federation_domain_whitelist to match your federation policy, then test them.
  • Verify the service, database connection, listeners and logs, and document each step taken on the host.

How we hand over

  • Deliver a written runbook covering package upgrade steps, the upgrade notes you must read, and backup and restore checks.
  • Walk your administrators through checking package versions, applying updates and confirming the service after each change.
  • Provide a record of configuration decisions, open items and the items you must confirm with your own security and compliance teams.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer, with the scope agreed in writing.
  • Review each new Synapse release and package update against your installed configuration before you apply it.
  • Retest federation, authentication and admin access after significant package or platform changes, as the retainer scope defines.

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.