Docs / Self-Hosted Applications / Self-Host Matrix Synapse Chat

Self-Host Matrix Synapse Chat

By Admin · Mar 15, 2026 · Updated Apr 23, 2026 · 193 views · 2 min read

What is Matrix/Synapse?

Matrix is an open standard for decentralized, encrypted communication. Synapse is the reference server implementation. It provides end-to-end encrypted messaging, voice/video calls, file sharing, and federation with other Matrix servers.

Installation

mkdir -p /opt/synapse && cd /opt/synapse

# Generate initial config
docker run -it --rm -v /opt/synapse/data:/data \
    -e SYNAPSE_SERVER_NAME=matrix.example.com \
    -e SYNAPSE_REPORT_STATS=no \
    matrixdotorg/synapse:latest generate

# Start Synapse
docker run -d --name synapse \
    -v /opt/synapse/data:/data \
    -p 8008:8008 \
    --restart unless-stopped \
    matrixdotorg/synapse:latest

Nginx Reverse Proxy

server {
    listen 443 ssl http2;
    server_name matrix.example.com;

    location /_matrix {
        proxy_pass http://127.0.0.1:8008;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        client_max_body_size 50M;
    }

    location /_synapse {
        proxy_pass http://127.0.0.1:8008;
    }
}

# Also add .well-known delegation on your main domain

Element Web Client

# Deploy Element (web client) alongside Synapse
docker run -d --name element \
    -p 8081:80 \
    -v /opt/element/config.json:/app/config.json \
    --restart unless-stopped \
    vectorim/element-web:latest

Features

  • End-to-end encrypted messaging (default in DMs)
  • Federated communication with other Matrix servers
  • Voice and video calls via WebRTC
  • Rooms, spaces, and threads for organization
  • File sharing and media storage
  • Bridges to Slack, Discord, IRC, Telegram
  • Bots and integrations via webhooks
  • Cross-platform clients (Element, FluffyChat, etc.)

Administration

# Create admin user
docker exec -it synapse register_new_matrix_user \
    http://localhost:8008 -c /data/homeserver.yaml -a

# Use Synapse Admin UI for management
docker run -d --name synapse-admin \
    -p 8082:80 \
    awesometechnologies/synapse-admin

Best Practices

  • Use PostgreSQL instead of SQLite for production
  • Enable rate limiting to prevent abuse
  • Set up automated backups of the database and media store
  • Configure federation for inter-server communication
  • Monitor disk usage as media accumulates

Was this article helpful?