How to Set Up Matrix/Synapse Server with Docker

Install Docker

Add Docker’s official GPG key:

Add Docker repository to apt sources:

Install Docker and other required packages:

Install Matrix with Docker

Create  docker-compose.yml

Paste the lines below in the docker-compose.yml

Generate Matrix container configuration

Edit the homeserver.yml file in data directory and add the following configuration for TLS and registration:

Upload you ssl/tls key and full chain files to data directory and chnage permissions so your container has rights to access the two files.

Start your Matrix server:

Useful Commands

Create admin user:

Restart Matrix container:

Access your container CLI: