Self-hosting
radiona is single-tenant: one instance per agency. This guide covers a production deployment with Docker Compose.
1. Requirements
- A host with Docker (Compose v2) and ~2 GB RAM.
- BuildKit, i.e. the
docker-buildxplugin. The images use BuildKit cache mounts for the pnpm store and the Next.js build cache; without buildx, Docker falls back to the legacy builder and a rebuild takes many times longer. Check withdocker buildx version— if it is missing, installdocker-buildx(Debian/Ubuntu:apt install docker-buildx). - A domain pointing at the host (optional, but needed for public pages + email links).
- SMTP credentials if you want invitation / password-reset / mention emails.
2. Configure
cp .env.example .env
Core
| Variable | Meaning |
|---|---|
APP_URL |
Where the app is reachable; used in emailed links. |
PUBLIC_BASE_URL |
Base for public page links when no brand domain is set. |
DATABASE_URL |
Postgres connection string. Inside compose: postgres://app:app@postgres:5432/app. |
AUTH_SECRET |
Required. Signs session JWTs. Generate: openssl rand -base64 32. |
AUTH_URL |
Public URL Auth.js should use. |
Real-time
| Variable | Meaning |
|---|---|
COLLAB_PORT |
Port the Hocuspocus server listens on (default 1234). |
NEXT_PUBLIC_COLLAB_URL |
Websocket URL the browser uses, e.g. wss://collab.example.com. |
COLLAB_SECRET |
Required. Signs short-lived collab tokens. Must match across web + collab. |
Storage
| Variable | Meaning |
|---|---|
STORAGE_DRIVER |
local (default) or s3. |
LOCAL_STORAGE_PATH |
Volume path for uploads when local. |
S3_ENDPOINT / S3_REGION / S3_BUCKET / S3_ACCESS_KEY / S3_SECRET_KEY |
S3 or MinIO settings when s3. |
To run MinIO alongside the app, start compose with the bundled profile:
docker compose -f docker/docker-compose.yml --profile storage up -d
Then set STORAGE_DRIVER=s3, S3_ENDPOINT=http://minio:9000,
S3_BUCKET=radiona, and the MinIO root credentials. The owner can also choose
storage in the app under Settings → Storage, which takes priority over these
variables once saved.
Email (SMTP)
| Variable | Meaning |
|---|---|
SMTP_HOST / SMTP_PORT / SMTP_USER / SMTP_PASS / SMTP_FROM |
Your provider's settings. |
If SMTP_HOST is unset, radiona logs emails to the container output instead of
sending — handy for evaluation, not for production. The owner can also set SMTP
in the app under Settings → Email; those values take priority.
Secrets at rest
| Variable | Meaning |
|---|---|
ENCRYPTION_KEY |
32-byte key used to encrypt stored secrets (e.g. SMTP password saved in org settings). |
3. Start
docker compose -f docker/docker-compose.yml up -d
docker compose -f docker/docker-compose.yml logs -f web
The web container runs pending database migrations on start, then serves on
port 3000. collab serves the websocket on COLLAB_PORT.
Open the app and complete first-run owner signup. Signup closes permanently once that first user exists; everyone else joins via invitation.
4. Put it behind TLS
Terminate TLS at a reverse proxy (Caddy, nginx, Traefik) and forward:
https://app.example.com→web:3000wss://collab.example.com→collab:1234
Set APP_URL, AUTH_URL, PUBLIC_BASE_URL and NEXT_PUBLIC_COLLAB_URL
accordingly, then restart. Make sure the proxy forwards X-Forwarded-For — the
rate limiter uses it.
5. White-label public pages
Set a brand domain in org settings. Public page links are then generated as
https://<brand-domain>/p/<slug>. Point that domain at the same web container;
/p/[slug] is served on any host.
Published pages are gated on: published = true, visibility = public, a
future (or absent) expiry, and — when set — a validated password cookie.
6. Backups
Everything durable lives in Postgres plus the uploads volume.
# Database
docker compose -f docker/docker-compose.yml exec postgres \
pg_dump -U app app > radiona-$(date +%F).sql
# Uploads (local driver)
docker run --rm -v docker_uploads:/data -v "$PWD":/backup alpine \
tar czf /backup/uploads-$(date +%F).tar.gz /data
Restore with psql -U app app < dump.sql.
7. Upgrades
git pull
docker compose -f docker/docker-compose.yml build
docker compose -f docker/docker-compose.yml up -d
Migrations run automatically on container start. Back up first.
8. Hardening notes
- Rate limiting is applied to login, password reset, public-page unlock, and collab-token minting. It is in-memory, which is correct for a single instance; put a shared store (Redis) behind it if you scale horizontally.
- Authorization is enforced server-side on every read and mutation via
canAccess, and re-checked independently by the collab server. - Rotate
AUTH_SECRETto invalidate all sessions; rotateCOLLAB_SECRETto invalidate outstanding collab tokens. - Keep the instance behind TLS: session cookies and collab tokens are bearer credentials.
Troubleshooting
| Symptom | Check |
|---|---|
DATABASE_URL is not set |
.env is missing or not passed to the container. |
| Editor won't connect | NEXT_PUBLIC_COLLAB_URL must be reachable from the browser, and COLLAB_SECRET must match between web and collab. |
| Emails not arriving | With no SMTP_HOST, mail is logged, not sent: docker compose logs web. |
| Public link 404s | Page must be published, visibility = public, and unexpired. |