Dendrite

From IM Wiki
Revision as of 04:15, 13 April 2025 by Nyx (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

File:Tango-view-fullscreen.svgThis article or section needs expansion.File:Tango-view-fullscreen.svg

Reason: This article is lacking information, sources, and article documentation. It also includes odd wording and structure. Further research and improvement needed. (Discuss in Talk:Dendrite)

Dendrite is a second-generation open source Matrix homeserver written in Go. It was initially created to replace Synapse. Both of these homeservers implement the client-server and server-server communication APIs to provide a decentralized network of homeservers that run Matrix. As of today it is not the most complete or stable implementation of this protocol, although it is a very minimal implementation that doesn't take a lot of resources to run and is perfect for small instances. Dendrite was initially developed with 2 modes in mind, monolith and polylith, which targeted single server instance and scaled up to multiple servers respectively. Dendrite version 0.11.1 is the last version to support polylith, all versions following are monolith only. For most intents and purposes, it's unmaintained and should not be used for new servers.

Setting up Dendrite[edit | edit source]

Dendrite setup is fairly simple, the true problem is the dendrite.yaml configuration file, but before that, we have to do a couple of pre-configuration changes:

Firstly, of course, we have to clone and compile Dendrite:

$ git clone https://github.com/matrix-org/dendrite
$ cd dendrite
$ go build -o bin/ ./cmd/...

Then we generate a Matrix signing key used for federation requests. We generate it by running the following command:

$ ./bin/generate-keys --private-key matrix_key.pem

Then we get to the real devil, editing the configuration, before that, though, we have to copy the example configuration file to the main, dendrite.yaml file:

$ cp dendrite-sample.yaml dendrite.yaml

Now, open dendrite.yaml in your favorite editor such as Vim.

Configuration[edit | edit source]

Configuration is the hard part where most people fail. This section will only cover the Dendrite configuration, web-server configuration (such as nginx) may be covered in latter sections.

First and foremost you may want to set up delegation and use the domain name for the delegated domain in global.server_name. If you are not delegating, you should just use the domain name of the hosted server (such as localhost).

Then we must set up the database. Dendrite recommends PostgreSQL, and by following the directions the global.database should be set up to use a URL something like this:

postgresql://username:password@hostname/dendrite

Of course you can also use a simpler database (such as SQLite), but that will ruin the performance and will cause issues down the road as your instance grows. A simpler database should only be used for single-user homeservers, otherwise it is suggested for you to use PostgreSQL.

Next, you should set up well_known_server_name and well_known_client_name to allow not only for incoming connections, but also delegation. Examples are shown in the configuration file.

The rest of the configuration is very clear and optional to set, everything else is determined by purely choice, configuration of the web-server and the resources available and allocated to Dendrite.