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:
- Go v1.15 or greater
- PostgreSQL database
- Nginx web server
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:
- Clone the Dendrite repository:
git clone https://github.com/matrix-org/dendrite.git
- Build the Dendrite binary:
cd dendrite
make dendrite
- 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.
- 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.
- 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:
- Create an Nginx configuration file:
sudo nano /etc/nginx/conf.d/dendrite.conf
- 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.
- 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.