Skip to content

Instantly share code, notes, and snippets.

@herbetom
Last active February 4, 2022 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herbetom/464496ee1c49635d20274754343dc045 to your computer and use it in GitHub Desktop.
Save herbetom/464496ee1c49635d20274754343dc045 to your computer and use it in GitHub Desktop.
Matrix Synapse with docker-compose on Debian 10 (maybe don't run stuff in Docker ;) )

Tested on Debian 10.2

mkdir /opt/matrix-synapse/
cd /opt/matrix-synapse/
wget https://raw.githubusercontent.com/matrix-org/synapse/master/contrib/docker/docker-compose.yml

Inside the docker-compose.yml i changed the port config to - 8008:8008/tcp since i will let a nginx proxy handle the ssl stuff.

docker-compose run --rm -e SYNAPSE_SERVER_NAME=example.org -e SYNAPSE_REPORT_STATS=yes synapse generate

If you get errors like Permission denied: '/etc/homeserver.yaml' then try changing permissions:

chown -R 991:991 files/
chown -R 991:991 matrix-config/

Now try again generating your configuration:

docker-compose run --rm -e SYNAPSE_SERVER_NAME=example.org -e SYNAPSE_REPORT_STATS=yes synapse generate

Now you can edit your homeserver config file

nano matrix-config/homeserver.yaml

You propably want to change the database section so that your PostgreSQL Database is user

database:
    name: psycopg2
    args:
        user: synapse
        password: changeme
        database: synapse
        host: db

Once that is done you can try starting synapse

docker-compose up -d

And check the log for any errors:

docker-compose logs synapse
docker-compose logs db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment