Skip to main content

Telegram Archive

Telegram Archive

Docker Pulls GitHub Stars License Release codecov Docs

Telegram Archive is a self-hosted backup of one or more Telegram accounts. It runs in Docker on your own machine 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.
  • Earlier versions of edited messages, and deleted messages kept and marked as deleted, with the real-time listener or the scheduled edit and deletion sync.
  • 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 if you prefer.
  • 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 TELEGRAM_API_ID, TELEGRAM_API_HASH, TELEGRAM_PHONE, VIEWER_USERNAME, VIEWER_PASSWORD and VIEWER_TIMEZONE.

  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
    

    The login code arrives in your Telegram app. If the account uses two-step verification, the command also asks for that password. The password shows on screen as you type, so run this where nobody can see your screen.

  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. For the schedule and what to check next, see Your first backup. 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.

Found a bug or have a question? Open an issue. 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.

Release files for telegram-archive 8.17.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for telegram-archive 8.17.0
File Size Uploaded
telegram_archive-8.17.0.tar.gz 1.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for telegram-archive 8.17.0
File Interpreter ABI Platform
telegram_archive-8.17.0-py3-none-any.whl Python 3 none any Details

Total release size: 3.8 MB

Release files / telegram_archive-8.17.0.tar.gz

Download URL telegram_archive-8.17.0.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
b2bec41201b5553f09da355ffb88da016c94d100399e0e4534bc7e18eadb88b3
BLAKE2b-256 checksum
How to use checksums
47a3ac6571712a862600f7d7d32a251fa6ceb133e016ac00cd33a7c494818132
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release files / telegram_archive-8.17.0-py3-none-any.whl

Download URL telegram_archive-8.17.0-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b209c6bb4308e9d9d6464fd4ee8d40d4c3f5a97e3424d3076719198aecd955ce
BLAKE2b-256 checksum
How to use checksums
e35c8e60898e687f3477aa0c79657fc9ecb780a7d218271ea95858fdde105ad5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

8.18.0

2 release files

This release

8.17.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page