Video coming soon…

🔗 Setup Matrix (Synapse)

Deploy Matrix Synapse federated chat server on Ubuntu with Element client — end-to-end encrypted and fully self-hosted.

⚠️ This script is provided for demo and testing purposes only. Not intended for production use.
🌐 Federation means other Matrix servers can join your rooms. Set enable_registration: false in homeserver.yaml if you want a private server.

📦 Resources & Setup Scripts

Grab the automated bash script from GitHub to follow along with the video.

Automated install script — one command sets everything up.
View on GitHub

Quick Install:

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/communication/matrix/matrix-ubuntu.sh
chmod +x matrix-ubuntu.sh
sudo bash matrix-ubuntu.sh

Tutorial Steps

1 Download the Script

wget https://raw.githubusercontent.com/mhmdali94/Docker/main/communication/matrix/matrix-ubuntu.sh

2 Make it Executable

chmod +x matrix-ubuntu.sh

3 Run the Installer

The script installs Docker, then deploys Synapse server with PostgreSQL and the Element web client automatically.

sudo bash matrix-ubuntu.sh

4 Access the Web UI

Open your browser and navigate to:

http://<your-server-ip>:8008

5 Register Admin and Configure Federation

Register your admin account, configure your server name, and optionally disable open registration if you want a private server.

# Register admin user inside the container
docker exec -it synapse register_new_matrix_user -u admin -p yourpassword -a -c /data/homeserver.yaml http://localhost:8008

Ports Used

PortPurpose
8008Synapse HTTP
8448Matrix Federation
5432PostgreSQL (internal)

Overview

Matrix is an open standard and decentralised communication protocol that enables real-time messaging, voice, and video across a federated network of independently hosted servers. Synapse is the reference homeserver implementation — self-hosting it gives your organisation a private, federated messaging platform.

Why Use It

Matrix is the only open messaging protocol that combines E2E encryption, federation (communicate across servers), and bridges to every major platform — Slack, Discord, WhatsApp, Telegram, IRC. If you want messaging infrastructure you truly own, with no vendor lock-in and the ability to talk to users on other servers, Matrix is unmatched. Synapse is the reference server implementation.

When You Need It

    Who Should Use It

      Real Use Cases

        Main Features

          How to Use After Installation

            Security Best Practices

              Ports and Firewall Notes

              Port 8008 (Synapse HTTP — internal, proxy in front of it) and 8448 (Matrix federation HTTPS — must be publicly accessible if you want to federate). PostgreSQL on 5432 is internal only. Use a reverse proxy on 443 pointing to 8008, and expose 8448 for federation.

              Backup and Maintenance

                Common Mistakes

                  Troubleshooting

                    Alternatives

                    Direct alternatives: Mattermost (simpler, no federation, channel-based), Zulip (topic threading, no E2E encryption), Rocket.Chat (feature-rich). For pure E2E encrypted messaging without federation: Signal (no self-hosting), Wire (limited self-hosting). Cloud: Slack, Microsoft Teams.

                    When Not to Use It

                    Don't use Matrix if your team just needs simple team chat — Mattermost or Zulip are far easier to operate. Matrix is complex: federation, key management, and bridges add significant operational overhead. If you don't need federation or E2E encryption, a simpler tool is better.

                    PrismaTechWork Professional Help

                    PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.

                      Contact Us

                      Frequently Asked Questions

                      What is the difference between Matrix and Element?

                      Matrix is the open protocol. Synapse is the reference server implementation. Element is the official client (web, desktop, mobile). You run Synapse; your users connect via Element or any other Matrix client.

                      Can my users chat with people on matrix.org?

                      Yes — if federation is enabled and port 8448 is publicly accessible, your users can join rooms and message users on any Matrix server, including matrix.org.

                      How do I bridge Matrix to Slack or Discord?

                      Use a bridge service: mautrix-slack for Slack, mautrix-discord for Discord. Deploy the bridge as a separate container alongside Synapse and register it as an Application Service in homeserver.yaml.

                      Is end-to-end encryption on by default?

                      E2E encryption is enabled for direct messages by default. For rooms/channels, encryption must be enabled per-room. Once enabled, it cannot be disabled for that room.

                      What happens if I lose my signing key?

                      Federation breaks permanently — other servers won't trust your server anymore. Back up the signing key file from your Synapse data directory. You cannot regenerate it without losing federation history.

                      How resource-intensive is Synapse?

                      Synapse (Python-based) is memory-hungry — expect 1-2 GB RAM for a small team. For larger deployments, use Dendrite (Go-based, lighter) or enable Synapse workers. PostgreSQL also needs adequate RAM for indexing.

                      Can I migrate from Mattermost or Slack to Matrix?

                      There's no direct automated importer from Mattermost. Slack exports can be partially imported via third-party tools. Most Matrix migrations start fresh and keep old logs as archives.

                      How do I upgrade Synapse?

                      Run `docker compose pull && docker compose up -d`. Synapse runs database migrations automatically on startup. Always check the upgrade notes on GitHub before major version jumps — some versions have manual migration steps.