How to install Dendrite on Manjaro

Dendrite is a Matrix homeserver written in Go. It is the default homeserver for new Matrix.org accounts and is designed to be scalable, efficient, and easy to set up. In this tutorial, we will guide you through the installation process of Dendrite on Manjaro.

Prerequisites

Before installing Dendrite on Manjaro, you need to make sure you have the following dependencies installed:

You can install these dependencies using the following command:

sudo pacman -S go postgresql nginx

Installing Dendrite

To install Dendrite on Manjaro, follow these steps:

  1. Clone the Dendrite repository:
git clone https://github.com/matrix-org/dendrite.git
  1. Build the Dendrite binary:
cd dendrite
make dendrite
  1. Create a PostgreSQL user and database:
sudo -u postgres createuser dendrite
sudo -u postgres createdb dendrite
sudo -u postgres psql

In the PostgreSQL prompt, run the following commands:

ALTER USER dendrite PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE dendrite TO dendrite;
\q

Replace password with a secure password for the Dendrite user.

  1. Configure Dendrite:
cp dendrite-config.yaml.sample dendrite-config.yaml

Edit the dendrite-config.yaml file with your preferred configuration options. You need to specify the PostgreSQL connection details and the port for the HTTP listener.

  1. Run the Dendrite server:
./dendrite-monolith-server

You should see logs indicating that Dendrite is running.

Configuring Nginx

To access Dendrite from the internet, you need to configure Nginx as a reverse proxy. Follow these steps:

  1. Create an Nginx configuration file:
sudo nano /etc/nginx/conf.d/dendrite.conf
  1. Add the following configuration:
upstream dendrite {
    server 127.0.0.1:8008;
}

server {
    listen       80;
    server_name  example.com;

    location / {
        proxy_pass http://dendrite;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Replace example.com with your domain name.

  1. Test the configuration:
sudo nginx -t

If there are no errors, reload Nginx:

sudo systemctl reload nginx

Dendrite should now be accessible on your domain name.

Conclusion

You have successfully installed Dendrite on Manjaro and configured Nginx as a reverse proxy. You can now start using Dendrite as your Matrix homeserver.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!