Docker Compose Setup

The `selfhosting/` directory contains Kuayle’s reference deployment. It runs five services behind Caddy and supports automatic TLS when DNS and network access are configured correctly.

Architecture overview

The Compose file defines Caddy, PostgreSQL 17, Redis 7, the Go API and the SvelteKit frontend. Caddy terminates HTTPS and sends application and API requests to the appropriate container.

  • Caddy — reverse proxy with automatic Let's Encrypt TLS
  • PostgreSQL 17 — primary data store
  • Redis 7 — required configuration value, reserved for future cache and job use
  • Backend — Go API server on port 8080
  • Frontend — SvelteKit static app served behind Caddy

Quick start

Clone the repository, copy the example environment file and replace the placeholder credentials before starting the stack. The launch command builds the local backend and frontend images.

  • git clone https://github.com/carbogninalberto/kuayle.git
  • cd kuayle/selfhosting
  • cp .env.example .env
  • # Edit .env: set DOMAIN, POSTGRES_PASSWORD, JWT_SECRET
  • docker compose up --build -d

Initialize the database

After the containers start, apply the database migrations and run the seed command from the `selfhosting` directory.

  • docker compose exec backend /app/server migrate up
  • docker compose exec backend /app/server seed

Volumes and data persistence

Named volumes persist PostgreSQL data, local uploads and Caddy state across container recreation. Persistence is not a backup: copy and test restores for each volume before relying on the deployment.

  • pgdata — PostgreSQL data directory
  • uploads — user-uploaded files and assets
  • caddy_data / caddy_config — TLS certificates and Caddy state

Review Kuayle before you deploy it

Inspect the Apache 2.0 source, then follow the Docker Compose guide to run an instance on your infrastructure.