Nodus
Self-hosting

Configuration

Relay and deployment environment variables.

The Relay is configured purely from environment variables — there is no config file. In the Compose unit these are supplied from deploy/.env.

Relay environment

VariableDefaultPurpose
PORT8080HTTP listen port
DB_PATH<temp>/nodus-relay/relay.dbSQLite database file
REDIS_URLredis://localhost:6379/0Redis connection
SESSION_COOKIE_NAMEnodus_sessionSession cookie name
SESSION_MAX_AGE_DAYS30Session lifetime
SESSION_TOUCH_INTERVAL_MINUTES30How often session expiry is extended
SESSION_COOKIE_SECUREtrueSet false only for plain-HTTP dev
SESSION_COOKIE_DOMAIN(empty)Parent domain for split-origin cookies (e.g. .nodus.example.com)
ALLOWED_ORIGINShttp://localhost:3000,http://127.0.0.1:3000Origins allowed to open the Relay WebSocket
BUFFER_DIR<temp>/nodus-relay/bufferTransient encrypted shard buffer
BUFFER_TTL_HOURS72How long buffered shards live
MAX_SHARD_BYTES_MB32Largest plaintext shard buffered
TRUST_PROXYfalseTrust X-Forwarded-For (enable behind a proxy)
EXPO_PUSH_ACCESS_TOKEN(empty)Expo push; empty disables auth
VAPID_PUBLIC_KEY(empty)Web Push; both keys required to enable
VAPID_PRIVATE_KEY(empty)Web Push private key
VAPID_SUBJECTmailto:admin@example.comVAPID contact

Deployment environment (deploy/.env)

VariablePurpose
WEB_HOSTWeb app hostname; Caddy gets TLS automatically
RELAY_HOSTRelay hostname used by the browser WebSocket, mobile, and Storage Nodes
DOCS_HOSTDocumentation hostname
PUBLIC_RELAY_URLRelay origin shown to users/nodes for pairing
NEXT_PUBLIC_RELAY_URLBrowser WebSocket target; inlined into the web bundle at build time
ALLOWED_ORIGINSMust exactly match the browser origin
SESSION_COOKIE_SECUREtrue for HTTPS, false for local HTTP
SESSION_COOKIE_DOMAINParent domain shared by the web and Relay hosts, e.g. .nodus.example.com
REDIS_PASSWORDRedis password (required, URL-safe)
BUFFER_TTL_HOURSPassed to the Relay
MAX_SHARD_BYTES_MBPassed to the Relay (must cover client shard size)
EXPO_PUSH_ACCESS_TOKENOptional mobile push
VAPID_PUBLIC_KEY / VAPID_PRIVATE_KEY / VAPID_SUBJECTWeb Push
NEXT_PUBLIC_VAPID_PUBLIC_KEYBuild arg for the web image; must match VAPID_PUBLIC_KEY

TRUST_PROXY is intentionally absent from .env.example; Compose pins it to "true" because Caddy always fronts the Relay.

Client and node configuration

Web, mobile, and Storage Node variables are listed in Reference → Configuration.

On this page