Architecture & Stack

Kuberfy was built from the ground up to challenge the convention that a self-hosted PaaS needs multiple server processes, separate databases, and heavy cache brokers.

The Tech Stack

LayerChoiceWhy We Chose It
Backend APIBun + HonoMinimal runtime and framework footprint without Node.js overhead.
DatabaseSQLite (bun:sqlite) + Drizzle ORMEmbedded inside the single process. Zero database servers to manage or backup.
FrontendAstro + React Islands (shadcn/ui)Pure static HTML output by default; React islands only hydrate interactive components.
AuthenticationBetter AuthSecure email/password authentication, admin roles, and session tokens.
Reverse Proxy & SSLTraefik v3Dynamic auto-discovery via Docker labels and automated Let's Encrypt certificates.
OrchestratorDocker Swarm (Single-node)Native zero-downtime rolling updates and service mesh with zero extra daemon weight.
Deploy Enginedockerode + simple-gitInteracts with the Docker socket directly via typed APIs (no insecure shell command generation).

Data Model

The database structure is designed to be clear and extensible:

User (Better Auth) ──▶ Project ──▶ Application ──▶ Deployment
                                            │
                                            └──▶ Domain
  • Projects: Logical groups for related applications (e.g. backend, frontend, worker).
  • Applications: Service configurations including Git repository or Docker image, build strategy, environment variables, and internal port.
  • Deployments: Immutable historical records of every build and rollout with build logs and status indicators.
  • Domains: Custom hostnames mapped to applications via Traefik labels.

Why Docker Swarm (Single Node)?

Kuberfy uses Docker Swarm in single-node mode. Unlike Kubernetes or Nomad which require separate control planes and significant memory, Docker Swarm is built directly into dockerd:

  • Zero-Downtime Rollouts: When deploying a new version, Swarm starts the new container, verifies health, and seamlessly terminates the old one.
  • Zero Additional RAM: Initializing Swarm adds 0 MB of extra daemon footprint.
  • Shared Network Mesh: All applications connect to kuberfy-network, allowing Traefik to route traffic internally without publishing host ports.

Security Architecture

No Shell Injection: Kuberfy never constructs or executes shell commands with user inputs to control Docker. All container operations (pulling images, creating services, inspecting tasks, tailing logs) are executed through typed HTTP calls over the Docker Unix socket via dockerode.