Server Deployment¶
This guide covers deploying Loryth on a Linux host with Docker Compose, isolated PostgreSQL databases, TLS ingress, and optional chat sandboxes.
Compose Layering¶
Always pass Compose files explicitly on a server so the local development override (docker-compose.override.yml) is never applied:
docker compose \
-f docker-compose.yml \
-f docker-compose.server.yml \
-f docker-compose.ingress.yml \
--profile website --profile docs \
up -d --build
docker-compose.yml: Base infrastructure, 16 services, migrations job, web UI, and Nginx gateway.docker-compose.server.yml: Binds the gateway to loopback (127.0.0.1:8088by default) and removes development port exposures.docker-compose.ingress.yml: Connects the gateway to an external TLS reverse proxy network (lab-ingress) servingLORYTH_DOMAIN,app.<LORYTH_DOMAIN>, anddocs.<LORYTH_DOMAIN>.
Environment Configuration¶
Copy .env.server.example to .env, set distinct secrets, and restrict file permissions:
LORYTH_DOMAIN: Base domain (maps root to website,app.to workspace/API,docs.to documentation).LORYTH_SETTINGS_KEY: Encryption key required before saving AI provider keys in Settings.LORYTH_ANDROID_DOWNLOADS_PATH: Persistent host directory mounted read-only into the website container for/downloads/APK, RPM, checksum, and update feed JSON files.
Migrations & Upgrades¶
Each service has its own PostgreSQL database, role, and revision_log. Before upgrading:
- Back up PostgreSQL (
pg_dumpall | gzip > postgres.sql.gz) and verify the archive withgzip -t. - Build updated images (and
docker compose --profile sandbox build sandbox-imageif using on-demand chat sandboxes). - Stop the gateway to pause writes, run
docker compose ... run --rm migrations, then bring the stack back up withup -d.
Security & Privacy Defaults¶
- IAM Bearer Validation: All backend APIs validate bearer tokens against
loryth-iam; new signups start pending until approved by an admin. - Private Journals: Journal entries, recordings, and reflections are restricted strictly to their creator with no admin bypass.
- Optional gVisor Sandboxes: Install
runscon the Docker host and setRUNTIME_SANDBOX_RUNTIME=runscto isolate per-user chat sandboxes.
For operational deployment scripts and pilot diagnostics, see docker/server-deployment.md in the repository and Admin Access.