6 Bridge setup with Docker
Tulir Asokan edited this page 2021-01-19 17:29:49 +02:00

Requirements

  • Docker
  • A Matrix homeserver that supports application services (e.g. Synapse)
  • A PostgreSQL server. You can use the same one you use for Synapse or run another instance in a Docker container.

Setup

Docker images are hosted on dock.mau.dev

  1. Create a directory for the bridge and cd into it: mkdir mautrix-facebook && cd mautrix-facebook.
    N.B. The docker image will chown its /data directory to UID 1337. The commands below mount the working directory as /data, so make sure you always run them in the correct directory.
  2. Pull the docker image with docker pull dock.mau.dev/tulir/mautrix-facebook:latest
  3. Run the container for the first time, so it can create a config file for you:
    docker run --rm -v `pwd`:/data:z dock.mau.dev/tulir/mautrix-facebook:latest
    
  4. Update the config to your liking. You'll at least need to change the homeserver and database settings, and add yourself to the permissions section.
  5. Generate the appservice registration by running the container again, same command as above.
  6. Add the path to the registration file to your Synapse's homeserver.yaml under the app_service_config_files section: app_service_config_files: ["/path/to/your/mautrix-facebook/registration.yaml"]
  7. Restart Synapse to apply changes.
  8. Run the bridge:
    docker run --restart unless-stopped -v `pwd`:/data:z dock.mau.dev/tulir/mautrix-facebook:latest
    
    If your Synapse is outside Docker, add -p 29319:29319 before -v ... to expose the bridge port.

Upgrading

  1. Pull the new version (setup step 1)
  2. Start the new version (setup step 7)

Docker compose

Create a directory as in step #0 and create docker-compose.yml that contains something like this:

version: "3.7"

services:
  mautrix-facebook:
    container_name: mautrix-facebook
    image: dock.mau.dev/tulir/mautrix-facebook:latest
    restart: unless-stopped
    ports:
      - '29319:29319'
    volumes:
    - .:/data

Use docker-compose up -d to start, docker-compose stop to stop and docker-compose pull to update.