Back to articles
Technology Insight

Deploying Appwrite as a Self-Hosted Backend for Flutter and React Applications on a VPS: A Complete Enterprise Guide

May 30, 2026

Introduction: The Shift Toward Self-Hosted Backend-as-a-Service

In the modern software development landscape, speed-to-market and cost efficiency are critical metrics for enterprise success. For years, cloud-based Backend-as-a-Service (BaaS) platforms like Firebase have been the default choice for rapid application development. However, as applications scale, organizations frequently encounter significant challenges, including skyrocketing usage costs, unpredictable pricing tiers, vendor lock-in, and stringent data sovereignty compliance requirements.

To mitigate these challenges, engineering teams are increasingly turning to open-source, self-hosted alternatives. Appwrite has emerged as a premier enterprise-grade, open-source BaaS solution. By deploying Appwrite on a dedicated Virtual Private Server (VPS), businesses retain 100% ownership of their data, eliminate unpredictable scaling fees, and maintain absolute control over their infrastructure. This comprehensive guide explores how to deploy Appwrite on a VPS and seamlessly integrate it as a unified backend engine for both Flutter mobile apps and React web applications.

---

Why Choose Appwrite for Cross-Platform Infrastructure?

Appwrite acts as an all-in-one ecosystem that abstracts the complexities of backend engineering, allowing front-end and mobile teams to focus entirely on user experience. When serving a dual ecosystem like Flutter (mobile) and React (web), Appwrite provides several distinct structural advantages:

  • Unified Multi-Tenant Architecture: Manage multiple frontend platforms under a single Appwrite project, sharing the same database schemas, authentication flows, and storage buckets.
  • Robust Security Out of the Box: Appwrite features built-in SSL management, automatic encryption at rest, comprehensive Role-Based Access Control (RBAC), and advanced abuse protection mechanisms.
  • Developer-Centric SDKs: Highly optimized, idiomatic SDKs for both Dart/Flutter and JavaScript/TypeScript ensure rapid, type-safe integration.
  • Predictable Operational Costs: Running Appwrite on a fixed-price VPS converts volatile variable cloud expenses into a predictable operational expenditure (OpEx).
---

Prerequisites and Infrastructure Provisioning

Before initiating the deployment process, ensure your infrastructure meets the minimum baseline requirements necessary to sustain a production-grade Appwrite instance serving concurrent mobile and web clients.

Hardware Recommendations

While Appwrite can run on minimal hardware for testing, a reliable staging or production environment demands a robust architecture. The following matrix outlines our recommended specifications:

Resource ComponentMinimum SpecificationProduction Recommendation
CPU Architecture1 Core (x86_64 or ARM64)4 Cores or higher
System Memory (RAM)2 GB8 GB (Crucial for MariaDB & Redis caching)
Storage Type20 GB SSD/NVMe100 GB+ NVMe (Scaled based on media assets)
Operating SystemUbuntu 22.04 LTS / 24.04 LTSUbuntu 24.04 LTS (Clean installation)

Network & Domain Configurations

Ensure that your VPS provider has a static IPv4 address assigned to the instance. You must configure your Domain Name System (DNS) registry to point your target domain or subdomain to your VPS IP address prior to installation. For example:

  • appwrite.yourcompany.com → Pointing to the VPS Public IP via an A Record.
---

Step-by-Step Appwrite Deployment on the VPS

Appwrite is inherently designed to run containerized via Docker. This ensures isolation, reproducible environments, and simplified upgrade paths.

Step 1: System Update and Dependency Installation

Connect to your VPS via SSH as a root or sudo-privileged user. Begin by updating the system packages and installing the fundamental prerequisites:

sudo apt update && sudo apt upgrade -y
sudo apt install curl git apt-transport-https ca-certificates gnupg lsb-release -y

Step 2: Install Docker Engine and Docker Compose

Execute the official Docker installation script provided by Docker to ensure the latest stable engine is deployed:

curl -fsSL [https://get.docker.com](https://get.docker.com) -o get-docker.sh
sudo sh get-docker.sh

Verify that the Docker daemon and Docker Compose plugin are operational by checking their respective versions:

docker --version
docker compose version

Step 3: Execute the Appwrite Installer

Appwrite provides an interactive, automated installation script that pulls the required Docker images, generates the environment configuration file (.env), and configures the reverse proxy. Launch the installer using the following command:

docker run -it --rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
--entrypoint="" \
appwrite/appwrite:latest \
sh -c "php opts/load.php"
Security Note: During the interactive prompt, you will be asked to define your primary domain, HTTP/HTTPS ports, and a secure Appwrite Secret API Key. Ensure you use your configured subdomain (e.g., appwrite.yourcompany.com) to allow Appwrite's built-in Let's Encrypt agent to provision a valid, automated SSL certificate.

Once the initialization script completes, Appwrite will orchestrate its multi-container ecosystem (including MariaDB, Redis, InfluxDB, and Traefik). You can confirm that all services are healthy by running docker ps within your terminal.

---

Configuring the Appwrite Console for Multi-Platform Clients

Navigate to your configured domain via a secure web browser (e.g., [https://appwrite.yourcompany.com](https://appwrite.yourcompany.com)). Create your administrative account to access the main Appwrite Dashboard. To prepare the backend for Flutter and React applications, follow this structural workflow:

1. Create a New Centralized Project

Click on the Create Project button, and assign a clear, descriptive name reflecting your application ecosystem (e.g., Enterprise Commerce Engine).

2. Register the React Platform (Web)

Under the project settings, locate the Platforms section and choose Web App. Define a unique application ID and input your valid frontend web hostname. For development, add localhost; for production, add your application's production URL (e.g., [https://dashboard.yourcompany.com](https://dashboard.yourcompany.com)). This configuration prevents Cross-Origin Resource Sharing (CORS) unauthorized access.

3. Register the Flutter Platform (Mobile)

Add another platform and select either Android or iOS depending on your target compilation. Input your exact application package name / bundle identifier (e.g., com.yourcompany.checkoutapp). This step is imperative as Appwrite utilizes these unique identifiers to validate origin requests and securely manage mobile session handshakes.

---

Integrating Appwrite with Flutter

Integrating Appwrite into a Flutter mobile application requires minimal boilerplate code. Appwrite's native Dart asynchronous processing maps flawlessly to Flutter's reactive state management systems.

1. Adding the Dependency

Add the official Appwrite client package to your project's pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  appwrite: ^12.0.0 # Utilize the latest compatible version

2. Initializing the SDK

Create a centralized configuration file or service locator (such as GetIt or Riverpod providers) to instantiate the Appwrite Client globally within your Flutter application architecture:

import 'package:appwrite/appwrite.dart';

class AppwriteService {
  late Client client;
  late Account account;
  late Databases databases;

  void initialize() {
    client = Client()
      ..setEndpoint('[https://appwrite.yourcompany.com/v1](https://appwrite.yourcompany.com/v1)')
      ..setProject('YOUR_PROJECT_ID')
      ..setSelfSigned(status: false); // Set to false if utilizing valid Let's Encrypt SSL

    account = Account(client);
    databases = Databases(client);
  }
}
---

Integrating Appwrite with React

For web architectures using modern React frameworks (such as Next.js, Vite, or Create React App), integrating Appwrite is straightforward and functions smoothly within React's functional component hooks model.

1. Dependency Installation

Install the node package using your preferred package manager:

npm install appwrite

2. Modular Client Implementation

Establish a dedicated infrastructure file (e.g., src/backend/appwrite.js) to prevent redundant initializations across the virtual DOM re-renders:

import { Client, Account, Databases } from 'appwrite';

const client = new Client()
    .setEndpoint('[https://appwrite.yourcompany.com/v1](https://appwrite.yourcompany.com/v1)')
    .setProject('YOUR_PROJECT_ID');

export const account = new Account(client);
export const databases = new Databases(client);
export { client };
---

Production Optimization and Security Best Practices

Transitioning from a development environment to a production architecture requires rigorous hardening of your VPS configuration to guarantee optimal uptime, data integrity, and asset security.

  • Automated Database Backups: Implement regular cron jobs on your VPS to execute docker exec database dumps of your MariaDB instances, and copy the backups offsite to secure storage.
  • UFW Firewall Optimization: Restrict open ports on your host machine. Only ports 80 (HTTP), 443 (HTTPS), and your custom SSH port should be exposed to the public internet.
  • Swap Memory Allocation: If your VPS has constrained RAM overhead, configure a dedicated linux swap file (e.g., 4GB swap space) to prevent out-of-memory (OOM) kernels from abruptly terminating database containers during peak usage spikes.
---

Conclusion: Scalable Architecture Control

Deploying Appwrite on a Virtual Private Server offers a reliable infrastructure setup for cross-platform engineers. It bridges the gap between rapid frontend delivery and robust, self-determined backend control. By unifying your Flutter mobile architecture and React web interfaces under a self-hosted Appwrite engine, you create a fast, secure development environment while eliminating vendor lock-in and high variable costs. Your development stack is now fully integrated, highly economical, and ready to scale entirely on your own terms.

Deploying Appwrite as a Self-Hosted Backend for Flutter and React Applications on a VPS: A Complete Enterprise Guide | DPTCloud