selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

TG Vault logo

Self-host TG Vault

v2.6.0

Telegram file archiver with multi-cloud storage

ReleaseOpen SourceMIT
Updated12 hours ago
LanguageTypescript
Setup difficultyAdvanced
Stars
275
CPU
1.5 cores (container limit)
RAM
512 MB reservation, 1536 MB limit
Storage
8 GB reserved for chunks, plus space for uploads/thumbnails/previews
Ports
80 (Web frontend), 51947 (Backend API)
Requires
PostgreSQL
Docker
ghcr.io/hicocos/tg-vault-backend
Install with Docker Compose
Storage source settings page showing local storage and expandable cloud storage typesOneDrive configuration form with client ID, tenant, display name, and client secret fieldsGoogle Drive configuration form with client ID, secret, and optional shared drive IDAliyun OSS configuration form showing region, bucket, and RAM AccessKey ID/SecretS3-compatible storage configuration form with endpoint, region, bucket, and access keysWebDAV configuration form with server URL, optional username and password/app password

What is TG Vault?

TG Vault is a self-hosted Telegram file archiving and private cloud system. It receives files from Telegram Bot or web uploads, stores them to local disk or multiple cloud storage providers (OneDrive, Google Drive, Aliyun OSS, S3-compatible, WebDAV, OpenList), and provides a web file manager with search, folders, previews, and a unified task center. It supports channel/group historical downloads and subscriptions via a user-account downloader. Deployment uses Docker Compose with an automated install script that generates secrets and starts frontend, backend, and PostgreSQL 16 containers. All sensitive credentials are encrypted at rest. The project is open source under MIT license with active development.

Should you self-host TG Vault?

TG Vault scores 48/100 on selfhost.directory (how scoring works) and ranks #21 of 34 in File Management. It has 275 GitHub stars.

It shipped 10 stable releases in the past year. The latest, v2.6.0, came out on 27 October 2026. New versions land roughly every 2 days.

Setup is advanced: plan for several services and some ongoing maintenance. An official Docker image is available. It is MIT-licensed and written mostly in Typescript.

Its closest alternative on selfhost.directory is AList (83/100, 50 366 stars). It scores higher overall, so compare the two before you pick. See TG Vault vs AList side by side.

Features

  • Automated backup and restore
  • Channel/group historical download
  • Channel subscription sync
  • Encrypted credentials storage
  • File preview and thumbnailsRequires ffmpeg for video thumbnails
  • Health check endpoints
  • Multi-storage Support
  • Resumable task chains
  • Storage target snapshots
  • Telegram file archiving
  • TOTP two-factor authentication
  • Unified task center
  • Web-based Telegram Bot configuration
  • Web file manager

TG Vault README

How to install TG Vault

Install TG Vault with Docker Compose

Environment variables
VITE_API_URL, CORS_ORIGIN, DB_PASSWORD, SESSION_SECRET, STORAGE_CREDENTIALS_SECRET, PORT, etc.

git clone https://github.com/hicocos/tg-vault.git cd tg-vault ./deploy/install.sh

Automated install script generates .env, secrets, builds and starts containers

How to configure TG Vault

  • ALLOW_INSECURE_STORAGE_ENDPOINTSfalseAllow non-HTTPS storage endpoints (high risk)

    Allow non-HTTPS storage endpoints (high risk)

    values: true/false

  • AUTO_CLEANUP_ORPHANStrueClean up unindexed local orphan files

    Clean up unindexed local orphan files

    values: true/false

  • CHUNK_COMPLETION_LEASE_MS1800000Chunk merge completion lease (default 30min)

    Chunk merge completion lease (default 30min)

  • CHUNK_DIR/data/chunksChunked upload staging directory (container path)

    Chunked upload staging directory (container path)

  • CHUNK_DISK_RESERVE_GB8Disk reserve for chunked uploads (GiB)

    Disk reserve for chunked uploads (GiB)

  • CHUNK_GLOBAL_BUDGET_GB40Global chunked upload budget (GiB)

    Global chunked upload budget (GiB)

  • CHUNK_SESSION_TTL_MS86400000Upload session TTL (default 24h)

    Upload session TTL (default 24h)

  • COOKIE_SECUREtrueSend login cookie only over HTTPS

    Send login cookie only over HTTPS

    values: true/false

  • COOKIE_SECURE_FORCEOverride COOKIE_SECURE; true/false

    Override COOKIE_SECURE; true/false

    values: true/false

  • CORS_ORIGINAllowed web frontend origin(s); comma-separated for multiple

    Allowed web frontend origin(s); comma-separated for multiple

    values: https://cloud.example.com

  • DB_PASSWORDPostgreSQL password; generated by installer

    PostgreSQL password; generated by installer

    values: 64-char hex

  • DUPLICATE_FILE_MODEcopycopy = create duplicate; skip = skip same dir/name/size

    copy = create duplicate; skip = skip same dir/name/size

    values: copy/skip

  • JSON_BODY_LIMIT2mbJSON request body limit

    JSON request body limit

  • LOG_LEVELinfoApplication log level

    Application log level

  • MAX_CHUNK_UPLOAD_GB20Single chunked upload session total size limit (GiB)

    Single chunked upload session total size limit (GiB)

  • MAX_TOTAL_CHUNKS50000Chunk count protection limit

    Chunk count protection limit

  • MAX_UPLOAD_CHUNK_MB32Single upload chunk size limit (MiB)

    Single upload chunk size limit (MiB)

  • OAUTH_CALLBACK_BASE_URLinherits VITE_API_URLOneDrive/Google Drive callback origin

    OneDrive/Google Drive callback origin

  • OAUTH_FRONTEND_ORIGINinherits CORS_ORIGINOAuth completion frontend origin

    OAuth completion frontend origin

  • ORPHAN_CLEANUP_MIN_AGE_MS600000New file protection period (default 10min)

    New file protection period (default 10min)

  • PORT51947Backend listen port and host API port

    Backend listen port and host API port

  • PREVIEW_DIR/data/previewsPreview derivatives directory (container path)

    Preview derivatives directory (container path)

  • SESSION_SECRETFile link signing and TOTP encryption key

    File link signing and TOTP encryption key

    values: 32+ random chars

  • SQL_LOG_ALLfalseLog all SQL statements

    Log all SQL statements

    values: true/false

  • SQL_LOG_SLOW_MS500Slow SQL log threshold

    Slow SQL log threshold

  • STORAGE_CREDENTIALS_SECRETStorage and sensitive config encryption key

    Storage and sensitive config encryption key

    values: 32+ random chars

  • STORAGE_PROBE_TIMEOUT_MS15000Storage probe timeout

    Storage probe timeout

  • TG_VAULT_SECRET_DIR/data/secretsInternal persistent keys directory when not set via env

    Internal persistent keys directory when not set via env

  • THUMBNAIL_DIR/data/thumbnailsThumbnails directory (container path)

    Thumbnails directory (container path)

  • TOTP_SECRETOverride database TOTP secret (advanced)

    Override database TOTP secret (advanced)

    values: base32 secret

  • TRUST_PROXYloopbackExpress trust proxy range

    Express trust proxy range

  • UPDATE_CHECK_ENABLEDtrueEnable update check

    Enable update check

    values: true/false

  • UPDATE_CHECK_REPOSITORYhicocos/tg-vaultRepository to check for updates

    Repository to check for updates

  • UPLOAD_DIR/data/uploadsLocal files and download staging directory (container path)

    Local files and download staging directory (container path)

  • VITE_API_URLBrowser-accessible API origin; injected into frontend at container start

    Browser-accessible API origin; injected into frontend at container start

    values: https://api.example.com

  • WEBDAV_INACTIVITY_TIMEOUT_MS300000WebDAV inactivity timeout

    WebDAV inactivity timeout

  • WEBDAV_UPLOAD_TIMEOUT_MS21600000WebDAV upload total timeout (default 6h)

    WebDAV upload total timeout (default 6h)

TG Vault releases & version history

More in Cloud Storage

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…