Why self-host Appwrite on a VPS
Appwrite brings together in a single platform everything an application needs on the server side: authentication with more than 30 OAuth methods, a document database with granular permissions, file storage with image transformation, serverless functions in several languages, and messaging. Its cloud version bills per usage and per resources; by self-hosting on a VPS, you deploy the whole thing via Docker and drive it from an elegant web console, with no cap. It's particularly suited to Flutter, React Native, or web developers who want a ready-to-use backend with official SDKs, while keeping the data and logic on their own infrastructure. You control the functions, the API keys, and the permissions, and you scale at your own pace.
The concrete benefits of a self-hosted Appwrite
- All-in-one backend: Auth, Databases, Storage, Functions, and Messaging in a single console.
- Official SDKs for Flutter, React Native, Web, Android, iOS, Node, Python, and more.
- More than 30 built-in OAuth providers (Google, GitHub, Apple...) with no code.
- Self-hosted serverless functions: run your business logic without an external service.
- Granular permissions at the document and collection level, managed from the console.
- No billing per execution and no user quota: a fixed VPS plan.
Hardware and software prerequisites
Appwrite orchestrates several services (API, console, MariaDB, Redis, workers, and the functions runtime via Docker-in-Docker). For a development instance, 2 vCPU and 4 GB of RAM with 40 GB of SSD are enough. For production with active serverless functions and several apps, aim for 4 vCPU, 8 GB of RAM, and 80 GB of SSD, because each function runs in its own ephemeral container. On the software side: Ubuntu 22.04/24.04 LTS, Docker and Docker Compose v2 (Appwrite manages its own built-in Traefik for routing and SSL), and a domain name pointing to the VPS (e.g., api.myapp.com). Ports 80 and 443 must be free for Traefik to obtain the Let's Encrypt certificates.
Deploying self-hosted Appwrite with Docker
Prepare the VPS and the domain
Install Docker, point your domain to the VPS IP, and make sure ports 80 and 443 are open in ufw: Appwrite's built-in Traefik needs them for the Let's Encrypt ACME challenge.
Run the official installer
Run the installation command docker run ... appwrite/appwrite install: an interactive wizard asks you for the domain, the HTTP/HTTPS port, and generates the docker-compose.yml as well as the .env file with the secrets. This is the recommended method rather than a hand-written compose.
Configure the domain and SSL
Fill in _APP_DOMAIN and _APP_DOMAIN_TARGET with your domain name. Traefik then automatically generates the HTTPS certificate. Check console access at https://api.myapp.com and create your root administrator account.
Create a project and its first application
From the console, create a project, add a platform (Web, Flutter, Apple...) by declaring the allowed hostname, and retrieve the project ID. This information feeds the client-side SDK initialization.
Harden the production configuration
In .env, set _APP_OPTIONS_ABUSE and _APP_OPTIONS_FORCE_HTTPS to enabled, configure SMTP (_APP_SMTP_*) for verification emails, and restrict _APP_CONSOLE_WHITELIST_* if you want to limit console access.
Back up MariaDB and the Storage
Schedule a daily dump of Appwrite's MariaDB database and archive the Storage volume (uploads). Since Appwrite encrypts some data with _APP_OPENSSL_KEY_V1, back up this secret too: without it, the encrypted files are unrecoverable.
Appwrite vs Supabase: which one to self-host?
| Criterion | Appwrite | Supabase |
|---|---|---|
| Database | MariaDB, document model | Native PostgreSQL, full SQL |
| Approach | SDK- and mobile-app-oriented | SQL- and relational-app-oriented |
| Serverless functions | Native, multi-language built-in | Edge Functions (Deno) |
| Installation | Official interactive installer | Compose to configure manually |
| SSL / routing | Built-in Traefik, automatic | External reverse proxy to add |
| Vector / AI search | Not native | Native via pgvector |
| Ideal for | Flutter, React Native, mobile-first | Advanced SQL, RAG, relational |
| Administration console | Rich, guided console | Studio focused on SQL tables |
Be sure to back up the _APP_OPENSSL_KEY_V1 variable from your .env in a separate vault: Appwrite uses it to encrypt files and some sensitive data, and a restore without this key makes the encrypted content unreadable. For serverless functions in production, monitor the disk consumption tied to the ephemeral runtime containers and schedule a regular docker system prune to avoid saturating the SSD with intermediate images.