Skip to content

Installation

KoAkademy runs as a self-managed Linux service with flexible deployment targets.

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.

  • 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.

The fastest and officially supported production path is the automated one-line installer from the latest verified GitHub Release:

Terminal window
curl -fsSL https://github.com/yukazakiri/koakademy/releases/latest/download/install.sh | bash

For non-interactive automation (e.g. cloud-init or CI), pass the target domain directly:

Terminal window
curl -fsSL https://github.com/yukazakiri/koakademy/releases/latest/download/install.sh \
| env KOAKADEMY_DOMAIN=school.example.com bash

The installer bootstrap executes with zero unnecessary assumptions and performs:

  1. Host Verification: Validates a supported Linux host (amd64 / arm64). Installs Docker Engine automatically via Docker’s official script if missing.
  2. Docker Swarm Setup: Initializes or preserves an active single-node Docker Swarm manager.
  3. Secret Generation: Securely generates cryptographic Docker Secrets for APP_KEY, PostgreSQL credentials, and Redis passwords.
  4. Private Overlay Network: Creates an isolated koakademy_private Swarm overlay network.
  5. Caddy Edge Proxy: Starts Caddy on ports 80 and 443 with automatic TLS/HTTPS certificates.
  6. Isolated Services: Spawns FrankenPHP (Laravel Octane on port 8000), PostgreSQL 18, Redis 8, and Gotenberg 8 (PDF rendering) on the private overlay network.
  7. Database Migrations: Automatically runs database migrations before routing live traffic.
  8. CLI Installation: Installs the koakademy management CLI to /usr/local/bin/koakademy (or /opt/koakademy/koakademy).
  9. User Permissions: Configures the invoking user into the docker group 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.


The installer provisions the koakademy CLI binary for day-two operations, updates, backups, rollbacks, and service configuration.

Terminal window
koakademy <command> [subcommand] [flags]

Inspect running containers, image versions, replica counts, and Swarm health:

Terminal window
koakademy status

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:

Terminal window
# Update to latest stable release
koakademy update
# Explicitly pin a specific release version
koakademy update --release v1.2.0
# Switch/Update to the edge channel (master branch)
koakademy update --edge

If a newly deployed image experiences issues, rollback to the previous container image:

Terminal window
koakademy rollback

4. 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:

Terminal window
# Cloudflare R2
koakademy configure storage r2
# Amazon S3 or S3-compatible storage (MinIO, Wasabi, DigitalOcean Spaces)
koakademy configure storage s3
# Digital Library private bucket
koakademy configure storage library-r2
# Revert to local container volume storage
koakademy configure storage local

5. Configure Transactional Email (SMTP / Sequenzy)

Section titled “5. Configure Transactional Email (SMTP / Sequenzy)”

Set up outbound transactional notifications, email verification, and password resets:

Terminal window
# Configure SMTP
koakademy configure mail smtp
# Configure Sequenzy transactional provider
koakademy configure mail sequenzy
# Set mailer to local logs (development/testing)
koakademy configure mail log

Enable or disable Laravel Scout full-text search indexing:

Terminal window
# Enable and connect external Meilisearch instance
koakademy configure search enable
# Disable Scout search (fallback to database search)
koakademy configure search disable

Running remote privileged code is a trust decision. Download the matching stable release asset to inspect it:

Terminal window
curl -fSLO https://github.com/yukazakiri/koakademy/releases/latest/download/install.sh
less install.sh
env KOAKADEMY_DOMAIN=school.example bash install.sh

Each 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.

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.

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):

Terminal window
mkdir -p /opt/koakademy
cd /opt/koakademy
curl -fsSLO https://github.com/yukazakiri/koakademy/releases/latest/download/compose.production.yaml
curl -fsSL https://github.com/yukazakiri/koakademy/releases/latest/download/default.env.production.example -o .env
chmod 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 --quiet
docker compose --env-file .env -f compose.production.yaml up -d postgres redis gotenberg
docker compose --env-file .env -f compose.production.yaml run --rm app php artisan migrate --force --no-interaction
docker compose --env-file .env -f compose.production.yaml up -d app scheduler

Configure 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.

  • 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

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:

Terminal window
# Ubuntu 24.04 LTS: register Ondřej Surý PHP PPA and NodeSource 22.x
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
curl -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 binary
curl -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/frankenphp
Terminal window
sudo mkdir -p /var/www/koakademy
sudo chown -R $USER:$USER /var/www/koakademy
git clone https://github.com/yukazakiri/koakademy.git /var/www/koakademy
cd /var/www/koakademy
# Install production dependencies & build frontend assets
composer install --no-dev --optimize-autoloader
npm ci
npm run build
Terminal window
cp .env.production.example .env
chmod 600 .env
php artisan key:generate

Configure your database and Redis credentials in .env:

APP_ENV=production
APP_DEBUG=false
APP_URL=https://school.example.com
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=koakademy
DB_USERNAME=koakademy
DB_PASSWORD=YourSecurePassword
CACHE_STORE=redis
QUEUE_CONNECTION=redis
REDIS_HOST=127.0.0.1
OCTANE_SERVER=frankenphp
OCTANE_WORKERS=2

Run database migrations:

Terminal window
php artisan migrate --force
php artisan storage:link
php artisan optimize

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:

Terminal window
sudo install -m 0644 deploy/systemd/koakademy-web.service /etc/systemd/system/koakademy-web.service
sudo install -m 0644 deploy/systemd/koakademy-worker.service /etc/systemd/system/koakademy-worker.service
sudo install -m 0644 deploy/systemd/koakademy-ssr.service /etc/systemd/system/koakademy-ssr.service
sudo install -m 0644 deploy/systemd/koakademy-scheduler.service /etc/systemd/system/koakademy-scheduler.service
sudo install -m 0644 deploy/systemd/koakademy-scheduler.timer /etc/systemd/system/koakademy-scheduler.timer

The 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:

Terminal window
sudo chown -R www-data:www-data /var/www/koakademy/storage /var/www/koakademy/bootstrap/cache
sudo systemctl daemon-reload
sudo systemctl enable --now koakademy-web.service koakademy-worker.service koakademy-ssr.service koakademy-scheduler.timer

Point your reverse proxy (Caddy or Nginx) to 127.0.0.1:8000.