Documentation menu
Getting started
New in v2.0
Feature deep dives
Reference
Configuration
Configuration & Environment Reference
Exhaustive reference of AutoTelegramForward environment variables, database URLs, port mappings, and performance tuning parameters.
Verified against the checkout built for v2.2.4 · updated 20 Oct 2026
Overview
AutoTelegramForward is configured via environment variables, loaded automatically from .env in the working directory. Configuration is strictly typed and validated at application startup.
Environment Variables Reference
| Variable | Type | Required | Default | Description |
|---|---|---|---|---|
| TELEGRAM_API_ID | integer | Required | None | Telegram Application ID obtained from my.telegram.org. |
| TELEGRAM_API_HASH | string | Required | None | 32-character Telegram API Hash from my.telegram.org. |
| TELEGRAM_BOT_TOKEN | string | Required | None | Telegram Bot Token from @BotFather for the management UI. |
| ADMIN_USER_ID | integer | Required | None | Primary admin Telegram numerical ID for fail-closed root access. |
| DATABASE_URL | string | Optional | sqlite:///data/atf.db | Database connection string. Supports SQLite WAL mode and PostgreSQL. |
| GRPC_PORT | integer | Optional | 50051 | Internal gRPC port for communication between atf-core and atf-api. |
| API_PORT | integer | Optional | 8080 | HTTP port for the Go API gateway. |
| LOGGER_PORT | integer | Optional | 50052 | gRPC port for centralized structured telemetry logger. |
| WEB_PORT | integer | Optional | 8088 | HTTP port for the Web Dashboard interface. |
| DURABLE_QUEUE_WORKERS | integer | Optional | 4 | Number of parallel queue worker coroutines per tenant. |
| MAX_TIME_EDIT_DEFAULT | integer | Optional | 86400 | Maximum message age in seconds to accept edit synchronizations. |
| LOG_LEVEL | string | Optional | INFO | Logging verbosity (DEBUG, INFO, WARNING, ERROR). |
Database Selection: SQLite vs PostgreSQL
SQLite (Default & Embedded)
Ideal for single-server setups forwarding hundreds of messages per hour. ATF automatically configures:
PRAGMA journal_mode=WAL;
PRAGMA busy_timeout=5000;
PRAGMA synchronous=NORMAL;PostgreSQL (Enterprise Scale)
Recommended for high-concurrency clusters with thousands of simultaneous channels. Supply standard URI:
DATABASE_URL=postgresql://user:pass@postgres:5432/atf_db