Sign inSign up

drumsergio/telegram-archive

By drumsergio

•Updated 4 minutes ago

Image
1

50K+

drumsergio/telegram-archive repository overview

Telegram Archive

⁠Telegram Archive

Docker Pulls GitHub Stars License Release codecov Docs

Telegram Archive backs up one or more Telegram accounts to a machine you host. It runs in Docker and saves messages, media, edits and deletions to SQLite or PostgreSQL on your own disk. A web viewer lets you read and search what it saved. The viewer never talks to Telegram.

Telegram Archive viewer

⁠Features

  • Scheduled incremental backups, with an optional real-time listener for new messages, edits and deletions.
  • Each media file is saved once, even when several chats hold it. You can skip files by size or type.
  • Keeps earlier versions of edited messages, and keeps deleted messages marked as deleted. The real-time listener or the scheduled edit and deletion sync records both.
  • Several Telegram accounts in one archive.
  • Imports from Telegram Desktop exports.
  • A web viewer with search, forum topics, folders, a media gallery and seven themes.
  • Extra viewer accounts, share links that open only chosen chats, and browser notifications for new messages.
  • Optional voice transcription.
  • SQLite by default, or PostgreSQL.
  • Docker images for amd64 and arm64.

⁠Quick start

  1. Get an api_id and api_hash for your account at my.telegram.org/apps⁠.

  2. Get the files:

    git clone https://github.com/GeiserX/Telegram-Archive.git
    cd Telegram-Archive
    
  3. Copy the settings file:

    cp .env.example .env
    

    Open .env and set these lines. The three viewer lines start commented out, so remove the # in front of them:

    TELEGRAM_API_ID=12345678
    TELEGRAM_API_HASH=0123456789abcdef0123456789abcdef
    TELEGRAM_PHONE=+15551234567
    VIEWER_USERNAME=admin
    VIEWER_PASSWORD=choose-a-long-password
    VIEWER_TIMEZONE=Europe/London
    
  4. Create the data directory. Both containers run as user ID 1000, so that user must own the directory:

    mkdir -p data && sudo chown -R 1000:1000 data
    
  5. Log in to Telegram:

    docker compose run --rm telegram-backup python -m telegram_archive auth
    

    Telegram sends a login code, and the command asks for it. If the account uses two-step verification, the command also asks for that password. The password is visible as you type, so run this where nobody can see your screen. See Log in to Telegram⁠ if the login fails or must run without a terminal.

  6. Start both containers:

    docker compose up -d
    
  7. Open http://127.0.0.1:8000⁠ and sign in with VIEWER_USERNAME and VIEWER_PASSWORD.

The first backup starts right away. Your first backup⁠ covers the schedule and what to check next.

The compose file pins both images to this release:

drumsergio/telegram-archive:8.17.0
drumsergio/telegram-archive-viewer:8.17.0

⁠Documentation

The full documentation is at geiserx.github.io/Telegram-Archive⁠.

Release notes are in the changelog⁠.

Open an issue⁠ for bugs and questions. The troubleshooting page⁠ says what to include. Report security problems through the security policy⁠, never in a public issue.

⁠License

GPL-3.0. See LICENSE⁠. Built on Telethon⁠.

Tag summary

Content type

Image

Digest

sha256:c47cccbad…

Size

236.3 MB

Last updated

14 minutes ago

docker pull drumsergio/telegram-archive