Page:
Bridge setup with Docker
12
Bridge setup with Docker
Kevin Liu edited this page 2020-05-06 11:37:49 -07:00
Table of Contents
New in version 0.2.0
Requirements
- Docker
- A Matrix homeserver that supports application services (e.g. Synapse)
- Telegram app ID and hash so the bridge can use the Telegram API
- You can get these from my.telegram.org. Telegram will ask you to enter some information to identify a "new app". The new app you are registering is your instance of the mautrix-telegram bridge, so you can enter what you wish (but you must enter something).
Setup
Docker images are hosted on dock.mau.dev
- Create a directory for the bridge and cd into it:
mkdir mautrix-telegram && cd mautrix-telegram
.
N.B. The docker image willchown
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. - Pull the docker image with
docker pull dock.mau.dev/tulir/mautrix-telegram:<version>
. Replace<version>
with the version you want to run (e.g.latest
orv0.6.0
). - 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-telegram:<version>
- Update the config to your liking. Don't forget to change the
address
anddomain
to match those of your homeserver, as well as theappservice.address
if the container is not exposed at localhost, and to enter your Telegramapi_id
andapi_hash
. Don't change the database URI if using SQLite. You likely also want to editbridge.permissions
to give yourself admin access. For example, to give admin access to the whole domain, it would be"example.com": admin
- Generate the appservice registration by running the container again, same command as above.
- Add the path to the registration file to your Synapse's
homeserver.yaml
under theapp_service_config_files
section:app_service_config_files: ["/path/to/your/mautrix-telegram/registration.yaml"]
- Restart Synapse to apply changes.
- Run the bridge:
docker run --restart unless-stopped -p 29317:29317 -v `pwd`:/data:z dock.mau.dev/tulir/mautrix-telegram:<version>
Upgrading
- Pull the new version (setup step 1)
- 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-telegram:
container_name: mautrix-telegram
image: dock.mau.dev/tulir/mautrix-telegram:<version>
restart: unless-stopped
volumes:
- .:/data
Use docker-compose up -d
to start, docker-compose stop
to stop and docker-compose pull
to update.
Wiki deprecated
mautrix-telegram docs are now on docs.mau.fi