https://github.com/aliuq/apps-image/tree/master/base/tg-session
1.2K
A Telegram session string generator with QR code login support. This tool helps you generate session strings for Telegram applications.
Get API Credentials
API_ID and API_HASHRun Container
# Basic usage
docker run -it --rm --name tg-session -v "$(pwd)":/app/session aliuq/tg-session
# Debug mode (displays session string in console)
docker run -it --rm --name tg-session -e DEBUG=true aliuq/tg-session
# With API credentials
docker run -it --rm \
--name tg-session \
-v "$(pwd)":/app/session \
-e API_ID=your_api_id \
-e API_HASH=your_api_hash \
aliuq/tg-session
The generated session string will be saved in ./.session file.
If your Telegram account has 2FA enabled, the tool will prompt for the password after the QR code is scanned.
The QR code now shows a live countdown in the terminal and will automatically refresh when Telegram marks it as expired.
API_ID - Telegram API ID from my.telegram.orgAPI_HASH - Telegram API Hash from my.telegram.orgDEBUG - Set to "true" to display session string in console (default: false)# Standard build
docker build -t tg-session .
# Build with buildx
docker buildx build -t tg-session --load .
# Build with detailed progress
docker buildx build --progress=plain -t tg-session --load .
# Rebuild the image
docker build -t tg-session .
# Run the local smoke test inside the container image
docker run --rm \
--entrypoint python \
-v "$(pwd)":/workspace \
-w /workspace \
tg-session \
smoke_test.py
Content type
Image
Digest
sha256:6506309b5…
Size
23.3 MB
Last updated
5 months ago
docker pull aliuq/tg-session