A self-hosted Telegram downloader bot. Send it any file โ a movie, a series, a document โ and it saves it straight to your own storage. No 20 MB cloud cap, no monthly fees, no third-party servers.
Install in one command How it worksYour files, your disk, your rules.
MTProto (Telethon) session instead of the bot cloud API โ 2 GB movies download fine, not capped at 20 MB.
Files go straight to your drive over Telegram's encrypted transport. No middleman server ever sees them.
One small container on the hardware you already own โ a Raspberry Pi or any always-on box.
Multi-arch image (amd64 + arm64) built by CI โ your Pi, your friend's Intel laptop, both work.
The status message updates in place with a progress bar, size and percentage as the download runs.
Lock the bot to specific Telegram user ids. Random people get a single "Not authorised" โ no loops.
Prerequisite: Docker with the compose plugin. Pick your path:
curl -fsSL -o run.sh https://raw.githubusercontent.com/arjun0084/TelegramDownloader/main/run.sh && bash run.sh
First run downloads docker-compose.yml + .env.example, creates .env and tells you exactly what to fill in. Run it once more and the container is up. Updates = same command.
docker run -d --name tgdl --restart unless-stopped \ -v /path/to/your/media:/downloads -v tgdl_data:/data \ -e TG_API_ID=... -e TG_API_HASH=... -e TG_BOT_TOKEN=... \ -e TG_OUTPUT_DIR=/downloads \ arjun0084/telegram-downloader:latest
The no-compose path. Swap the env values for yours and the media path for your folder.
mkdir tgdl && cd tgdl curl -fsSL -O https://raw.githubusercontent.com/arjun0084/TelegramDownloader/main/docker-compose.yml curl -fsSL -O https://raw.githubusercontent.com/arjun0084/TelegramDownloader/main/.env.example cp .env.example .env nano .env ./run.sh
Three steps between you and a private downloader.
api_id + api_hash from my.telegram.org and a bot token from @BotFather โ takes two minutes, costs nothing..env file and point it at your downloads folder.Everything lives in one .env file (copy from .env.example).
| Variable | What it is | Where to get it |
|---|---|---|
TG_API_ID | Telegram app id | my.telegram.org โ API development tools |
TG_API_HASH | Telegram app hash | my.telegram.org โ API development tools |
TG_BOT_TOKEN | Bot token | @BotFather โ /newbot |
MEDIA_HOST_DIR | Where downloads land on your machine | Your own path, e.g. /media/usb or ~/Videos |
TG_ALLOWED_USER_ID | Allow-list of Telegram ids (comma-separated). 0 = anyone in private chat | @userinfobot |
Nothing to learn.
/start โ it confirms the save path../run.sh (start), ./run.sh update (pull latest image), ./run.sh logs (follow logs), ./run.sh down (stop).restart: unless-stopped brings the container back on reboot, and the session persists in a named volume.