Skip to main content

Deployment Overview

This guide covers different approaches to deploying Matrix infrastructure.

Deployment Options

Use Public Homeserver

Easiest - Just sign up:

OptionProsCons
matrix.orgLargest, well-maintainedMetadata exposure, shared resources
Other publicVarious providersVaries

Managed Hosting

Hands-off - Someone else runs it:

ProviderFeaturesBest For
Element Matrix ServicesEnterprise, supportOrganizations
etke.ccFull stack, bridgesCommunities
ungleichSwiss hostingPrivacy-focused

Self-Hosted

Full control - Run everything yourself:

ApproachComplexityFlexibility
ManualHighMaximum
Docker ComposeMediumHigh
Ansible playbookLowMedium
KubernetesMedium-HighHigh

Quick Comparison

FactorPublicManagedSelf-Hosted
Setup timeMinutesHoursDays
CostFree$10-100+/moHosting costs
MaintenanceNoneNoneYou
CustomizationNoneLimitedFull
PrivacyLowMediumHigh
ComplianceNoPossiblePossible

Self-Hosting Methods

Docker Compose

Quick deployment with containers:

docker-compose.yml
version: '3'
services:
synapse:
image: matrixdotorg/synapse:latest
volumes:
- ./data:/data
ports:
- "8008:8008"

matrix-docker-ansible-deploy

Recommended for most users:

git clone https://github.com/spantaleev/matrix-docker-ansible-deploy.git

Features:

  • Complete stack deployment
  • All major bridges
  • Automatic SSL
  • Easy updates

Kubernetes

For larger deployments:

  • Helm charts available
  • Horizontal scaling
  • Cloud-native

Components to Deploy

Minimum

ComponentPurpose
HomeserverCore Matrix server
PostgreSQLDatabase
Reverse proxyTLS termination
ComponentPurpose
Element WebWeb client
CoturnVoIP/video
RedisCaching (for workers)

Optional

ComponentPurpose
BridgesConnect other platforms
BotsAutomation
Integration managerWidgets/bots UI

Infrastructure Requirements

Small Instance (Personal)

ResourceMinimumRecommended
RAM1 GB2 GB
CPU1 core2 cores
Storage10 GB50 GB
Bandwidth100 Mbps1 Gbps

Medium Instance (Community)

ResourceMinimumRecommended
RAM4 GB8 GB
CPU2 cores4 cores
Storage50 GB200 GB
Bandwidth1 Gbps1 Gbps

Large Instance (Organization)

ResourceMinimum
RAM16+ GB
CPU8+ cores
Storage500+ GB SSD
Bandwidth1+ Gbps

Domain Setup

DNS Records

example.com              A    → Your server IP
matrix.example.com A → Your server IP
element.example.com A → Your server IP (optional)

Well-Known Delegation

For @user:example.com with server at matrix.example.com:

https://example.com/.well-known/matrix/server
{
"m.server": "matrix.example.com:443"
}
https://example.com/.well-known/matrix/client
{
"m.homeserver": {
"base_url": "https://matrix.example.com"
}
}

SSL/TLS

Let's Encrypt

Free certificates:

certbot certonly --webroot -w /var/www/html \
-d matrix.example.com \
-d example.com

Certificate Requirements

  • Valid for your domain
  • Federation requires port 8448 OR .well-known
  • Modern TLS (1.2+)

Next Steps

Choose your path:


See also: Server Comparison