Project

General

Profile

Actions

How to install Matrix on Debian Buster

You must a Debian Buster server with Public IP address.

Enable backports, add the following line in /etc/apt/sources.list

deb http://deb.debian.org/debian/ buster-backports main contrib non-free

Then install Matrix

apt update
apt -y install -t buster-backports matrix-synapse

During the setup, you will be asked to choose the domain, like climathon.today.

You have then to create the following entries into the DNS
matrix.<you-root-domain> A <public IP address of your server>
_matrix._tcp.<you-root-domain> SRV 5 443 matrix.<you-root-domain>

Install Nginx

apt -y install nginx certbot python3-certbot-nginx -t buster-backports

Do configuration into the file /etc/matrix-synapse/homeserver.yaml and update at least the following items.

no_tls: True
enable_registration: True
trusted_third_party_id_servers:
    - matrix.org
    - vector.im
    - riot.im
    - uni-shenzhen.com
    - climathon.today

Install certificates, when requested, just place the domain matrix.

certbot --nginx

Redirect everything to https when requested.

Edit the file /etc/nginx/sites-enabled/default and add the following into server{} where is your matrix. hostname.

location /_matrix {
   proxy_pass http://localhost:8008;
   proxy_set_header X-Forwarded-For $remote_addr;
}

Install Riot.IM Web interface

cd /var/www/html
rm index.nginx-debian.html
wget https://github.com/vector-im/riot-web/releases/download/v1.5.3/riot-v1.5.3.tar.gz
tar xzvf riot-v1.5.3.tar.gz
cp config.sample.json config.json

Then replace into config.json everywhere there is matrix.org

{
    "default_server_config": {
        "m.homeserver": {
            "base_url": "https://matrix.<you-root-domain>",
            "server_name": "<you-root-domain>"
},
...
    "roomDirectory": {
        "servers": [
            "<you-root-domain>"
        ]
},

Updated by Olivier Bitsch over 4 years ago · 1 revisions