---
gitea: none
include_toc: true
---

# A complete Matrix installation

This documentation describes how to build a complete Matrix environment with
all bells and whistles. Not just the Synapse server, but (almost) every bit
you want.

The main focus will be on the server itself, Synapse, but there's a lot more
than just that.


## Overview

A complete Matrix environment consists of many parts. Other than the Matrix
server itself (Synapse) there are all kinds of other things that we need:

* [Synapse](https://element-hq.github.io/synapse/latest/)
* Webclient ([Element Web](https://github.com/element-hq/element-web))
* [Element Call](https://github.com/element-hq/element-call) for audio/video
conferencing
* Management with [Synapse-Admin](https://github.com/Awesome-Technologies/synapse-admin)
* Moderation with [Draupnir](https://github.com/the-draupnir-project/Draupnir)
* [Consent
tracking](https://element-hq.github.io/synapse/latest/consent_tracking.html)
* Authentication via
[OpenID](https://element-hq.github.io/synapse/latest/openid.html) (later)
* Several [bridges](https://matrix.org/ecosystem/bridges/) (later)


# Overview

This documentation aims to describe the installation of a complete Matrix
platform, with all bells and whistles. Several components are involved and
finishing the installation of one can be necessary for the installation of the
next.

Before you start, make sure you take a look at the [checklist](checklist.md).

These are the components we're going to use:


## Synapse

This is the core component: the Matrix server itself, you should probably
install this first. 

Because not every usecase is the same, we'll describe two different
architectures:

** [Monolithic](synapse)

This is the default way of installing Synapse, this is suitable for scenarios
with not too many users, and, importantly, users do not join many very crowded
rooms.

** [Worker-based](synapse/workers)

For servers that get a bigger load, for example those that host users that use
many big rooms, we'll describe how to process that higher load by distributing
it over workers.


## PostgreSQL

This is the database Synapse uses. This should be the first thing you install
after Synapse, and once you're done, reconfigure the default Synapse install
to use PostgreSQL.

If you have already added stuff to the SQLite database that Synapse installs
by default that you don't want to lose: [here's how to migrate from SQLite to
PostgreSQL](https://element-hq.github.io/synapse/latest/postgres.html#porting-from-sqlite).


## nginx

We need a webserver for several things, see how to [configure nginx](nginx)
here.

If you install this, make sure to check which certificates you need, fix the
DNS entries and probably keep TTL for for those entries very low until after
the installation, when you know everything's working.


## Element Call

Element Call is the new way to have audio and video conferences, both
one-on-one and with groups. This does not use Jitsi and keeps E2EE intact. See
how to [setup and configure it](element-call).


# Element Web

This is the fully-fledged web client, which is very [easy to set
up](element-web).


# TURN

We may need a TURN server, and we'll use
[coturn](coturn) for that.

It's apparently also possible to use the built-in TURN server in Livekit,
which we'll use if we use [Element Call](element-call). It's either/or, so make
sure you pick the right approach.

You could possibly use both coturn and LiveKit, if you insist on being able to
use both legacy and Element Call functionality. This is not documented here
yet.


# Draupnir

With Draupnir you can do moderation. It requires a few changes to both Synapse
and nginx, here's how to [install and configure Draupnir](draupnir).

