Configuration overview
Config files, environment variables, and CLI flags.
Precedence
built-in defaults < config file < TELDRIVE_* environment < explicit CLI flagsConfig files
Without --config, Teldrive checks:
~/.teldrive/config.toml
~/.teldrive/config.yaml
~/.teldrive/config.yml
./config.toml
./config.yaml
./config.ymlExplicit path:
teldrive run --config /etc/teldrive/config.tomlSupported formats: TOML, YAML, YML.
Match the file extension to the example format. Do not paste a YAML example into config.toml. For example, these configurations are equivalent:
config.toml:
[telegram]
upload-threads = 8config.yaml:
telegram:
upload-threads: 8Most guides use YAML for brevity. Use a .yaml file for those examples, or translate their nested sections to TOML tables as shown above.
In the official Docker/Podman image, ~ is /home/nonroot. Mount your host config file read-only at /home/nonroot/.teldrive/config.toml; see Mount a config file for examples and permissions.
Name mapping
telegram.upload-threads
TELDRIVE_TELEGRAM_UPLOAD_THREADS
--telegram-upload-threadsEnvironment names use TELDRIVE_ + uppercase/underscores. CLI flags flatten nested keys with hyphens.
Required values
database:
url: postgres://...
security:
signing-key: YOUR_SIGNING_KEY
data-key: YOUR_DATA_KEYsecurity.data-key must decode to exactly 32 bytes. The Quick Start generator creates compatible values.
For a PgDog endpoint, review the pooling, authentication, and migration considerations before setting database.url.
Validate
teldrive check --config /etc/teldrive/config.tomlCompose:
docker compose run --rm teldrive check