Una rete Matrix decentralizzata

Matrix Synapse: Building Your Own Decentralized Communication Platform

Have you ever wanted to take back control of your online conversations, away from the large centralised platforms that collect your data? If the answer is yes, you’re in the right place. Today we explore Matrix, an open and decentralised protocol for real-time communication, and walk you step by step through installing Synapse, the reference Matrix server, on a Rocky Linux 9 server using Docker Compose and a Traefik reverse proxy for seamless Let’s Encrypt certificate management.

Matrix: A Return to the Open Web

Matrix is an open protocol for federated communication that allows anyone to host their own server and interact with users on other Matrix servers, without intermediaries. This means decentralisation (no single point of control), interoperability (communicate with anyone on the Matrix network regardless of their client or server), end-to-end encryption, and full transparency as open source software.

Prerequisites

  • A server with Rocky Linux 9 and root or sudo access
  • A domain name (e.g. matrix.yourdomain.com) pointing to your server
  • Docker and Docker Compose installed on the server

Installing Matrix Synapse with Docker Compose and Traefik

1. Initial Server Setup

sudo dnf update -y
sudo dnf install -y git

2. Create Directories

sudo mkdir -p /opt/matrix
cd /opt/matrix
sudo mkdir -p synapse/data
sudo mkdir -p traefik/acme

3. Generate the Synapse homeserver.yaml

docker run --rm     -v /opt/matrix/synapse/data:/data     -e SYNAPSE_SERVER_NAME=matrix.yourdomain.com     -e SYNAPSE_REPORT_STATS=no     matrixdotorg/synapse:latest generate

Edit the generated homeserver.yaml to configure the HTTP listener on port 8008 for Traefik and set x_forwarded_for: true.

4. Create docker-compose.yml

Create /opt/matrix/docker-compose.yml with both the Synapse and Traefik services. Traefik handles HTTPS termination and automatic Let’s Encrypt certificate renewal. Synapse listens internally on port 8008. Replace all occurrences of matrix.yourdomain.com with your actual domain.

5. Start the Stack

sudo docker compose up -d
sudo docker compose ps

6. Create an Admin User

sudo docker compose exec synapse register_new_matrix_user -c /data/homeserver.yaml http://localhost:8008 -a -u yourusername -p yourpassword

Firewall Configuration

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Matrix Clients: Freedom of Choice

One of Matrix’s greatest advantages is the wide range of compatible clients available. The most popular include Element (the reference client, available for web, desktop and mobile), SchildiChat (an Element fork with UI improvements), FluffyChat (modern and user-friendly, great on mobile), Cinny (lightweight web client), and Nheko (native Qt desktop client focused on performance).

Conclusion

You have configured your own Matrix Synapse server — a significant step towards reclaiming your digital communication. You can now connect to the Matrix network with your preferred client, invite your friends, and enjoy secure, private communication under your own control.