Dockerfile for synapse
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.1 KiB

Build Status


A basic docker image running synapse, a matrix homeserver.

For a complete self hosted chat and VOIP app, you also need a TURN server (for example coturn), and a matrix client (for example

Getting started:

First, start by generating a config file:

docker run \
    -e \
    -v `pwd`/data:/data \
    --rm \
    --entrypoint generate \

There are 2 things you need to take care of here:

  • put your domain where is
  • modify `pwd`/data to match the folder where you want your homeservers data to be. This contains things like log, database, media and config.

After you're done with that, you might want to change some things in the default configuration. You will find the configuration file in data/config/homeserver.yaml.

Now that you have synapse configured, it's time to start it up:

docker run \
    -v `pwd`/data:/data \
    -p 8008:8008 \
    -p 8448:8448 \
    -n synapse \

You now should have synapse running and should be able to connect to it from a client.

If you haven't enabled registration manually in the config file, you can create users from the CLI:

docker exec \
    --interactive \
    --tty \
    synapse \
    register_new_matrix_user \
    -c /data/config/homeserver.yaml \

The next step would be to put a reverse proxy in front of it for secure client connections, and to install and configure a TURN server.


  • latest: latest stable version

Environment variables:

  • UID: user id (default: 1337)
  • GID: group id (default: 1337)
Config generation:
  • SERVER_NAME: domain name of the homeserver. (mandatory)
  • REPORT_STATS: either yes or no, default: yes


  • 8008: client-to-server matrix traffic
  • 8448: server-to-server matrix traffic