This repo is just a simple write-up on how to get telegram notifications from Watchtower, when a container is updated. This version is mostly focused on docker-compose, but should also work with docker run.
It's pretty easy to get telegram notifications from Watchtower. You just need to follow these steps:
Firstly, we need to create a new telegram bot. For that open a new chat with BotFather, type in the command /newbot
and follow the instructions. In the end you should see a message like this:
After creating your bot, you need to get your chat id. For that, open a new chat with your bot, start it and tag @get_id_bot
in the chat. You should get a message like this:
Now we need to setup Watchtower. For that, you need to add the following environment variables to your docker-compose file:
environment:
- WATCHTOWER_NOTIFICATIONS=shoutrrr
- WATCHTOWER_NOTIFICATION_URL=telegram://HTTP_API_TOKEN@telegram?chats=CHAT_ID
Replace HTTP_API_TOKEN
with the token you got from BotFather in step 1. and CHAT_ID
with the chat id you got from @get_id_bot
in step 2.
Now you can (re)start Watchtower:
sudo docker-compose up -d --force-recreate
and you should get a message from your bot, that Watchtower is running. The message should look like this:
You will also get a message, when a container is updated. It should look like this:
If you are still unsure, how your docker-compose file should look like, check out the docker-compose.yml
file in this repo. Most optional settings are commented, so everything is more understandable. Just remember to replace HTTP_API_TOKEN
with the token you got from BotFather in step 1. and CHAT_ID
with the chat id you got from @get_id_bot
in step 2.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This repository is for research purposes only, the use of this code is your responsibility.
I take NO responsibility and/or liability for how you choose to use any of the source code available here. By using any of the files available in this repository, you understand that you are AGREEING TO USE AT YOUR OWN RISK. Once again, ALL files available here are for EDUCATION and/or RESEARCH purposes ONLY.