Best VPS for Matrix 2026: Self-Host Your Chat Server
REVIEW 10 min read fordnox

Best VPS for Matrix 2026: Self-Host Your Chat Server

Find the best VPS for hosting Matrix/Synapse. Compare specs, set up your own encrypted chat server, and escape big tech messaging.


Best VPS for Matrix in 2026

Matrix is a decentralized, encrypted chat protocol. Run your own homeserver and you control your communications — no Big Tech middleman.

What is Matrix?

What is Matrix?

What is Matrix?

Matrix is to chat what email is to messaging:

Think of it as self-hosted Slack/Discord that can talk to other Matrix servers worldwide. If you prefer a forum-style community, check out Discourse or Mastodon for microblogging.

Why Self-Host Matrix?

Factormatrix.org (free)Self-Hosted
PrivacyThey see metadataFull control
CustomizationLimitedUnlimited
StorageLimitedYour VPS
PerformanceSharedDedicated
Federation
Username@you:matrix.org@you:yourdomain.com

Self-hosting gives you @username:yourdomain.com addresses and complete data sovereignty.

VPS Requirements

Synapse (Reference Implementation)

Synapse is Python-based and memory-hungry:

Minimum:

Recommended:

Large Community:

Dendrite (Lightweight Alternative)

Dendrite is Go-based, much lighter:

Trade-off: Fewer features, less mature.

Best VPS for Matrix

1. Hetzner CX21 (Best Value)

€5.39/mo | 2 vCPU, 4GB RAM, 40GB NVMe

4GB RAM handles Synapse well. 20TB bandwidth is plenty for media.

Performance: Smooth for 50-100 active users

2. Hostinger KVM2 (Best Budget)

$5.99/mo | 2 vCPU, 8GB RAM, 100GB NVMe

8GB RAM is luxurious for Matrix. Good for growing communities.

3. Vultr High Frequency (Best Performance)

$24/mo | 2 vCPU, 4GB RAM, 128GB NVMe

3GHz+ CPUs mean faster room syncs. Worth it for large rooms.

4. Contabo VPS S (Most Storage)

€5.99/mo | 4 vCPU, 8GB RAM, 200GB

If media storage is priority, Contabo’s specs can’t be beat.

Complete Setup Guide

Step 1: Create Your VPS

Using Hetzner CX21:

  1. Sign up at Hetzner Cloud
  2. Create server → Ubuntu 22.04 → CX21
  3. Add SSH key
  4. Create server, note IP

Step 2: DNS Setup

A     matrix.yourdomain.com      → your-server-ip
A     element.yourdomain.com     → your-server-ip
SRV   _matrix._tcp.yourdomain.com → 10 0 443 matrix.yourdomain.com

The SRV record enables federation with your root domain.

Step 3: Initial Server Setup

ssh root@your-server-ip

# Update
apt update && apt upgrade -y

# Install Docker
curl -fsSL https://get.docker.com | sh

# Create matrix user
adduser matrix
usermod -aG docker matrix

Step 4: Deploy with Docker Compose

su - matrix
mkdir matrix && cd matrix

Create docker-compose.yml:

version: '3.8'

services:
  synapse:
    image: matrixdotorg/synapse:latest
    container_name: synapse
    restart: unless-stopped
    environment:
      - SYNAPSE_SERVER_NAME=yourdomain.com
      - SYNAPSE_REPORT_STATS=no
    volumes:
      - ./synapse-data:/data
    ports:
      - 8008:8008
    depends_on:
      - postgres

  postgres:
    image: postgres:15-alpine
    container_name: synapse-postgres
    restart: unless-stopped
    environment:
      POSTGRES_USER: synapse
      POSTGRES_PASSWORD: your-secure-password
      POSTGRES_DB: synapse
      POSTGRES_INITDB_ARGS: --encoding=UTF8 --lc-collate=C --lc-ctype=C
    volumes:
      - ./postgres-data:/var/lib/postgresql/data

  caddy:
    image: caddy:alpine
    container_name: caddy
    restart: unless-stopped
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config

  element:
    image: vectorim/element-web:latest
    container_name: element
    restart: unless-stopped
    volumes:
      - ./element-config.json:/app/config.json

volumes:
  caddy_data:
  caddy_config:

Step 5: Configure Caddy

Create Caddyfile:

matrix.yourdomain.com {
    reverse_proxy synapse:8008
}

element.yourdomain.com {
    reverse_proxy element:80
}

yourdomain.com {
    header /.well-known/matrix/* Content-Type application/json
    respond /.well-known/matrix/server `{"m.server": "matrix.yourdomain.com:443"}`
    respond /.well-known/matrix/client `{"m.homeserver": {"base_url": "https://matrix.yourdomain.com"}}`
}

Step 6: Generate Synapse Config

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

Edit synapse-data/homeserver.yaml:

database:
  name: psycopg2
  args:
    user: synapse
    password: your-secure-password
    database: synapse
    host: postgres
    cp_min: 5
    cp_max: 10

enable_registration: false

Step 7: Configure Element

Create element-config.json:

{
  "default_server_config": {
    "m.homeserver": {
      "base_url": "https://matrix.yourdomain.com",
      "server_name": "yourdomain.com"
    }
  },
  "brand": "Element",
  "default_theme": "dark"
}

Step 8: Launch

docker compose up -d

Wait a minute, then access:

Step 9: Create Admin User

docker exec -it synapse register_new_matrix_user \
  -u admin \
  -p your-password \
  -a \
  -c /data/homeserver.yaml \
  http://localhost:8008

Log in with @admin:yourdomain.com

Enable Federation

Federation lets your server talk to matrix.org and others.

Test Federation

curl https://federationtester.matrix.org/api/report?server_name=yourdomain.com

Should show green checkmarks.

Common Federation Issues

  1. Wrong SRV record — Use proper format
  2. SSL issues — Ensure valid certificate
  3. Firewall — Port 443 must be open

Performance Tuning

Enable Redis (for large servers)

Add to compose:

redis:
  image: redis:alpine
  restart: unless-stopped

Update homeserver.yaml:

redis:
  enabled: true
  host: redis
  port: 6379

Database Tuning

For PostgreSQL:

ALTER SYSTEM SET shared_buffers = '1GB';
ALTER SYSTEM SET effective_cache_size = '3GB';
ALTER SYSTEM SET work_mem = '16MB';

Enable Caching

In homeserver.yaml:

caches:
  global_factor: 1.0
  cache_entry_ttl: 30m

Synapse Workers (Advanced)

For large deployments, split Synapse into workers:

See Matrix docs for worker configuration.

Bridges (Connect Other Platforms)

Discord Bridge

docker run -d \
  --name mautrix-discord \
  -v ./discord-bridge:/data \
  dock.mau.dev/mautrix/discord

Signal Bridge

docker run -d \
  --name mautrix-signal \
  -v ./signal-bridge:/data \
  dock.mau.dev/mautrix/signal

WhatsApp Bridge

docker run -d \
  --name mautrix-whatsapp \
  -v ./whatsapp-bridge:/data \
  dock.mau.dev/mautrix/whatsapp

Backup Strategy

Database Backup

#!/bin/bash
# backup.sh
docker exec synapse-postgres pg_dump -U synapse synapse > backup.sql
rclone copy backup.sql remote:matrix-backup/

Schedule with cron:

0 3 * * * /home/matrix/backup.sh

Media Backup

tar czf media-backup.tar.gz synapse-data/media_store/
rclone copy media-backup.tar.gz remote:matrix-backup/

Security Hardening

Disable Registration

In homeserver.yaml:

enable_registration: false

Enable Rate Limiting

rc_message:
  per_second: 0.5
  burst_count: 10

rc_registration:
  per_second: 0.1
  burst_count: 3

Regular Updates and Backups

docker compose pull
docker compose up -d

Resource Usage

Typical usage on a 100-user server:

ComponentRAMCPU
Synapse1-2GB0.5-1 core
PostgreSQL500MB0.2 core
Element50MBminimal
Caddy20MBminimal
Total~2.5GB~1.5 cores

4GB RAM VPS handles this comfortably.

FAQ

Synapse vs Dendrite?

Synapse is mature, full-featured. Dendrite is lightweight but missing features. Start with Synapse unless you’re resource-constrained.

How much storage do I need?

Depends on media sharing. Start with 40GB, monitor usage. Media is the biggest consumer.

Can I use my own domain for usernames?

Yes! That’s the point. @you:yourdomain.com is yours forever.

Is Matrix truly private?

With E2EE rooms, yes. Metadata (who talks to whom) is visible to server admins.

Can I migrate from matrix.org?

Yes, but it’s complex. Easier to start fresh on your server.

Use CaseVPSMonthly Cost
Personal/SmallHetzner CX21€5.39
Medium CommunityHostinger KVM2$5.99
Large ServerHetzner CX31€10.49

Start with Hetzner CX21 — €5.39/month for complete communication sovereignty.

~/best-vps-for-matrix/get-started

Ready to get started?

Get the best VPS hosting deal today. Hostinger offers 4GB RAM VPS starting at just $4.99/mo.

Get Hostinger VPS — $4.99/mo

// up to 75% off + free domain included

// related topics

best vps for matrix matrix hosting synapse server self-hosted chat matrix homeserver

// related guides

Andrius Putna

Andrius Putna

I am Andrius Putna. Geek. Since early 2000 in love tinkering with web technologies. Now AI. Bridging business and technology to drive meaningful impact. Combining expertise in customer experience, technology, and business strategy to deliver valuable insights. Father, open-source contributor, investor, 2xIronman, MBA graduate.

// last updated: February 8, 2026. Disclosure: This article may contain affiliate links.