Self-hosting a Matrix/Synapse service

I wanted to better understand what it takes to run a real service from my own homelab instead of only reading about infrastructure concepts in theory. Matrix/Synapse was a good project for this because it involves several practical areas: Linux, Docker, DNS, reverse proxy configuration, service exposure, and troubleshooting.

The goal was not just to make the service work. I wanted to expose only what was necessary, keep internal components private, and document the setup well enough that I could rebuild or improve it later.

The service runs on a Debian-based home server using Docker and Docker Compose. Synapse is published through HAProxy, while internal components such as the database remain private. Cloudflare DNS is used for the public domain records and Matrix discovery configuration.

Synapse service running.

Key technical decisions

  • Used Docker Compose to keep the application stack reproducible.
  • Placed Synapse behind HAProxy instead of exposing the application listener directly.
  • Kept PostgreSQL private and unavailable from the public Internet.
  • Used Cloudflare DNS for the public domain records.
  • Documented the setup in GitHub so the deployment can be reviewed and rebuilt.

Homelab network expansion

I also added a TP-Link TL-SG608E switch to expand my homelab and prepare for more structured network experiments.

Current lab components include:

  • Debian home server
  • Ubuntu / Windows dual-boot laptop
  • Raspberry Pi 3 B
  • Raspberry Pi 4 B+
  • Flipper Zero
  • TP-Link TL-SG608E managed switch

Next steps

My next goals are to document and test:

  1. DMZ-style network architecture
  2. Reverse proxy with network segmentation
  3. VLAN segmentation validation
  4. Honeypot deployment in an isolated VLAN
  5. Homelab infrastructure documentation

This project helped me connect several IT and cybersecurity concepts in a practical way: public exposure, service isolation, reverse proxy behavior, DNS, documentation, and troubleshooting.