appwrite
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
- Prerequisites
- Architecture
- Quick Start
- Database Choice
- Storage Architecture
- Executor & Docker Requirement
- Ingress
- Sites (Static Site Hosting)
- Chart Dependencies
- Configuration Reference
- Examples
- Troubleshooting
Prerequisites
| Requirement | Details |
|---|---|
| Kubernetes | v1.25+ (tested on K3s v1.30) |
| Helm | v3.10+ |
| Ingress Controller | nginx-ingress or equivalent (ingress class: nginx) |
| Docker daemon | Must be installed on every node alongside the container runtime (containerd/CRI-O). Required by the executor to build and run cloud functions/sites. |
| Storage | ReadWriteOnce (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
| Component | Kind | Replicas | Purpose |
|---|---|---|---|
| core | Deployment | 1 (HPA optional) | REST API, dashboard backend, site router |
| console | Deployment | 1 | Appwrite Console web UI |
| realtime | Deployment | 1 (HPA optional) | WebSocket server for real-time events |
| executor | DaemonSet | 1 per node | Manages Docker containers for function/site builds and executions |
| maintenance | Deployment | 1 | Periodic cleanup tasks (cache, logs, sessions) |
| scheduler-functions | Deployment | 1 | Cron scheduler for cloud functions |
| scheduler-executions | Deployment | 1 | Scheduler for function executions |
| scheduler-messages | Deployment | 1 | Scheduler for messaging |
| worker-builds | Deployment | 1 | Processes function/site build jobs |
| worker-functions | Deployment | 1 | Processes function execution jobs |
| worker-databases | Deployment | 1 | Database operation worker |
| worker-deletes | Deployment | 1 | Handles resource deletion |
| worker-certificates | Deployment | 1 | SSL certificate provisioning |
| worker-mails | Deployment | 1 | Email delivery |
| worker-messaging | Deployment | 1 | Push/SMS message delivery |
| worker-webhooks | Deployment | 1 | Webhook delivery |
| worker-audits | Deployment | 1 | Audit log processing |
| worker-migrations | Deployment | 1 | Data migration processing |
| worker-stats-usage | Deployment | 1 | Usage statistics aggregation |
| worker-stats-resources | Deployment | 1 | Resource statistics |
| stats-resources | Deployment | 1 | Stats collection |
| usage | Deployment | 1 | Usage data collection |
| clamav | Deployment | 1 | Antivirus scanning for uploads |
| redis | StatefulSet | 1 | Cache, pub/sub, and message queue (Bitnami subchart) |
| mariadb / mongodb | StatefulSet | 1 | Primary 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
clusterIPis 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:
| Volume | Default Size | Used By |
|---|---|---|
uploads | 1Gi | core, builds, deletes |
cache | 1Gi | core, deletes |
config | 1Gi | core |
certificates | 1Gi | core, certificates worker, deletes |
imports | 1Gi | core, migrations |
hostPath volumes — for data shared between Kubernetes pods and Docker containers:
| Path | Default | Used By |
|---|---|---|
/var/appwrite/builds | executor.hostPaths.builds | executor, core, builds, deletes, functions |
/var/appwrite/functions | executor.hostPaths.functions | executor, core, builds, deletes, functions |
/var/appwrite/sites | executor.hostPaths.sites | executor, 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
- A build/function request arrives at the core API
- Core enqueues a job via Redis
- The builds/functions worker picks up the job and calls the executor HTTP API
- The executor creates a Docker container with the appropriate runtime image
- The Docker container reads source code from
/tmp(host bind mount) and produces build output - 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
/tmpdirectory 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:
| Ingress | Host | Path | Backend |
|---|---|---|---|
| core | appwrite.domain | / | core service |
| console | appwrite.domain | /console | console service |
| realtime | appwrite.domain | /v1/realtime | realtime 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:
- Set
sites.domainto your sites base domain - Enable
sites.ingressfor wildcard routing - Add site runtimes (e.g.,
node-16.0) tosites.runtimesorfunctions.runtimes - 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
| Repository | Name | Version | Condition |
|---|---|---|---|
| https://charts.bitnami.com/bitnami | mariadb | 11.5.5 | mariadb.enabled |
| https://charts.bitnami.com/bitnami | mongodb | 15.1.2 | mongodb.enabled |
| https://charts.bitnami.com/bitnami | redis | 17.9.0 | a |
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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartappwrite is pinned at v1.3.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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