Configuration overview
Skip to Content
Teldrive
Configuration

Configuration overview

Config files, environment variables, and CLI flags.

Precedence

built-in defaults < config file < TELDRIVE_* environment < explicit CLI flags

Config files

Without --config, Teldrive checks:

~/.teldrive/config.toml
~/.teldrive/config.yaml
~/.teldrive/config.yml
./config.toml
./config.yaml
./config.yml

Explicit path:

teldrive run --config /etc/teldrive/config.toml

Supported 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 = 8

config.yaml:

telegram:
  upload-threads: 8

Most 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-threads

Environment 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_KEY

security.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.toml

Compose:

docker compose run --rm teldrive check

Guides