Termsheep Cloud is coming soon.Cloud is coming soon.Join the waitlist →

Configure the platform

All platform environment settings with defaults, plus the Compose-only deployment variables.

Last updated

On this page

Use the arrow keys to scroll the table.

Environment variables

Compose reads .env for interpolation and gives the server only settings listed under its environment. To set an additional binary setting, add it under services.platform.environment in a Compose override. Recreate the container after changing settings. Keep database, SMTP and Redis URLs with credentials in protected files and out of support output.

These platform settings are forwarded directly from .env.

Compose file Forwarded settings
docker-compose.yml TERMSHEEP_PUBLIC_URL, TERMSHEEP_DOCS_URL, TERMSHEEP_SMTP_URL, TERMSHEEP_MAIL_FROM, TERMSHEEP_TRUST_PROXY, TERMSHEEP_MODE, TERMSHEEP_AUTH_RATE_PER_MIN, TERMSHEEP_ACCOUNT_RATE_PER_MIN, TERMSHEEP_PEPPER_FILE, TERMSHEEP_REDIS_URL, TERMSHEEP_CHECK_TIMEOUT_SECS, TERMSHEEP_SERVICE_TIMEOUT_SECS
docker-compose.release.yml TERMSHEEP_PUBLIC_URL, TERMSHEEP_DOCS_URL, TERMSHEEP_SMTP_URL, TERMSHEEP_MAIL_FROM, TERMSHEEP_TRUST_PROXY

The source image supplies TERMSHEEP_BIND, TERMSHEEP_CONTAINER, RUST_LOG and TERMSHEEP_LOG_FORMAT defaults. In release Compose, the serving role URLs, self-hosted mode and pepper path come from the stack configuration.

Variable Default Purpose
DATABASE_URL Required for one database login PostgreSQL connection string supplied by Compose. In split mode, pass the owner URL only to the migration command.
TERMSHEEP_APP_DATABASE_URL Unset Connection for the termsheep_app role in split mode.
TERMSHEEP_SYSTEM_DATABASE_URL Unset Connection for the system role in split mode.
TERMSHEEP_BIND 0.0.0.0:8080 Binary listen address.
TERMSHEEP_MODE self-hosted self-hosted: initial setup, then invitations by default. cloud: open sign-up with a tenant per sign-up; hosted service remains planned.
TERMSHEEP_PUBLIC_URL Unset Required for self-hosted production and SMTP. Use an HTTPS origin, or loopback HTTP for setup. No path beyond /, credentials, query or fragment. Source Compose supplies http://127.0.0.1:8080. Release Compose uses http://127.0.0.1:${TERMSHEEP_HOST_PORT:-8080}, so the default origin follows TERMSHEEP_HOST_PORT.
TERMSHEEP_SMTP_URL Unset Secret SMTP URL. Use TLS for a remote relay. See SMTP.
TERMSHEEP_MAIL_FROM unset Required sender when SMTP is set.
TERMSHEEP_TRUST_PROXY false Trust nearest forwarded address only behind a protected proxy.
TERMSHEEP_PEPPER_FILE Unset Optional external sealing-key file with at least 32 secret bytes. Mount it read-only. Setting the variable alone mounts no file. When unset, the server uses the managed pepper file in its data directory.
TERMSHEEP_DATA_DIR ./data Writable private directory on persistent storage for server-managed secrets. Back up its pepper file with the database.
TERMSHEEP_SETUP_SECRET_FILE Generated setup-secret file if neither setting is supplied Private file with the first administrator’s one-time setup proof of at least 32 characters. Takes precedence over the direct value.
TERMSHEEP_SETUP_SECRET Unset Direct setup proof of at least 32 characters. Remove the configured proof after the first account commits.
TERMSHEEP_ACCESS_TTL_SECS 900 Access token lifetime in seconds.
TERMSHEEP_REFRESH_TTL_DAYS 30 Rotating refresh token lifetime in days.
TERMSHEEP_AUTH_RATE_PER_MIN 20 Authentication attempts per IP/minute; IPv6 grouped by /64.
TERMSHEEP_SCIM_AUTH_RATE_PER_MIN 120 SCIM authentication attempts per IP per minute. Uses a separate budget from app authentication. Configure it in a Compose override.
TERMSHEEP_ACCOUNT_RATE_PER_MIN 10 Per-account password and invitation limit. Unset or empty: max(floor(auth rate / 2), 5).
TERMSHEEP_WEBHOOKS_ALLOW_LOOPBACK false Allow webhook targets on loopback for local integrations.
TERMSHEEP_SSO_ALLOW_LOOPBACK false Allow HTTP SSO providers on loopback in tests.
RUST_LOG info,sqlx=warn Tracing filter. An unset or invalid filter uses the default.
TERMSHEEP_LOG_FORMAT json (release/container), text (debug) Override with json or text; read at binary startup.
TERMSHEEP_DOCS_URL Unset HTTPS base URL for the web interface’s localized help links. Without a valid HTTPS URL, those links are omitted.
TERMSHEEP_CHECK_TIMEOUT_SECS 30 Startup and check deadline for PostgreSQL checks including retries, in seconds (1–300).
TERMSHEEP_SERVICE_TIMEOUT_SECS 5 Time limit per optional service check, in seconds (1–300).
TERMSHEEP_REDIS_URL Unset Enables a startup check for Redis 7.2.0 or later. Product features currently do not use Redis. Accepts redis:// or certificate-verified rediss://. The login must allow INFO server.
TERMSHEEP_CONTAINER Unset (1 in the container image) Forces container detection during startup checks. A container must run as a non-root user.
TOPCOAT_DEV_URL Unset Local web development asset URL. Enables development allowances in the startup checks and web content security policy. Leave unset in production.

After self-hosted setup, a tenant admin can enable SSO just-in-time provisioning. Eligible people signing in through the provider can join its designated organization without an invitation. Create additional tenants with termsheep-platform tenant create.

Persistent server data

Mount a private, writable directory before starting either read-only Compose stack. Create server-data in the installation directory and give the container's non-root user write access. On a Linux Docker host without user namespace remapping, for example, the image runs as UID and GID 65532. Give that account ownership of the directory and restrict its access to mode 0700. Save this override as compose.data.yml and add it to the installation's complete COMPOSE_FILE list.

services:
  platform:
    environment:
      TERMSHEEP_DATA_DIR: /var/lib/termsheep
    volumes:
      - ./server-data:/var/lib/termsheep

The server logs the generated setup-secret file's path for first sign-up. The generated file disappears after the first account commits. The managed pepper is the server's sealing key. Startup migrates a legacy database pepper to this file without changing its bytes. Preserve the original file and its permissions with the database backup.

Set TERMSHEEP_PUBLIC_URL to the origin users open, before enabling remote access. Without an effective public origin the server warns at startup and refuses invitation and credential email links, browser SSO callbacks and generated agent configuration. A loopback listener may provide its bound address for local use. SMTP configuration requires an explicit public URL.

Set the broker and signer credentials as private files.

Compose-only settings

Variable Default Purpose
TERMSHEEP_PORT 127.0.0.1:8080 Compose published binding, not a Config struct setting.
POSTGRES_PASSWORD Required by source Compose Source database password. Use a newly generated URL-safe hex value and protect .env.
TERMSHEEP_DOMAIN localhost Compose Caddy hostname; replace with a real DNS name.
TERMSHEEP_IMAGE termsheep-platform:latest for source Compose Local image name for source builds. Release Compose requires the verified image repository and digest.
TERMSHEEP_IMAGE_DIGEST Required by release Compose Verify this SHA-256 digest before deployment. Release Compose requires both the image repository and digest.
TERMSHEEP_HOST_PORT 8080 Release Compose publishes the platform on this port on 127.0.0.1.
TERMSHEEP_OWNER_DB_PASSWORD Required by release Compose Owner password for the migration service.
TERMSHEEP_APP_DB_PASSWORD Required by release Compose Password for the restricted application database login.
TERMSHEEP_SYSTEM_DB_PASSWORD Required by release Compose Password for the system database login.

Split database roles and an external pepper

For a verified release digest, the image-only setup uses docker/setup-release.sh to generate protected URL-safe hexadecimal passwords and a pepper file. PostgreSQL uses the owner password. The one-shot migration service is the only platform process that receives DATABASE_URL. Serving uses the two restricted URLs and mounts the pepper read-only. Both role passwords are supplied to the migration job in files.

A manual deployment uses termsheep-platform migrate --app-password-file FILE --system-password-file FILE with the owner's DATABASE_URL. Use the original password bytes in the files and percent-encode the password portion in PostgreSQL URLs if needed. Start the server with TERMSHEEP_APP_DATABASE_URL and TERMSHEEP_SYSTEM_DATABASE_URL together and leave DATABASE_URL unset in its environment. Keep credentials and their files in sync.

For a new source stack that needs an external pepper, save this override as compose.pepper.yml next to docker-compose.yml.

services:
  platform:
    environment:
      TERMSHEEP_PEPPER_FILE: /run/secrets/pepper
    secrets:
      - pepper
secrets:
  pepper:
    file: ./secrets/pepper

Add this line to the installation's .env before starting the platform. Keep a single COMPOSE_FILE entry. Compose then uses both files for every command and for the backup helpers.

COMPOSE_FILE=docker-compose.yml:compose.data.yml:compose.pepper.yml

Compose mounts the pepper secret read-only. For a new installation, generate it with openssl rand -hex 32. Keep the host directory private, make the file readable by the non-root container user and keep a separate protected copy. On an existing instance preserve the original file and mode. See backups.

Release Compose file selection

In the installation directory, record all Compose files in one COMPOSE_FILE entry in .env. Put docker-compose.release.yml first and list each override in its usual order. On Unix, separate file names with a colon. This example uses compose.local.yml after the release file.

COMPOSE_FILE=docker-compose.release.yml:compose.local.yml

Use the installation directory and docker compose without -f for TLS, backups, restore and upgrades. Preserve the complete list and the override files with your configuration.

Build metadata

Variable Default Purpose
TERMSHEEP_BUILD_COMMIT Checked-out commit when available Accepts a 7–40 character hexadecimal build-time override. Recorded as unavailable when neither value is available.
TERMSHEEP_BUILD_RUSTC Compiler version Embedded by the build. No runtime override.

Log filtering

Keep logs restricted and remove sensitive metadata before sharing them.