Configuration file
Every self-host config.toml key, its type, default, purpose and validation rules.
Built from commit f569b4a on Nov 14, 2026
The self-host installer reads TOML and keeps the installed copy at /etc/tach/config.toml. It writes resolved server settings to /etc/tach/runtime.env. Protect both files.
sudo tach validate --config /root/tach-config.toml checks the source file, including SMTP secret sources. Before installation, the equivalent command from the extracted package is sudo python3 -I ./tach.py validate --config /root/tach-config.toml.
Success prints Configuration valid. A validation failure prints tach: and the problem to standard error and exits 1.
File rules
The configuration must have an absolute path, be a regular file rather than a symlink, and be owned by root with no group or other permissions. Use mode 0600 or 0400. SMTP secret files have the same rules.
Unknown keys and invalid section types produce unknown configuration field or invalid section: SECTION. A key that an earlier package accepted and this one removed produces a message naming the key and what to do instead. All four sections, [tls], [smtp], [backup] and [entra], must exist. A missing section produces missing configuration section: SECTION. The [public_ingest] section is optional.
For required strings, an absent, blank or incorrectly typed value produces missing or invalid configuration: KEY. Required integers must be TOML integers, not strings or booleans.
Example-domain placeholders in domain, admin_email, smtp.host, smtp.from and public_ingest.hostname are refused. The error starts configuration still has example values in: and names the fields.
Default below means behavior when a key is omitted. Values in config.example.toml are sample values, not defaults. In particular, America/Chicago, port 587 and retention 14 are examples.
Top level
| Key | Type | Default | Purpose and validation |
|---|---|---|---|
domain |
string | Required | Hostname used for HTTPS. Maximum 253 characters, labels 1 to 63 characters, letters or digits with internal hyphens. No scheme, path or port. Failure: domain must be a hostname without scheme, path or port. |
admin_email |
string | Required | First administrator’s email. Must match an email shape with a dotted domain. Failure: admin_email must be an email address. |
timezone |
string | Required | Installed IANA time zone for accounting days. The nightly backup cycle runs at 04:30 UTC whatever this is. Failure: timezone must be an installed IANA timezone. |
data_dir |
string | Required | Directory containing tach.sqlite. The server keeps its verified backups in data_dir/backups. See storage rules below. |
An existing installation refuses changed data_dir or admin_email with existing install: data_dir/admin_email cannot change; restore to a separate VM.
[tls]
| Key | Type | Default | Purpose and validation |
|---|---|---|---|
mode |
string | Required | acme for an automatically issued public certificate, provided for your certificate, or internal for isolated labs. Other values produce tls.mode must be acme or provided (internal for isolated labs only). |
certificate |
string | Unused outside provided; required with it |
Absolute readable regular non-symlink file containing the PEM full chain. Failure: tls.certificate must be an absolute readable regular file. |
key |
string | Unused outside provided; required with it |
Absolute readable regular non-symlink PEM private-key file. Failure: tls.key must be an absolute readable regular file. Any permission for other users produces TLS private key must not be accessible by other users. |
With provided, the installer copies the files to /etc/caddy/tls/tach-certificate.pem and /etc/caddy/tls/tach-key.pem, owned by root and the caddy group with mode 0640. Renew the source files and rerun the installer before expiry.
ACME requires public DNS resolving to the VM and inbound ports 80 and 443. Internal-only installations need a provided certificate trusted by their clients. internal uses Caddy’s private certificate authority for labs.
[public_ingest]
Optional. Without this section there is no ingest-only hostname. See Ingest-only hostname for DNS, certificates and use.
| Key | Type | Default | Purpose and validation |
|---|---|---|---|
hostname |
string | Required with the section | A second hostname that serves only OTLP ingestion. Must be a fully qualified DNS name, not an IP, numeric-only address or localhost name; failure: public_ingest.hostname must be a hostname without scheme, path or port. It must differ from domain, ignoring letter case, otherwise public_ingest.hostname must differ from domain. An absent or blank value produces missing or invalid configuration: hostname. |
On this hostname, Caddy forwards to Tach only POST /v1/logs and POST /v1/metrics whose request target is exactly that path, with no query string. It answers other origin-form routes with 404 itself. OPTIONS * is handled by Caddy with 200, not forwarded. With the section set, Caddy also refuses with 421 a request whose Host header names a different hostname than the TLS connection was opened for. The hostname uses the [tls] mode: with acme it gets its own certificate; with provided validation requires SAN coverage for both names and does not substitute ACME. tach status checks TLS on both names. Strict SNI is server-wide, so adding this section also refuses SNI-less main-site clients, including IP-SAN requests. Installation fails unless the ingest-only site answers /healthz with 404 under a trusted certificate. A second hostname is not network isolation: restrict direct VM access with a gateway and NSG if the main hostname must stay private. Before removal, repoint exporters, start new sessions and verify fresh receipts, or stop export; then remove exposure and the section and rerun the installer. An unconfigured old name can return an empty 200 without storing usage.
[smtp]
| Key | Type | Default | Purpose and validation |
|---|---|---|---|
host |
string | Required | Mail relay hostname or IP address. Example placeholders are refused. |
port |
integer | Required | From 1 to 65535. Failure: invalid smtp port or TLS mode. |
tls |
string | Required | starttls, tls for implicit TLS, or none. Other modes produce invalid smtp port or TLS mode. none requires a literal loopback IP address, otherwise plaintext SMTP is allowed only on literal loopback for laboratory tests. |
from |
string | Required | Sender mailbox, optionally with a display name. Must contain @ and no newline. Failure: smtp.from must be a sender mailbox. |
username_file |
string | Empty, no credential | Absolute path to a private file containing the relay username. Cannot combine with username_env. |
password_file |
string | Empty, no credential | Absolute path to a private file containing the relay password. Cannot combine with password_env. |
username_env |
string | Empty, no credential | Name of an environment variable containing the username, as an alternative to a file. |
password_env |
string | Empty, no credential | Name of an environment variable containing the password, as an alternative to a file. |
Credential validation produces these messages, with KEY replaced by username or password:
| Condition | Message |
|---|---|
| Both sources set for the same credential | specify only one smtp.KEY_file or smtp.KEY_env |
| Selected file or environment variable is empty or missing | smtp.KEY secret source is empty or missing |
| Resolved value contains a carriage return, embedded newline or NUL | SMTP secrets must be single-line values |
| Only one credential resolves to a value | SMTP username and password must be supplied together |
Trailing newline characters are stripped from secret files. Use both credentials or neither. File sources avoid relying on environment variables surviving sudo.
The installer writes resolved credentials into the root-private /etc/tach/runtime.env. Normal host maintenance reads the installed configuration without resolving the original credential files again.
[backup]
The installer turns these into the server’s own backup settings in /etc/tach/runtime.env. The server runs its backup cycle every night at 04:30 UTC and keeps the backups in data_dir/backups, on the data disk.
| Key | Type | Default | Purpose and validation |
|---|---|---|---|
retention |
integer | Required | Number of verified backups kept, from 1 to 90. The server removes older ones only after a new backup passes. Failure: backup.retention must be between 1 and 90. |
max_mib |
integer | 256 | Largest database a backup accepts, in MiB, from 1 to 16384. A larger database fails the cycle. Each cycle needs three times this plus 64 MiB free on the data disk. Failure: backup.max_mib must be an integer from 1 to 16384. |
azure_account |
string | Empty, no copy | Optional Azure Storage account, 3 to 24 lowercase letters or digits. |
azure_container |
string | Empty, no copy | Optional container, 3 to 63 lowercase letters, digits or hyphens. |
Azure values must be supplied together, otherwise Azure backup account and container must be supplied together. Invalid names produce invalid Azure account or container name.
With both set, each backup that passes its checks is copied to the container as tach-backup-SHA256.sqlite and read back before the server keeps it. The copy uses the Azure CLI’s existing managed-identity login for root; the operator provisions that login and container. A failed copy or readback fails the cycle and keeps the earlier local backups. Remote retention belongs to the operator. Copy subprocesses are cancelled when the requesting cycle ends; restarting the server also stops its copy service.
backup.directory was removed: backups now live in data_dir/backups. A configuration that still sets it is refused with backup.directory is no longer used: ..., which says to delete the line. Files in the old directory are left in place. From 0.3.0, the first image upgrade still uses the old host tool; then rerun install from the new package with the edited config. The old timer is retired only after a successful server restart, and its failed service state is cleared. Change monitoring from tach-backup.service and /etc/tach/last-backup.json to sudo tach status or administrator Health.
Allow space for old backups, retention × database size, the live database/WAL and 3 × max_mib + 64 MiB free. The default 256 MiB cap refuses a larger database and blocks later image switches; choose a measured cap before migration. Local backups and receipts are now writable by the serving container, so separately controlled off-VM custody is essential against host compromise.
[entra]
| Key | Type | Default | Purpose and validation |
|---|---|---|---|
enabled |
boolean | Required | Must be exactly false. Any other value is refused. |
tenant_id |
string | Unused | Accepted placeholder. The validator does not use or type-check its value. |
client_id |
string | Unused | Accepted placeholder. The validator does not use or type-check its value. |
See Sign in for the supported sign-in method.
Storage paths
data_dir must be absolute and cannot be /. Whitespace, commas, colons and NUL characters produce storage paths must be absolute, without whitespace, commas or colons.
A symlink anywhere in the path produces storage paths must not contain symlinks.
Installation adds filesystem and ownership checks. The directory must use local ext4 or XFS storage. An incompatible filesystem produces the data directory requires local ext4/XFS storage; SMB/NFS/ephemeral layers are unsupported. An unexpected owner produces storage directory has an unexpected owner. A fresh installation requires an empty data directory.