Self-Hosting Runbook
brūhi Cloud is distributed as a consolidated container supervised by supervisord, containing the FastAPI web backend, SvelteKit frontend, and the native bruhi-audio broadcast playout engine. In production, it pairs with an automated Caddy reverse proxy for automated SSL/TLS certificate provisioning and HTTP/3 support.
Prerequisites
Section titled “Prerequisites”Before starting deployment, ensure your server meets the following requirements:
Server Hardware
Section titled “Server Hardware”- CPU: 2 cores minimum (4+ cores recommended for multi-station setups).
- RAM: 2 GB minimum (4 GB+ recommended; includes 256 MB RAM reserved for the in-memory
tmpfsHLS cache). - Disk: 15 GB+ SSD storage (sized according to your station audio library and recordings).
- Architecture:
linux/amd64(x86_64) orlinux/arm64(aarch64 / Graviton / Apple Silicon).
Software Requirements
Section titled “Software Requirements”- Operating System: Linux (Ubuntu 22.04+, Debian 12+, Fedora 38+, or Amazon Linux 2023).
- Docker Engine: Version 24.0 or newer.
- Docker Compose: Version v2.20 or newer (Compose V2 plugin via
docker compose).
Required Network Ports & DNS
Section titled “Required Network Ports & DNS”Configure your domain’s DNS A (or AAAA) record to point to your server’s public IP address (e.g., radio.yourdomain.com). Open the following ports in your firewall:
| Port | Protocol | Service | Purpose |
|---|---|---|---|
80 | TCP | HTTP | ACME Let’s Encrypt certificate challenge and HTTPS redirect |
443 | TCP & UDP | HTTPS & HTTP/3 (QUIC) | Secure web dashboard, studio WebSockets, HLS audio streams |
8000 | TCP | Internal HTTP API | Direct container port (leave closed to public; accessible locally) |
Deployment Option A: Automated Installer (Recommended)
Section titled “Deployment Option A: Automated Installer (Recommended)”The quickest way to bootstrap brūhi Cloud on a fresh server is the official interactive installer:
bash <(curl -fsSL https://raw.githubusercontent.com/bruhi-technologies/bruhi-deploy/main/install.sh)The setup script:
- Validates that Docker and Docker Compose V2 are installed.
- Prompts for your public broadcast domain (e.g.
radio.yourdomain.com). - Downloads the official
docker-compose.yml,Caddyfile, and generates.env. - Pulls the latest container images and launches the stack.
Deployment Option B: Manual Docker Compose
Section titled “Deployment Option B: Manual Docker Compose”-
Create the Deployment Directory
Terminal window mkdir -p ~/bruhi-cloud && cd ~/bruhi-cloud -
Download Deployment Configuration
Terminal window curl -fsSL https://raw.githubusercontent.com/bruhi-technologies/bruhi-deploy/main/docker-compose.yml -o docker-compose.ymlcurl -fsSL https://raw.githubusercontent.com/bruhi-technologies/bruhi-deploy/main/Caddyfile -o Caddyfilecurl -fsSL https://raw.githubusercontent.com/bruhi-technologies/bruhi-deploy/main/.env.example -o .envYour directory layout should be:
Directory~/bruhi-cloud/
- .env
- Caddyfile
- docker-compose.yml
-
Configure Environment Variables (
.env)Edit
.envusing your text editor:# ── Public Domain & URLs ──────────────────────────────────# Used by Caddy for automated Let's Encrypt certificatesDOMAIN=radio.yourdomain.com# Public application URL for invitations and linksBRUHI_URL=https://radio.yourdomain.com# WebAuthn (Passkeys) — Must match your public hostnameBRUHI_RP_ID=radio.yourdomain.comBRUHI_RP_NAME=brūhi Cloud# ── Environment & Security ────────────────────────────────BRUHI_ENV=productionSESSION_COOKIE_SECURE=trueLOG_LEVEL=infoPORT=8000# Optional: Pre-seed owner credentials on first boot# BRUHI_ADMIN_EMAIL=owner@station.internal# BRUHI_ADMIN_PASSWORD=change_this_secure_password -
Start the Stack
Terminal window docker compose up -d -
Verify System Health
Test that the container and internal health check respond cleanly:
Terminal window docker compose pscurl -f http://localhost:8000/healthz# Expected response: {"status":"ok"}
First-Run Owner Bootstrap
Section titled “First-Run Owner Bootstrap”Once the containers are running and your domain resolves, complete the initial setup:
- Navigate to
https://radio.yourdomain.comin your web browser. - The First-Run Setup Wizard (
/setup) will automatically activate if no database exists. - Enter the Primary Owner Account details (email and master password). The very first user created is automatically assigned the immutable
ownerrole. - Enter your brūhi Licence Key (or select Community mode).
- The system initializes default Station 1 and redirects you to the live studio console.
Reverse Proxy & TLS Behaviour
Section titled “Reverse Proxy & TLS Behaviour”brūhi Cloud uses Caddy 2.8+ as its frontend ingress proxy:
- Automatic Let’s Encrypt Certificates: Caddy contacts Let’s Encrypt or ZeroSSL automatically on port 80/443 and manages renewal.
- HTTP/3 (QUIC) Acceleration: Port
443/udpenables HTTP/3 for low-latency live audio streaming. - In-Memory HLS Delivery: Caddy mounts the
hls_datatmpfs volume directly (/hls:ro), delivering.m3u8playlists and audio chunks with zero Python overhead. - Custom Reverse Proxies (NGINX / Cloudflare): If running behind Cloudflare or an external NGINX gateway, ensure WebSocket upgrading (
Upgrade $http_upgrade,Connection "upgrade") is enabled and that SSL mode is set to “Full (Strict)”.
Updating & Rollback Procedures
Section titled “Updating & Rollback Procedures”Updating to the Latest Release
Section titled “Updating to the Latest Release”Because ~/bruhi-cloud is a standalone configuration folder, updates do not use git pull. Follow this procedure:
-
Back Up Current Database
Terminal window docker compose exec bruhi-cloud sqlite3 /app/data/bruhi.db ".backup '/app/data/pre-update-backup.db'"docker compose cp bruhi-cloud:/app/data/pre-update-backup.db ./pre-update-backup.db -
Pull the Latest Images
Terminal window docker compose pull -
Recreate Containers with Auto-Migration
Terminal window docker compose up -dSQLite schema migrations apply automatically during container startup.
-
Verify Post-Update Health
Terminal window docker compose pscurl -f http://localhost:8000/healthzdocker compose logs --tail=50 bruhi-cloud
Rollback Procedure
Section titled “Rollback Procedure”If a release needs to be rolled back:
- Stop the current stack:
Terminal window docker compose down - Pin the desired previous image in
.envordocker-compose.yml:image: ghcr.io/bruhi-technologies/bruhi-cloud:v0.22.0 - Restore the pre-update database backup if needed:
Terminal window docker compose run --rm -v bruhi-cloud_bruhi_db:/data alpine cp /data/pre-update-backup.db /data/bruhi.db - Restart the stack:
Terminal window docker compose up -d
Backup & Recovery
Section titled “Backup & Recovery”brūhi Cloud stores all station settings, accounts, rotation rules, and schedules in a single SQLite database running in WAL mode at /app/data/bruhi.db.
Hot Database Backup
Section titled “Hot Database Backup”Perform a non-blocking hot backup using SQLite’s online vacuum:
docker compose exec bruhi-cloud sqlite3 /app/data/bruhi.db ".backup '/app/data/backup-$(date +%F).db'"docker compose cp bruhi-cloud:/app/data/backup-$(date +%F).db ~/backups/Full Data Volume Backup
Section titled “Full Data Volume Backup”To back up uploaded audio tracks and the SQLite database together:
docker run --rm \ -v bruhi-cloud_bruhi_db:/db:ro \ -v bruhi-cloud_bruhi_audio:/audio:ro \ -v ~/backups:/backup \ alpine tar -czf /backup/bruhi-full-backup-$(date +%F).tar.gz -C / db audioMaintained Configuration Reference
Section titled “Maintained Configuration Reference”Key variables read from .env by docker-compose.yml and the server:
| Variable | Default | Description |
|---|---|---|
DOMAIN | localhost | Public domain name. Caddy uses this for Let’s Encrypt certificates. |
BRUHI_URL | https://${DOMAIN} | Base URL used for email reset links and passkey authentication. |
BRUHI_RP_ID | ${DOMAIN} | WebAuthn Relying Party ID. Must match your public hostname. |
BRUHI_RP_NAME | brūhi Cloud | Relying party display name shown on biometric prompts. |
PORT | 8000 | Local port binding for the FastAPI service container. |
BRUHI_ENV | development | Set to production in live environments for cookie and CORS security. |
LOG_LEVEL | info | Log verbosity (debug, info, warning, error). |
CORS_ORIGINS | "" | Space-separated list of allowed CORS origins. |
BRUHI_DB | /app/data/bruhi.db | Consolidated SQLite database path inside container. |
AUDIO_DIR | /app/audio_files | Directory where uploaded tracks and recordings reside. |
HLS_DIR | /hls | Mounted to the tmpfs volume for low-latency live segments. |
BRUHI_AUDIO_API | http://localhost:7700 | Control-plane address for the internal bruhi-audio engine. |