Docs / Reference

domain.env

The one file that names your Otto server: its domain and every name derived from it. Read by the deploy, which hands each name to the services that need it. Used by Self-host Otto on your own domain.

The file

The path is /etc/otto-deploy/domain.env on the server, written by root and kept out of git. It holds KEY=VALUE lines, one per key. The file is read as data, so nothing in it is run. It follows these rules:

OTTO_DOMAIN=example.org

That one line is enough. Every other key has a default built from OTTO_DOMAIN.

Keys

KeyDefaultMeaning
OTTO_DOMAINRequiredYour domain, such as example.org. The other defaults are built from it.
OTTO_APP_HOSTmy.$OTTO_DOMAINThe host name of the Otto web app, where you sign in.
OTTO_PREVIEW_DOMAINpreview.$OTTO_DOMAINThe parent domain of phone previews. Each repo gets a name under it, such as myrepo.preview.example.org.
OTTO_SITE_HOSTS$OTTO_DOMAIN, www.$OTTO_DOMAINThe host names that serve the public website, comma-separated.
OTTO_PUSH_SUBJECTmailto:push@$OTTO_DOMAINThe contact that push notifications identify your server with, as a mailto: or https: address.
OTTO_PASSKEY_USERownerThe display name a new passkey is saved under, as your device's passkey list shows it.

Set an optional key only when your layout differs from the default. For example, OTTO_APP_HOST=otto.example.org moves the app off my.. Give OTTO_SITE_HOSTS a different list, or point OTTO_PUSH_SUBJECT at a mailbox you read.

What each key names

The deploy also derives the preview domain with its dots escaped, for the one pattern Caddy matches against. You do not set it.

No image holds a name. Each service takes its names from its environment when its container is created, and a service started without them stops with a message that names the missing variable.

When the file is missing

A deploy with no file, an unreadable one, or one without OTTO_DOMAIN stops at once and says which. It stops before it builds anything or restarts a service, so the running server is untouched.

Changing it

A change needs a full redeploy. Each service reads its names only when its container is created, so editing the file alone changes nothing. Run yarn deploy:vps all after you edit it.

A change to OTTO_APP_HOST also changes the passkey relying-party ID. A passkey enrolled under the old host no longer signs in, so enroll again with yarn vps:auth enroll.

Your DNS records must match the names. The how-to lists them. server-move.sh carries the file to a new server, so a moved server keeps its names.