Dendrite: Difference between revisions

From IM Wiki
Jump to navigation Jump to search
Matrix>Admin
m Fixed typos and unnecessary capitalization of words
Nyx (talk | contribs)
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Expansion|This article is lacking information, sources, and article documentation. It also includes odd wording and structure. Further research and improvement needed.}}
{{Expansion|This article is lacking information, sources, and article documentation. It also includes odd wording and structure. Further research and improvement needed.}}


'''Dendrite''' is a second-generation open source Matrix [[homeserver]] written in Go. It's an alternative to [[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''' is a second-generation open source Matrix [[homeserver]] written in Go. It was initially created to replace [[Synapse]]. Both of these [[Homeserver|homeservers]] implement the [[Client-Server API|client-server]] and [[Server-Server API|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.
 
== The disadvantages of Dendrite ==
 
As mentioned above, Dendrite is not the most stable or complete implementation of the Matrix protocol, even though they try their best, there is still a lot of work to be done regarding the stability and completeness of the implementation.
 
As of now, users tend to prefer Synapse for running their homeserver as although it is fairly slow and heavy, it can be made reasonable fast by using Synapse workers and multi-process communication between them, which Dendrite lacks as Go is a very asynchronous language and in the way it works, it is better (and faster) to just run in [[Monolith Mode|monolith mode]] rater than [[Polylith Mode|polylith mode]].
 
Dendrite and Synapse, being the most popular server implementations, are still the ''de facto'' pieces of software to be run by Matrix users. Although some unofficial server implementations have risen from the Matrix project that are maintained by community members rather than the [[Matrix foundation|Matrix Foundation]], one such example would be the [[Telodendria]] homeserver implementation in pure C.


== Setting up Dendrite ==
== Setting up Dendrite ==
Line 54: Line 46:


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.
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.
[[Category:Homeservers]]

Latest revision as of 04:15, 13 April 2025

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.