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 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.
- 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 or v0.6.0).
- Run the container for the first time, so it can create a config file for you:
- Update the config to your liking. Don't forget to change the
address and domain to match those of your homeserver, as well as the appservice.address if the container is not exposed at localhost, and to enter your Telegram api_id and api_hash. Don't change the database URI if using SQLite. You likely also want to edit bridge.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 the app_service_config_files section:
app_service_config_files: ["/path/to/your/mautrix-telegram/registration.yaml"]
- Restart Synapse to apply changes.
- Run the bridge:
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:
Use docker-compose up -d to start, docker-compose stop to stop and docker-compose pull to update.