Installation
KoAkademy runs as a self-managed Linux service with flexible deployment targets.
Deployment Options Matrix
Section titled “Deployment Options Matrix”Choose the self-hosting method that best aligns with your infrastructure:
| Platform / Method | Support Tier | Recommended Use Case | Reverse Proxy / SSL | Multi-Node / HA | Guide |
|---|---|---|---|---|---|
| Linux VPS (1-Line Installer) | Tier 1 (Official, CI-Tested) | Dedicated VPS / Bare Metal | Built-in Caddy (Auto HTTPS) | Single-node Swarm | Quickstart |
| Docker Compose | Tier 1 (Official, CI-Tested) | Custom proxy / existing Docker host | Caddy / Nginx / Traefik | Single host | Compose Guide |
| Dokploy | Tier 2 (Manifest-Validated Reference) | Self-hosted PaaS / Zero-Downtime UI | Traefik (Automated) | Project-based | Dokploy Guide |
| Coolify | Tier 2 (Manifest-Validated Reference) | Self-hosted PaaS / Multi-server UI | Traefik (Automated) | Multi-server | Coolify Guide |
| Docker Swarm (Manual) | Tier 2 (Manifest-Validated Reference) | Lightweight container clustering | Caddy / Swarm Ingress | Native Multi-node | Swarm Guide |
| Kubernetes (K8s / K3s) | Tier 2 (Manifest-Validated Reference) | Enterprise / Cloud orchestration | Ingress / cert-manager | Native Multi-node | K8s Guide |
| Red Hat OpenShift | Tier 2 (Manifest-Validated Reference) | Enterprise OCP / OKD / ROSA | OpenShift Route (TLS) | Native Multi-node | OpenShift Guide |
| Standalone VPS (No Docker) | Tier 2 (Reference Runbook) | Native systemd / PHP 8.5 host | External Caddy / Nginx | Single host | Bare VPS Runbook |
KoAkademy is beta software. Use staging first, review release notes, and keep a tested recovery path for institutional data.
Prerequisites
Section titled “Prerequisites”- A Linux VPS with root access
- A public domain with its DNS pointing to the VPS
- Free ports 80 and 443 for Caddy
- At least 4 GB RAM for a small evaluation
- Outbound access to GitHub, GHCR, Docker Hub, and any external providers
Docker does not need to be preinstalled. The installer uses Docker’s official installer when the engine is absent. It supports Docker’s Linux distributions and AMD64 or ARM64 hosts.
Quickstart (One-line Installer)
Section titled “Quickstart (One-line Installer)”The fastest and officially supported production path is the automated one-line installer from the latest verified GitHub Release:
curl -fsSL https://github.com/yukazakiri/koakademy/releases/latest/download/install.sh | bashFor non-interactive automation (e.g. cloud-init or CI), pass the target domain directly:
curl -fsSL https://github.com/yukazakiri/koakademy/releases/latest/download/install.sh \ | env KOAKADEMY_DOMAIN=school.example.com bashWhat install.sh Does Under the Hood
Section titled “What install.sh Does Under the Hood”The installer bootstrap executes with zero unnecessary assumptions and performs:
- Host Verification: Validates a supported Linux host (
amd64/arm64). Installs Docker Engine automatically via Docker’s official script if missing. - Docker Swarm Setup: Initializes or preserves an active single-node Docker Swarm manager.
- Secret Generation: Securely generates cryptographic Docker Secrets for
APP_KEY, PostgreSQL credentials, and Redis passwords. - Private Overlay Network: Creates an isolated
koakademy_privateSwarm overlay network. - Caddy Edge Proxy: Starts Caddy on ports 80 and 443 with automatic TLS/HTTPS certificates.
- Isolated Services: Spawns FrankenPHP (Laravel Octane on port 8000), PostgreSQL 18, Redis 8, and Gotenberg 8 (PDF rendering) on the private overlay network.
- Database Migrations: Automatically runs database migrations before routing live traffic.
- CLI Installation: Installs the
koakademymanagement CLI to/usr/local/bin/koakademy(or/opt/koakademy/koakademy). - User Permissions: Configures the invoking user into the
dockergroup for rootless Docker commands.
Once complete, open https://school.example.com/setup to finish the web setup wizard and register your school’s initial super administrator.
Operating KoAkademy via CLI
Section titled “Operating KoAkademy via CLI”The installer provisions the koakademy CLI binary for day-two operations, updates, backups, rollbacks, and service configuration.
CLI Syntax & Command Overview
Section titled “CLI Syntax & Command Overview”koakademy <command> [subcommand] [flags]Core CLI Commands
Section titled “Core CLI Commands”1. Check System Status & Health
Section titled “1. Check System Status & Health”Inspect running containers, image versions, replica counts, and Swarm health:
koakademy status2. Upgrades & Release Updates
Section titled “2. Upgrades & Release Updates”Update to the latest stable release. This command automatically takes a PostgreSQL snapshot under /opt/koakademy/backups/, updates the immutable image digest, runs database migrations, and performs a zero-downtime rolling restart:
# Update to latest stable releasekoakademy update
# Explicitly pin a specific release versionkoakademy update --release v1.2.0
# Switch/Update to the edge channel (master branch)koakademy update --edge3. Image Rollback
Section titled “3. Image Rollback”If a newly deployed image experiences issues, rollback to the previous container image:
koakademy rollback4. Configure Object Storage (S3 / Cloudflare R2)
Section titled “4. Configure Object Storage (S3 / Cloudflare R2)”Configure durable object storage for uploads, institutional branding, and student documents:
# Cloudflare R2koakademy configure storage r2
# Amazon S3 or S3-compatible storage (MinIO, Wasabi, DigitalOcean Spaces)koakademy configure storage s3
# Digital Library private bucketkoakademy configure storage library-r2
# Revert to local container volume storagekoakademy configure storage local5. Configure Transactional Email (SMTP / Sequenzy)
Section titled “5. Configure Transactional Email (SMTP / Sequenzy)”Set up outbound transactional notifications, email verification, and password resets:
# Configure SMTPkoakademy configure mail smtp
# Configure Sequenzy transactional providerkoakademy configure mail sequenzy
# Set mailer to local logs (development/testing)koakademy configure mail log6. Configure Search Engine (Meilisearch)
Section titled “6. Configure Search Engine (Meilisearch)”Enable or disable Laravel Scout full-text search indexing:
# Enable and connect external Meilisearch instancekoakademy configure search enable
# Disable Scout search (fallback to database search)koakademy configure search disableInspect before running
Section titled “Inspect before running”Running remote privileged code is a trust decision. Download the matching stable release asset to inspect it:
curl -fSLO https://github.com/yukazakiri/koakademy/releases/latest/download/install.shless install.shenv KOAKADEMY_DOMAIN=school.example bash install.shEach stable release contains the bootstrap, operator command, Swarm bundle,
runtime configuration, image metadata, and SHA256SUMS. The installer verifies
the release assets before changing the host.
Existing Swarm installation
Section titled “Existing Swarm installation”The new installer deliberately refuses a host that still has legacy koakademy-* services. It makes no changes and points to the legacy Swarm migration guide. Back up PostgreSQL and storage, migrate during a maintenance window, and do not run the two topologies against the same data volumes.
Manual Docker Compose installation
Section titled “Manual Docker Compose installation”Compose remains supported for operators who manage their own reverse proxy and environment file. Download the published Compose manifest and production .env template directly from the latest GitHub Release (no full source clone required):
mkdir -p /opt/koakademycd /opt/koakademycurl -fsSLO https://github.com/yukazakiri/koakademy/releases/latest/download/compose.production.yamlcurl -fsSL https://github.com/yukazakiri/koakademy/releases/latest/download/default.env.production.example -o .envchmod 600 .env# Edit .env to set APP_URL, DB_PASSWORD, and REDIS_PASSWORD, then generate APP_KEY:docker compose --env-file .env -f compose.production.yaml config --quietdocker compose --env-file .env -f compose.production.yaml up -d postgres redis gotenbergdocker compose --env-file .env -f compose.production.yaml run --rm app php artisan migrate --force --no-interactiondocker compose --env-file .env -f compose.production.yaml up -d app schedulerConfigure HTTPS in front of the Compose loopback port and complete /setup. Review Configuration and Deployment before accepting traffic.
Standalone VPS Deployment (Without Docker)
Section titled “Standalone VPS Deployment (Without Docker)”For operators running on dedicated bare metal, standard Linux VPS, or hardened operating environments that do not run container runtimes, KoAkademy can run directly on the host using PHP 8.5, FrankenPHP, and systemd.
System Prerequisites
Section titled “System Prerequisites”- OS: Ubuntu 24.04 LTS / Debian 12
- PHP: PHP 8.5.12+ CLI with extensions:
bcmath,curl,exif,ffi,gd,intl,mbstring,pcntl,pdo_pgsql,redis,sockets,xml,zip - Node.js: Node.js 22.23.4+ & npm
- Database: PostgreSQL 16+ or 18
- Cache/Queue: Redis 7+ or 8
- PDF Engine: Gotenberg 8 (or external Cloudflare Browser Rendering service)
- Web Server: FrankenPHP standalone binary or Caddy/Nginx
1. Install System Dependencies
Section titled “1. Install System Dependencies”Stock Ubuntu 24.04 and Debian 12 repositories do not bundle PHP 8.5.12+ or Node.js 22.23.4+. Register the upstream PHP (ppa:ondrej/php on Ubuntu or packages.sury.org/php on Debian) and NodeSource repositories first:
# Ubuntu 24.04 LTS: register Ondřej Surý PHP PPA and NodeSource 22.xsudo apt-get updatesudo apt-get install -y ca-certificates curl gnupg software-properties-commonsudo add-apt-repository -y ppa:ondrej/phpcurl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y php8.5-cli php8.5-curl php8.5-gd php8.5-mbstring \ php8.5-pgsql php8.5-redis php8.5-xml php8.5-bcmath php8.5-intl php8.5-zip \ php8.5-ffi librsvg2-bin mdbtools composer nodejs postgresql redis-server \ git rsync unzip
# Install FrankenPHP binarycurl -fsSL https://github.com/php/frankenphp/releases/latest/download/frankenphp-linux-x86_64-gnu \ -o /tmp/frankenphp && sudo install -m 0755 /tmp/frankenphp /usr/local/bin/frankenphp2. Clone & Build Application
Section titled “2. Clone & Build Application”sudo mkdir -p /var/www/koakademysudo chown -R $USER:$USER /var/www/koakademygit clone https://github.com/yukazakiri/koakademy.git /var/www/koakademycd /var/www/koakademy
# Install production dependencies & build frontend assetscomposer install --no-dev --optimize-autoloadernpm cinpm run build3. Environment & Database Configuration
Section titled “3. Environment & Database Configuration”cp .env.production.example .envchmod 600 .envphp artisan key:generateConfigure your database and Redis credentials in .env:
APP_ENV=productionAPP_DEBUG=falseAPP_URL=https://school.example.comDB_CONNECTION=pgsqlDB_HOST=127.0.0.1DB_PORT=5432DB_DATABASE=koakademyDB_USERNAME=koakademyDB_PASSWORD=YourSecurePasswordCACHE_STORE=redisQUEUE_CONNECTION=redisREDIS_HOST=127.0.0.1OCTANE_SERVER=frankenphpOCTANE_WORKERS=2Run database migrations:
php artisan migrate --forcephp artisan storage:linkphp artisan optimize4. Install Systemd Services
Section titled “4. Install Systemd Services”The repository includes production-oriented unit files in deploy/systemd/ for the FrankenPHP Octane web server, Horizon queue worker, Inertia SSR server, and per-minute scheduler timer. Install them after building the application:
sudo install -m 0644 deploy/systemd/koakademy-web.service /etc/systemd/system/koakademy-web.servicesudo install -m 0644 deploy/systemd/koakademy-worker.service /etc/systemd/system/koakademy-worker.servicesudo install -m 0644 deploy/systemd/koakademy-ssr.service /etc/systemd/system/koakademy-ssr.servicesudo install -m 0644 deploy/systemd/koakademy-scheduler.service /etc/systemd/system/koakademy-scheduler.servicesudo install -m 0644 deploy/systemd/koakademy-scheduler.timer /etc/systemd/system/koakademy-scheduler.timerThe units expect the application at /var/www/koakademy, load /var/www/koakademy/.env, run as www-data, and protect the rest of the filesystem. The web unit starts Laravel Octane, which renders the FrankenPHP Caddy configuration and applies OCTANE_WORKERS and OCTANE_MAX_REQUESTS from .env. If you use another installation path, update WorkingDirectory, EnvironmentFile, ExecStart, and ReadWritePaths in the units before installing them.
Enable and start services:
sudo chown -R www-data:www-data /var/www/koakademy/storage /var/www/koakademy/bootstrap/cachesudo systemctl daemon-reloadsudo systemctl enable --now koakademy-web.service koakademy-worker.service koakademy-ssr.service koakademy-scheduler.timerPoint your reverse proxy (Caddy or Nginx) to 127.0.0.1:8000.
