appwrite

by Anything-Code

Helm chartv1.3.2App 1.9.0Verified publisher

Appwrite Helm chart

About this chart

Appwrite Helm Chart

A Helm chart for deploying Appwrite on Kubernetes. Supports MariaDB or MongoDB as the database backend, Redis for caching/queues, and the OpenRuntimes executor for Cloud Functions and Sites.


Table of Contents

  1. Prerequisites
  2. Architecture
  3. Quick Start
  4. Database Choice
  5. Storage Architecture
  6. Executor & Docker Requirement
  7. Ingress
  8. Sites (Static Site Hosting)
  9. Chart Dependencies
  10. Configuration Reference
  11. Examples
  12. Troubleshooting

Prerequisites

RequirementDetails
Kubernetesv1.25+ (tested on K3s v1.30)
Helmv3.10+
Ingress Controllernginx-ingress or equivalent (ingress class: nginx)
Docker daemonMust be installed on every node alongside the container runtime (containerd/CRI-O). Required by the executor to build and run cloud functions/sites.
StorageReadWriteOnce (RWO) PVCs at minimum. ReadWriteMany (RWX) recommended for multi-node setups without affinity constraints.

Docker Alongside Containerd

Appwrite's executor creates Docker containers directly via the Docker socket to run function and site builds. This is separate from the Kubernetes container runtime.

On each node that will run executor pods:

# Example for Ubuntu/Debian
curl -fsSL https://get.docker.com | sh
systemctl enable --now docker

Verify Docker is running alongside K8s:

docker version       # Docker daemon
crictl version       # K8s container runtime (containerd)

Both must be operational. The executor mounts /var/run/docker.sock from the host.


Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        Ingress Controller                       │
│                  (nginx, traefik, etc.)                          │
├──────────┬──────────────┬───────────────────────────────────────┤
│ /console │ appwrite.dom │ *.sites.dom    │ /v1/realtime         │
│          │ /v1/*        │                │                      │
▼          ▼              ▼                ▼                      │
┌────────┐ ┌────────────┐ ┌────────────┐  ┌──────────┐           │
│Console │ │    Core    │ │    Core    │  │ Realtime │           │
│  (UI)  │ │   (API)    │ │  (router)  │  │(websocket│           │
└────────┘ └─────┬──────┘ └────────────┘  └────┬─────┘           │
                 │                              │                 │
        ┌────────┴─────────────────┬────────────┘                 │
        ▼                          ▼                              │
  ┌───────────┐             ┌───────────┐                         │
  │   Redis   │             │ MariaDB / │                         │
  │  (queue   │             │  MongoDB  │                         │
  │  + cache) │             │           │                         │
  └─────┬─────┘             └───────────┘                         │
        │                                                         │
        ▼                                                         │
  ┌───────────────────────────────────────────────────────────────┐
  │              Background Workers                                │
  │  builds · functions · deletes · databases                      │
  │  mails · messaging · webhooks · certificates                   │
  │  audits · migrations · stats-usage                             │
  │  stats-resources · scheduler-*                                 │
  └───────────┬───────────────────────────────────────────────────┘
              │ HTTP (same-node only)
              ▼
  ┌───────────────────┐          ┌────────────────────┐
  │    Executor        │ Docker  │  Runtime Containers │
  │   (DaemonSet)      │────────▶│  (node, python,    │
  │                    │  socket │   php, ruby, etc.)  │
  └────────────────────┘         └────────────────────┘
         ▲
         │ hostPath mounts
  ┌──────┴──────────────────┐
  │  /var/appwrite/builds   │
  │  /var/appwrite/functions│
  │  /var/appwrite/sites    │
  │  /tmp (build workspace) │
  └─────────────────────────┘

Components

ComponentKindReplicasPurpose
coreDeployment1 (HPA optional)REST API, dashboard backend, site router
consoleDeployment1Appwrite Console web UI
realtimeDeployment1 (HPA optional)WebSocket server for real-time events
executorDaemonSet1 per nodeManages Docker containers for function/site builds and executions
maintenanceDeployment1Periodic cleanup tasks (cache, logs, sessions)
scheduler-functionsDeployment1Cron scheduler for cloud functions
scheduler-executionsDeployment1Scheduler for function executions
scheduler-messagesDeployment1Scheduler for messaging
worker-buildsDeployment1Processes function/site build jobs
worker-functionsDeployment1Processes function execution jobs
worker-databasesDeployment1Database operation worker
worker-deletesDeployment1Handles resource deletion
worker-certificatesDeployment1SSL certificate provisioning
worker-mailsDeployment1Email delivery
worker-messagingDeployment1Push/SMS message delivery
worker-webhooksDeployment1Webhook delivery
worker-auditsDeployment1Audit log processing
worker-migrationsDeployment1Data migration processing
worker-stats-usageDeployment1Usage statistics aggregation
worker-stats-resourcesDeployment1Resource statistics
stats-resourcesDeployment1Stats collection
usageDeployment1Usage data collection
clamavDeployment1Antivirus scanning for uploads
redisStatefulSet1Cache, pub/sub, and message queue (Bitnami subchart)
mariadb / mongodbStatefulSet1Primary database (Bitnami subchart)

Quick Start

# Add Bitnami repo for subchart dependencies
helm repo add bitnami https://charts.bitnami.com/bitnami

# Build dependencies
cd appwrite-helm
helm dependency build

# Install with MariaDB (default)
helm install appwrite . -n appwrite --create-namespace

# Install with MongoDB
helm install appwrite . -n appwrite --create-namespace \
  --set database.type=mongodb \
  --set mariadb.enabled=false \
  --set mongodb.enabled=true

# Install with custom values file
helm install appwrite . -n appwrite --create-namespace -f my-values.yaml

Upgrade

helm upgrade appwrite . -n appwrite -f my-values.yaml

Note: If you change the executor service type (e.g., from headless to ClusterIP), you must delete the service first since clusterIP is immutable:

kubectl delete svc appwrite-executor -n appwrite
helm upgrade appwrite . -n appwrite -f my-values.yaml

Database Choice

Set database.type to either mariadb or mongodb. Enable the corresponding subchart and disable the other:

MariaDB (default)

database:
  type: mariadb

mariadb:
  enabled: true
  auth:
    rootPassword: "your-root-password"
    database: appwrite
    username: appwrite
    password: "your-password"

mongodb:
  enabled: false

MongoDB

database:
  type: mongodb

mariadb:
  enabled: false

mongodb:
  enabled: true
  auth:
    enabled: true
    rootPassword: "your-root-password"
    usernames: [appwrite]
    passwords: [your-password]
    databases: [appwrite]

Important: Appwrite 1.9.0 defaults to MongoDB internally. Both backends are fully supported. Do not switch database types on existing deployments without migrating your data.


Storage Architecture

Volume Types

The chart uses two classes of volumes:

PersistentVolumeClaims (PVCs) — for data managed only by Kubernetes pods:

VolumeDefault SizeUsed By
uploads1Gicore, builds, deletes
cache1Gicore, deletes
config1Gicore
certificates1Gicore, certificates worker, deletes
imports1Gicore, migrations

hostPath volumes — for data shared between Kubernetes pods and Docker containers:

PathDefaultUsed By
/var/appwrite/buildsexecutor.hostPaths.buildsexecutor, core, builds, deletes, functions
/var/appwrite/functionsexecutor.hostPaths.functionsexecutor, core, builds, deletes, functions
/var/appwrite/sitesexecutor.hostPaths.sitesexecutor, core, builds, deletes, functions
/tmp(system)executor build workspace

hostPath volumes are necessary because the executor creates Docker containers (outside Kubernetes) that must read build artifacts from the same filesystem. PVCs are not visible to Docker containers.

Pod Affinity (coreAffinity)

When using ReadWriteOnce (RWO) PVCs, all pods that share a volume must run on the same node. The chart provides a coreAffinity mechanism:

appwrite:
  volumes:
    coreAffinity:
      enabled: true   # default: true

When enabled, worker pods (builds, functions, deletes, certificates, migrations) are scheduled on the same node as the core pod using pod affinity rules. Disable this only if you use ReadWriteMany (RWX) storage.


Executor & Docker Requirement

The executor is deployed as a DaemonSet — one pod per node. It manages function and site runtime containers through the Docker socket.

How It Works

  1. A build/function request arrives at the core API
  2. Core enqueues a job via Redis
  3. The builds/functions worker picks up the job and calls the executor HTTP API
  4. The executor creates a Docker container with the appropriate runtime image
  5. The Docker container reads source code from /tmp (host bind mount) and produces build output
  6. The executor copies the output to /var/appwrite/builds (hostPath)

Same-Node Routing

The executor service uses internalTrafficPolicy: Local to ensure worker pods only communicate with the executor on their own node. This is critical because:

  • Build source files are written to hostPath on a specific node
  • The Docker container must be on the same node to see those files via bind mounts
  • The /tmp directory is node-local

Executor Configuration

executor:
  enabled: true
  image:
    repository: openruntimes/executor
    tag: "0.11.4"
  dockerSocketPath: "/var/run/docker.sock"
  runtimesNetwork: "appwrite_runtimes"
  inactiveThreshold: 60           # seconds before idle containers are removed
  maintenanceInterval: 60         # cleanup interval in seconds
  hostPaths:
    builds: "/var/appwrite/builds"
    functions: "/var/appwrite/functions"
    sites: "/var/appwrite/sites"
  # Docker Hub credentials (optional, avoids rate limits)
  dockerHub:
    username: ""
    password: ""

Compute Limits

System-wide maximums for function and site runtime specifications:

compute:
  maxCpus: 8        # max CPU cores per runtime container
  maxMemory: 8192   # max memory (MB) per runtime container
  buildTimeout: 900  # build timeout in seconds
  sizeLimit: 30000000  # max payload size in bytes

Ingress

The chart creates up to four Ingress resources:

IngressHostPathBackend
coreappwrite.domain/core service
consoleappwrite.domain/consoleconsole service
realtimeappwrite.domain/v1/realtimerealtime service
sites*.sites.domain/core service

All ingresses use ingressClassName: nginx. Customize via annotations:

appwrite:
  domain: appwrite.example.com
  ingress:
    enabled: true
    annotations:
      cert-manager.io/cluster-issuer: letsencrypt
    tls:
      enabled: true

Sites Ingress (Wildcard)

Sites require a wildcard DNS entry and wildcard TLS certificate:

sites:
  domain: "sites.example.com"
  ingress:
    enabled: true
    annotations:
      cert-manager.io/cluster-issuer: letsencrypt
    tls:
      enabled: true
      secretName: "sites-wildcard-tls"

DNS: *.sites.example.com → your ingress controller IP.


Sites (Static Site Hosting)

Appwrite Sites lets you deploy static and SSR sites. Requirements:

  1. Set sites.domain to your sites base domain
  2. Enable sites.ingress for wildcard routing
  3. Add site runtimes (e.g., node-16.0) to sites.runtimes or functions.runtimes
  4. Ensure Docker is installed on nodes (executor builds sites as Docker containers)
sites:
  domain: "sites.example.com"
  runtimes: []          # additional runtimes beyond functions.runtimes
  timeout: 900
  ingress:
    enabled: true

Chart Dependencies

RepositoryNameVersionCondition
https://charts.bitnami.com/bitnamimariadb11.5.5mariadb.enabled
https://charts.bitnami.com/bitnamimongodb15.1.2mongodb.enabled
https://charts.bitnami.com/bitnamiredis17.9.0a

Deploy appwrite with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has appwrite on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartappwrite is pinned at v1.3.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply