buluma.matrix-synapse-auto-deploy
Auto-deployment for matrix-org/synapse
This Ansible role will automatically set up a ready-to-use Matrix server on any machine. Unlike the matrix-docker-ansible-deploy roles, it does not use Docker; instead, it uses a Python 3 virtual environment for Synapse.
Services
This role sets up the following services on your server:
- Synapse: The main "homeserver" implementation of Matrix from the core team at matrix.org
- Coturn: A STUN/TURN server for WebRTC audio and video calls
- mxisd: A federated Matrix Identity server that improves privacy (doc)
- nginx: A web server for the Riot web client and a reverse proxy for Synapse and mxisd
- postgresql: The database used by Synapse and mxisd
- Riot: A web user interface preconfigured for your homeserver
- Let's Encrypt: TLS certificates for Riot and Synapse
See the small Architecture Overview for more details.
Pre-requirements
- Git
- Ansible version 2.6 or higher
- DNS Entries:
- A Records:
- An A Record for matrix-machine.yourdomain.tld.
- An A Record for riot-webclient.yourdomain.tld.
- SRV Record:
_matrix._tcp.yourdomain.tld. 3600 IN SRV 10 5 443 matrix-machine.yourdomain.tld.
_matrix-identity._tcp.yourdomain.tld. 3600 IN SRV 10 5 443 matrix-machine.yourdomain.tld.
- A Records:
You need an SRV entry like this to inform other HomeServers which port to use. Additionally, .well-known files will be created at {{ matrix_well_known_location }}. You must move these files to the server that serves your main domain.
Supported Operating Systems
- Ubuntu 18.04
- Debian 9
It should also work well on any OS that uses systemd. Feel free to test it and give feedback (or contribute to add support for your preferred system).
Installation
All the variables are listed in roles/matrix-synapse-auto-deploy/defaults/main.yml. You need to customize these to fit your needs. Check the playbook.example.yml file for the most important variables.
To install, run:
ansible-playbook playbook.example.yml --extra-vars "host=matrix.domain.com" -b -K
Enjoy
You can now connect to your Homeserver using the Riot web client or by specifying your Homeserver on other clients.
Ansible playbook for managing a matrix node with synapse and riot
ansible-galaxy install buluma.matrix-synapse-auto-deploy