The solo purpose of this package is to provide the most hands-free experience of running your own Telegram Bot API server.
Plug and play: git clone https://github.com/heilkit/telegram-bot-api && cd telegram-bot-api && "${EDITOR:-nano}" .env && sudo USER_ID="$(id -u)" GROUP_ID="$(id -g)" docker compose up -d
- Download files without a size limit.
- Upload files up to 2000 MB.
- Upload files using their local path and the file URI scheme.-
- Use an HTTP URL for the webhook.
- Use any local IP address for the webhook.
- Use any port for the webhook.
- Set max_webhook_connections up to 100000.
- Receive the absolute local path as a value of the file_path field without the need to download the file after a getFile request.
Official source: https://github.com/tdlib/telegram-bot-api.
NOTE: If you don't have Telegram app API keys, you could get them at https://core.telegram.org/api/obtaining_api_id.
NOTE: These commands include
sudo
, you might need to replace/delete it depending on your system.
git clone https://github.com/heilkit/telegram-bot-api && cd telegram-bot-api
- Provide your API ID and HASH in
.env
file. sudo USER_ID="$(id -u)" GROUP_ID="$(id -g)" docker compose up -d
Alternatively you could use a "one-liner":
git clone https://github.com/heilkit/telegram-bot-api &&
cd telegram-bot-api &&
"${EDITOR:-nano}" .env &&
sudo USER_ID="$(id -u)" GROUP_ID="$(id -g)" docker compose up -d
git clone https://github.com/heilkit/telegram-bot-api && cd telegram-bot-api
- Create storage directory, i.e.,
/var/lib/telegram-bot-api
(replace it with something custom, if you wish, but make sure it matches the-d
argument oftelegram-bot-api
). - Ensure, you put good permissions on the directory,
sudo setfacl -m u:$(id -u):rwx -R /var/lib/telegram-bot-api
. sudo STORAGE=/var/lib/telegram-bot-api docker run --name telegram-bot-api -u "$(id -u):$(id -g)" --restart=always -v $STORAGE:$STORAGE -d heilkit/telegram-bot-api -d $STORAGE -v 1 --local --api-id=<API_ID> --api-hash=<API_HASH>