Skip to content

Environment Variables

Every chatto.toml setting can be overridden with an environment variable. The naming pattern is CHATTO_{SECTION}_{KEY} in uppercase.

CHATTO_LOG_LEVEL
info
general.log_level

Log level. Values: debug, info, warn, error.

CHATTO_WEBSERVER_URL
required
webserver.url

Public URL of the instance, used for absolute links and OAuth redirects.

CHATTO_WEBSERVER_PORT
4000
webserver.port

Port to listen on.

CHATTO_WEBSERVER_COOKIE_SIGNING_SECRET
required
webserver.cookie_signing_secret

256-bit hex secret for signing session cookies. Generate with openssl rand -hex 32.

CHATTO_WEBSERVER_WEBSOCKET_COMPRESSION
true
webserver.websocket_compression

Enable WebSocket compression.

CHATTO_WEBSERVER_REQUEST_LOGGING
false
webserver.request_logging

Log HTTP requests.

CHATTO_WEBSERVER_ALLOWED_ORIGINS
webserver.allowed_origins

Comma-separated list of origins allowed for cross-origin requests (CORS and WebSocket). The instance’s own origin (from webserver.url) and localhost at the listen port are always allowed. Defaults to * (wildcard) when not set, allowing any origin for multi-instance support — cross-origin clients authenticate via Bearer tokens, not cookies. Set explicitly to restrict which origins can access the API.

Built-in automatic TLS via Let’s Encrypt. When enabled, Chatto handles certificate provisioning and renewal automatically.

CHATTO_WEBSERVER_TLS_ENABLED
false
webserver.tls.enabled

Enable automatic TLS via Let’s Encrypt. Requires ports 80 and 443 (or custom ports configured below).

CHATTO_WEBSERVER_TLS_DOMAIN
webserver.tls.domain

Domain name for the TLS certificate. Required when TLS is enabled.

CHATTO_WEBSERVER_TLS_EMAIL
webserver.tls.email

Email address for Let’s Encrypt notifications. Required when TLS is enabled.

CHATTO_WEBSERVER_TLS_CACHE_DIR
.chatto/certs
webserver.tls.cache_dir

Directory to cache TLS certificates.

CHATTO_WEBSERVER_TLS_HTTP_PORT
80
webserver.tls.http_port

Port for the HTTP server (ACME challenges and HTTPS redirect). Use a higher port if running without elevated privileges.

CHATTO_CORE_ASSETS_SIGNING_SECRET
required
core.assets.signing_secret

256-bit hex secret for signing asset URLs. Generate with openssl rand -hex 32.

CHATTO_CORE_ASSETS_MAX_UPLOAD_SIZE
25 MB
core.assets.max_upload_size

Max upload size for images and non-video files (e.g., 25MB, 25 MiB). Videos use a separate limit — see CHATTO_VIDEO_MAX_UPLOAD_SIZE.

CHATTO_CORE_ASSETS_STORAGE_BACKEND
nats
core.assets.storage_backend

Storage backend for file attachments. Values: nats, s3.

Only used when storage_backend is set to s3. See the S3 Storage guide for setup instructions.

CHATTO_CORE_ASSETS_S3_ENDPOINT
core.assets.s3.endpoint

S3 endpoint URL (e.g., s3.amazonaws.com for AWS, or a custom endpoint for S3-compatible services).

CHATTO_CORE_ASSETS_S3_BUCKET
core.assets.s3.bucket

S3 bucket name. Created automatically on startup if it doesn’t exist.

CHATTO_CORE_ASSETS_S3_REGION
core.assets.s3.region

AWS region. Optional for non-AWS S3-compatible services.

CHATTO_CORE_ASSETS_S3_ACCESS_KEY_ID
core.assets.s3.access_key_id

S3 access key ID.

CHATTO_CORE_ASSETS_S3_SECRET_ACCESS_KEY
core.assets.s3.secret_access_key

S3 secret access key.

CHATTO_CORE_ASSETS_S3_USE_SSL
true
core.assets.s3.use_ssl

Use HTTPS for S3 connections.

CHATTO_CORE_ASSETS_S3_PATH_STYLE
false
core.assets.s3.path_style

Use path-style URLs instead of virtual-hosted. Required for most S3-compatible services (Cloudflare R2, Wasabi, Backblaze B2, etc.).

CHATTO_CORE_ASSETS_CACHE_ENABLED
false
core.assets.cache.enabled

Enable caching for resized images. Reduces CPU usage for repeated thumbnail generation.

CHATTO_CORE_ASSETS_CACHE_TTL
7d
core.assets.cache.ttl

Time-to-live for cached images. Supports durations like 7d, 1w, 168h.

CHATTO_NATS_REPLICAS
1
nats.replicas

Number of replicas for JetStream streams, KV buckets, and object stores. Must be an odd number (1, 3, or 5) for quorum. Set to 3 or 5 when running a NATS cluster for fault tolerance.

CHATTO_NATS_EMBEDDED_ENABLED
true
nats.embedded.enabled

Enable the embedded NATS server. Set to false when connecting to an external NATS server.

CHATTO_NATS_EMBEDDED_PORT
4222
nats.embedded.port

Embedded NATS server port. Set to 0 to disable the TCP listener (in-process only).

CHATTO_NATS_EMBEDDED_BIND_ADDRESS
127.0.0.1
nats.embedded.bind_address

Embedded NATS server bind address.

CHATTO_NATS_EMBEDDED_HTTP_PORT
0
nats.embedded.http_port

NATS monitoring/stats HTTP port. Set to 0 to disable. Useful for debugging with the NATS dashboard.

CHATTO_NATS_EMBEDDED_DATA_DIR
./data
nats.embedded.data_dir

JetStream data directory for the embedded server.

CHATTO_NATS_EMBEDDED_AUTH_TOKEN
nats.embedded.auth_token

Auth token for the embedded NATS server. Must match CHATTO_NATS_CLIENT_TOKEN when using token auth.

CHATTO_NATS_CLIENT_URL
nats://localhost:4222
nats.client.url

NATS server URL to connect to. Supports comma-separated URLs for cluster failover (e.g., nats://n1:4222,nats://n2:4222).

CHATTO_NATS_CLIENT_AUTH_METHOD
token
nats.client.auth_method

NATS authentication method. Values: none, token, userpass, credentials, nkey.

CHATTO_NATS_CLIENT_TOKEN
nats.client.token

NATS auth token (when using token auth method). Must match CHATTO_NATS_EMBEDDED_AUTH_TOKEN when using the embedded server.

CHATTO_NATS_CLIENT_USERNAME
nats.client.username

NATS username (when using userpass auth method).

CHATTO_NATS_CLIENT_PASSWORD
nats.client.password

NATS password (when using userpass auth method).

CHATTO_NATS_CLIENT_CREDENTIALS_FILE
nats.client.credentials_file

Path to .creds file (when using credentials auth method).

CHATTO_NATS_CLIENT_NKEY_SEED
nats.client.nkey_seed

NKey seed (when using nkey auth method).

CHATTO_AUTH_DIRECT_REGISTRATION
true
auth.direct_registration

Enable direct (email/password) registration. When false, the registration page is hidden and the registration API returns 403. Users can still sign in via configured SSO providers.

CHATTO_AUTH_TOKEN_TTL
90d
auth.token_ttl

TTL for bearer auth tokens. Supports durations like 90d, 2160h. Tokens older than this are automatically invalidated.

CHATTO_AUTH_OIDC_ENABLED
false
auth.oidc.enabled

Enable OIDC sign-in (e.g. via Chatto Hub).

CHATTO_AUTH_OIDC_ISSUER_URL
auth.oidc.issuer_url

OIDC issuer URL. Used for discovery via /.well-known/openid-configuration.

CHATTO_AUTH_OIDC_CLIENT_ID
auth.oidc.client_id

OIDC client ID, obtained from your OIDC provider.

CHATTO_AUTH_OIDC_CLIENT_SECRET
auth.oidc.client_secret

OIDC client secret.

CHATTO_AUTH_OIDC_LABEL
Chatto Hub
auth.oidc.label

Button label shown on the login page for the OIDC provider.

CHATTO_SMTP_ENABLED
false
smtp.enabled

Enable SMTP email sending.

CHATTO_SMTP_HOST
smtp.host

SMTP server hostname.

CHATTO_SMTP_PORT
smtp.port

SMTP port. Common values: 587 (TLS), 465 (SSL), 25 (unencrypted).

CHATTO_SMTP_USERNAME
smtp.username

SMTP username.

CHATTO_SMTP_PASSWORD
smtp.password

SMTP password.

CHATTO_SMTP_FROM
smtp.from

From address for outgoing emails.

CHATTO_PUSH_ENABLED
false
push.enabled

Enable Web Push notifications.

CHATTO_PUSH_VAPID_PUBLIC_KEY
push.vapid_public_key

VAPID public key for Web Push. Generate with npx web-push generate-vapid-keys.

CHATTO_PUSH_VAPID_PRIVATE_KEY
push.vapid_private_key

VAPID private key for Web Push.

CHATTO_PUSH_VAPID_SUBJECT
push.vapid_subject

VAPID subject identifier. Must be a mailto: or https: URL.

CHATTO_VIDEO_ENABLED
false
video.enabled

Enable server-side video processing. When enabled, uploaded videos are transcoded into multiple quality variants for adaptive playback. Requires ffmpeg and ffprobe to be available on the server.

CHATTO_VIDEO_FFMPEG_PATH
video.ffmpeg_path

Path to the ffmpeg binary. If not set, Chatto looks for ffmpeg in PATH.

CHATTO_VIDEO_FFPROBE_PATH
video.ffprobe_path

Path to the ffprobe binary. If not set, Chatto looks for ffprobe in PATH.

CHATTO_VIDEO_MAX_CONCURRENT
2
video.max_concurrent

Maximum number of videos to process concurrently. Higher values use more CPU and memory.

CHATTO_VIDEO_MAX_UPLOAD_SIZE
100 MB
video.max_upload_size

Max upload size for video files (e.g., 100MB, 200 MiB). Only applies when video processing is enabled. Non-video files use CHATTO_CORE_ASSETS_MAX_UPLOAD_SIZE instead.

CHATTO_VIDEO_TEMP_DIR
video.temp_dir

Directory for temporary files during transcoding. Defaults to the system temp directory.

CHATTO_LIVEKIT_ENABLED
false
livekit.enabled

Enable LiveKit voice and video call support. Requires a running LiveKit server.

CHATTO_LIVEKIT_URL
livekit.url

LiveKit server WebSocket URL. Use ws:// for development, wss:// for production.

CHATTO_LIVEKIT_API_KEY
livekit.api_key

LiveKit API key for authentication.

CHATTO_LIVEKIT_API_SECRET
livekit.api_secret

LiveKit API secret for signing JWT tokens. Keep this confidential.

CHATTO_LIVEKIT_WEBHOOK_URL
livekit.webhook_url

URL where LiveKit sends webhook events. Defaults to {webserver.url}/webhooks/livekit.

CHATTO_LIVEKIT_INSTANCE_ID
livekit.instance_id

Unique identifier for this Chatto instance, prefixed to LiveKit room names. Required when multiple Chatto replicas share the same LiveKit cluster, so that webhook events can be routed correctly. When empty, room names use the unprefixed format.

CHATTO_LIVEKIT_WEBHOOK_API_KEY
livekit.webhook_api_key

API key that LiveKit uses to sign webhook requests. When multiple Chatto replicas share a LiveKit cluster, the webhook signing key may differ from the per-replica API key. Falls back to CHATTO_LIVEKIT_API_KEY when not set.

CHATTO_LIVEKIT_WEBHOOK_API_SECRET
livekit.webhook_api_secret

API secret for validating webhook signatures. Falls back to CHATTO_LIVEKIT_API_SECRET when not set.

CHATTO_ADMIN_EMAILS
admin.emails

Comma-separated list of instance admin email addresses. Only verified email addresses are matched.