Telegram Archive
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.
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
-
Get an
api_idandapi_hashfor your account at my.telegram.org/apps. -
Get the files:
git clone https://github.com/GeiserX/Telegram-Archive.git cd Telegram-Archive
-
Copy the settings file:
cp .env.example .env
Open
.envand setTELEGRAM_API_ID,TELEGRAM_API_HASH,TELEGRAM_PHONE,VIEWER_USERNAME,VIEWER_PASSWORDandVIEWER_TIMEZONE. -
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
-
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.
-
Start both containers:
docker compose up -d
-
Open http://127.0.0.1:8000 and sign in with
VIEWER_USERNAMEandVIEWER_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.
- Run with Docker
- Your first backup
- Install from PyPI
- Choosing chats
- Using the viewer
- Environment variables
- Upgrading
- Monitoring and troubleshooting
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
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)
| File | Size | Uploaded | |
|---|---|---|---|
| telegram_archive-8.17.0.tar.gz | 1.9 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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