Installing Riot on Debian 10
Traducciones al EspañolEstamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Riot is an open source complete communication service. You can use Riot to chat, exchange files, make voice or video calls, and add bots; all while keeping control of your data. Riot is a Matrix web client.
NoteRiot has been renamed to Element. You can read more about this name change on the Element blog. This guide uses the Riot naming to refer to this Matrix web client.
Before You Begin
If you have not already done so, create a Linode account and Compute Instance. See our Getting Started with Linode and Creating a Compute Instance guides.
Follow our Setting Up and Securing a Compute Instance guide to update your system. You may also wish to set the timezone, configure your hostname, create a limited user account, and harden SSH access.
Note
If you choose to configure a firewall, remember to open ports 80 and 443 for the server when you reach the configure a firewall section of the guide.To connect to the Synapse / Matrix services with a client other than Riot, you need a Matrix client.
NoteThis guide is written for a non-root user. Commands that require elevated privileges are prefixed withsudo
. If you’re not familiar with thesudo
command, see the Users and Groups guide.
Setup DNS
In this guide the base domain is demochat.com
. Ensure that you replace demochat.com
with a registered domain name in the following steps. Each service gets a separate subdomain as a general hygiene measure.
So in this example, create DNS records for:
demochat.com
(General website and hosting for.well-known
path to advertise Matrix services.)matrix.demochat.com
(Synapse)riot.demochat.com
(Riot)
Set each of the above DNS records to the public IP address of the Linode instance.
Refer to Add DNS Records for more information on configuring DNS entries or consult your DNS provider’s documentation if using an external DNS provider.
Install Riot
Install Synapse
Install Synapse using its Debian packages:
sudo apt install -y lsb-release wget apt-transport-https sudo wget -O /usr/share/keyrings/matrix-org-archive-keyring.gpg https://packages.matrix.org/debian/matrix-org-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/matrix-org-archive-keyring.gpg] https://packages.matrix.org/debian/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/matrix-org.list sudo apt update sudo apt install matrix-synapse-py3
Enable registration on the Synapse instance by setting
enable_registration: true
in your/etc/matrix-sysnapse/homeserver.yaml
file:- File: /etc/matrix-sysnapse/homeserver.yaml
1 2 3
... enable_registration: true ...
Restart Synapse to enable your configuration:
sudo systemctl restart matrix-synapse
Configure the rest of Matrix to find the server. The easiest way is to publish a
.well-known
file that indicates thehostname
andport
where the Synapse fordemochat.com
is available.sudo mkdir -p /var/www/html/demochat.com/.well-known/matrix echo '{ "m.server": "demochat.com:443" }' | sudo tee /var/www/html/demochat.com/.well-known/matrix/server
Install the Latest Riot/Web Release
In this section, you use the latest .tgz
release from the
Element repository (formerly know as Vector and Riot) to install the Matrix web client.
Grab the latest .tgz release from (
https://github.com/vector-im/riot-web/releases) and check the GPG signature.
Create a new directory to store Riot, move into the directory, and install Riot from the latest release. As of writing this guide the latest version is
v1.5.15
. Ensure you replace any instance of1.5.15
with your own desired version.sudo mkdir -p /var/www/html/riot.demochat.com cd /var/www/html/riot.demochat.com sudo wget https://github.com/vector-im/riot-web/releases/download/v1.5.15/riot-v1.5.15.tar.gz
Verify your installation’s GnuPG signature:
sudo apt install -y gnupg sudo wget https://github.com/vector-im/riot-web/releases/download/v1.5.15/riot-v1.5.15.tar.gz.asc
Grab the signing key for the riot releases repository. Ideally this is done from a key server:
sudo gpg --keyserver keyserver.ubuntu.com --search-keys releases@riot.im
Verify that you receive a
Good signature
response when you validate the signature:sudo gpg --verify riot-v1.5.15.tar.gz.asc
Extract the Riot
.tar.gz
file you installed. Ensure you replacev1.5.15
with your own installation’s version number.sudo tar -xzvf riot-v1.5.15.tar.gz sudo ln -s riot-v1.5.15 riot
Move into the
riot
directory and create a copy of theconfig.sample.json
and name itconfig.json
.cd riot sudo cp config.sample.json config.json
Open the
config.json
file you created and updatebase_url
andserver_name
with the values in the example file.- File: /var/www/html/riot.demochat.com/riot/config.json
1 2 3 4 5 6 7 8 9 10 11 12 13
{ "default_server_config": { "m.homeserver": { "base_url": "https://matrix.demochat.com" "server_name": "demochat.com" }, "m.identity_server": { "base_url": "https://matrix.demochat.com" } } ... } ...
Install and Configure NGINX and Let’s Encrypt
In this section, you use NGINX as your web server and Let’s Encrypt to secure your services.
Install NGINX:
sudo apt -y install nginx
Create the vhost files for each subdomain:
sudo touch /etc/nginx/sites-available/{demochat.com,matrix.demochat.com,riot.demochat.com} ln -s /etc/nginx/sites-available/demochat.com /etc/nginx/sites-enabled/demochat.com ln -s /etc/nginx/sites-available/matrix.demochat.com /etc/nginx/sites-enabled/matrix.demochat.com ln -s /etc/nginx/sites-available/riot.demochat.com /etc/nginx/sites-enabled/riot.demochat.com
Add your site configuration to each of the configuration files you created in the previous step.
- File: /etc/nginx/sites-available/demochat.com
1 2 3 4 5 6 7 8 9 10 11 12 13
server { listen 80; listen [::]:80; server_name demochat.com; root /var/www/html/demochat.com; index index.html; location / { try_files $uri $uri/ =404; } }
- File: /etc/nginx/sites-available/riot.demochat.com
1 2 3 4 5 6 7 8 9 10 11 12 13
server { listen 80; listen [::]:80; server_name riot.demochat.com; root /var/www/html/riot.demochat.com/riot; index index.html; location / { try_files $uri $uri/ =404; } }
- File: /etc/nginx/sites-available/matrix.demochat.com
1 2 3 4 5 6 7 8 9 10 11 12 13
server { listen 80; listen [::]:80; server_name matrix.demochat.com; root /var/www/html/matrix.demochat.com; index index.html; location / { proxy_pass http://localhost:8008; } }
Install certbot and configure your Let’s Encrypt certificates:
sudo apt install -y python3-certbot-nginx && certbot --nginx -d demochat.com -d riot.demochat.com -d matrix.demochat.com
Enable Your Installation’s Services
Add services to the default run level and restart your services:
sudo systemctl enable nginx sudo systemctl enable matrix-synapse sudo systemctl restart nginx
You should now be able to visit https://riot.demochat.com register an account, sign in, and start chatting.
This page was originally published on