Operations & Deployment
Self-Host & Raina CLI Guide
How to install, manage, update, and back up a production Raina instance with single-command simplicity.
1. Quick Bootstrap Installation
Run the following command on any Linux (Ubuntu, Debian, Rocky, Alpine) or macOS host with Docker installed:
curl -fsSL https://raw.githubusercontent.com/mengsokool/raina/main/deploy/install.sh | bashThis script detects CPU architecture, checks Docker availability, installs the /usr/local/bin/raina CLI, generates cryptographically secure secrets, and starts all services in /opt/raina.
2. Directory Structure (/opt/raina)
/opt/raina/
├── compose.yaml # Pinned Docker Compose stack
├── .env # Generated secrets (POSTGRES_PASSWORD, JWT, keys)
├── config/ # Custom certificates and proxy configs
├── state/ # Installation metadata and update state machine
├── data/ # Host volume mounts
├── backups/ # Automated database snapshot archives (.tar.gz)
└── updates/ # Cached release manifests and migration scripts3. Raina CLI Reference
| Command | Description |
|---|---|
| raina status | View current release version, channel, container health, and API readiness. |
| raina logs [-f] [service] | Stream or inspect container logs (e.g. raina logs -f api). |
| raina backup [note] | Take an atomic snapshot of PostgreSQL database and configuration into a .tar.gz archive. |
| raina restore <file> | Restore database and configuration from a specified backup archive. |
| raina update [--version v] | Atomic update with automatic pre-backup and instant rollback if health check fails. |
| raina rollback | Revert stack back to the previous release. |
| raina doctor | Run diagnostic checks on disk, ports, file permissions, and daemon connectivity. |