Appwrite Backend as a Service
Self-hosted Firebase alternative with authentication, databases, storage, and functions.
Overview
Appwrite is an open-source Backend-as-a-Service platform that provides developers with a comprehensive set of APIs and tools to build web, mobile, and Flutter applications. Originally created as a self-hosted alternative to Firebase, Appwrite offers authentication, real-time databases, file storage, cloud functions, and webhooks through a unified REST API and dashboard interface. The platform emerged from the need for developers to have full control over their backend infrastructure while maintaining the convenience of managed services.
This stack combines Appwrite with a robust data layer consisting of MariaDB for primary application data storage, Redis for high-performance caching and session management, and InfluxDB for time-series analytics and monitoring data. Telegraf acts as the metrics collection agent, gathering system and application performance data and feeding it into InfluxDB for analysis. This configuration creates a production-grade backend infrastructure that can handle authentication, data persistence, real-time features, and comprehensive monitoring in a single deployment.
This configuration is ideal for startups and development teams who want the convenience of Firebase-like services but require data sovereignty, custom business logic, or cost predictability. The combination is particularly valuable for building mobile applications, SaaS platforms, or any application requiring user authentication, file uploads, real-time updates, and detailed usage analytics. Unlike managed services, this self-hosted approach eliminates vendor lock-in while providing enterprise-grade monitoring and observability through the InfluxDB and Telegraf integration.
Key Features
- Multi-tenancy support with project isolation and API key management through Appwrite Console
- Real-time database subscriptions and webhooks powered by Appwrite's event system
- OAuth integration with 30+ providers including Google, GitHub, Facebook, and custom SAML
- Built-in file storage with image transformation, virus scanning, and CDN capabilities
- Cloud Functions runtime supporting Node.js, Python, PHP, Ruby, and custom Docker containers
- MariaDB Galera Cluster readiness for high-availability database deployments
- Redis-powered session management with automatic failover and clustering support
- Time-series analytics collection via Telegraf monitoring Appwrite API usage and performance metrics
Common Use Cases
- 1Mobile app backends requiring user authentication, push notifications, and offline data sync
- 2SaaS applications needing multi-tenant user management with role-based access control
- 3E-commerce platforms requiring file storage for product images and order processing workflows
- 4IoT applications collecting sensor data through Appwrite APIs with InfluxDB time-series storage
- 5Social media applications needing real-time messaging, user profiles, and content moderation
- 6Enterprise applications requiring custom authentication flows and detailed usage analytics
- 7Development agencies building multiple client applications with shared backend infrastructure
Prerequisites
- Docker host with minimum 2GB RAM (4GB recommended) to support MariaDB, Redis, and InfluxDB simultaneously
- Available ports 80 and 443 for Appwrite web console and API access
- Valid domain name and SSL certificates for production deployments with OAuth providers
- Understanding of REST APIs, JWT tokens, and basic database concepts for Appwrite configuration
- Telegraf configuration file (telegraf.conf) with InfluxDB output and desired input plugins configured
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 appwrite: 3 image: appwrite/appwrite:latest4 ports: 5 - "80:80"6 - "443:443"7 environment: 8 - _APP_ENV=production9 - _APP_OPENSSL_KEY_V1=${OPENSSL_KEY}10 - _APP_DOMAIN=localhost11 - _APP_DOMAIN_TARGET=localhost12 - _APP_REDIS_HOST=redis13 - _APP_REDIS_PORT=637914 - _APP_DB_HOST=mariadb15 - _APP_DB_PORT=330616 - _APP_DB_SCHEMA=appwrite17 - _APP_DB_USER=${MYSQL_USER}18 - _APP_DB_PASS=${MYSQL_PASSWORD}19 - _APP_INFLUXDB_HOST=influxdb20 - _APP_INFLUXDB_PORT=808621 volumes: 22 - appwrite_uploads:/storage/uploads23 - appwrite_cache:/storage/cache24 - appwrite_config:/storage/config25 - appwrite_certificates:/storage/certificates26 - appwrite_functions:/storage/functions27 depends_on: 28 - mariadb29 - redis30 - influxdb31 networks: 32 - appwrite-net33 restart: unless-stopped3435 mariadb: 36 image: mariadb:1137 environment: 38 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}39 MYSQL_DATABASE: appwrite40 MYSQL_USER: ${MYSQL_USER}41 MYSQL_PASSWORD: ${MYSQL_PASSWORD}42 volumes: 43 - mariadb_data:/var/lib/mysql44 networks: 45 - appwrite-net46 restart: unless-stopped4748 redis: 49 image: redis:7-alpine50 volumes: 51 - redis_data:/data52 networks: 53 - appwrite-net54 restart: unless-stopped5556 influxdb: 57 image: influxdb:2.7-alpine58 volumes: 59 - influxdb_data:/var/lib/influxdb260 networks: 61 - appwrite-net62 restart: unless-stopped6364 telegraf: 65 image: telegraf:alpine66 volumes: 67 - ./telegraf.conf:/etc/telegraf/telegraf.conf:ro68 depends_on: 69 - influxdb70 networks: 71 - appwrite-net72 restart: unless-stopped7374volumes: 75 appwrite_uploads: 76 appwrite_cache: 77 appwrite_config: 78 appwrite_certificates: 79 appwrite_functions: 80 mariadb_data: 81 redis_data: 82 influxdb_data: 8384networks: 85 appwrite-net: 86 driver: bridge.env Template
.env
1# Appwrite Configuration2OPENSSL_KEY=$(openssl rand -hex 32)34# MariaDB5MYSQL_ROOT_PASSWORD=secure_root_password6MYSQL_USER=appwrite7MYSQL_PASSWORD=secure_mysql_passwordUsage Notes
- 1Appwrite Console at http://localhost
- 2Create account on first visit
- 3SDKs available for all platforms
- 4Built-in OAuth, database, storage, and functions
Individual Services(5 services)
Copy individual services to mix and match with your existing compose files.
appwrite
appwrite:
image: appwrite/appwrite:latest
ports:
- "80:80"
- "443:443"
environment:
- _APP_ENV=production
- _APP_OPENSSL_KEY_V1=${OPENSSL_KEY}
- _APP_DOMAIN=localhost
- _APP_DOMAIN_TARGET=localhost
- _APP_REDIS_HOST=redis
- _APP_REDIS_PORT=6379
- _APP_DB_HOST=mariadb
- _APP_DB_PORT=3306
- _APP_DB_SCHEMA=appwrite
- _APP_DB_USER=${MYSQL_USER}
- _APP_DB_PASS=${MYSQL_PASSWORD}
- _APP_INFLUXDB_HOST=influxdb
- _APP_INFLUXDB_PORT=8086
volumes:
- appwrite_uploads:/storage/uploads
- appwrite_cache:/storage/cache
- appwrite_config:/storage/config
- appwrite_certificates:/storage/certificates
- appwrite_functions:/storage/functions
depends_on:
- mariadb
- redis
- influxdb
networks:
- appwrite-net
restart: unless-stopped
mariadb
mariadb:
image: mariadb:11
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: appwrite
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- mariadb_data:/var/lib/mysql
networks:
- appwrite-net
restart: unless-stopped
redis
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
networks:
- appwrite-net
restart: unless-stopped
influxdb
influxdb:
image: influxdb:2.7-alpine
volumes:
- influxdb_data:/var/lib/influxdb2
networks:
- appwrite-net
restart: unless-stopped
telegraf
telegraf:
image: telegraf:alpine
volumes:
- ./telegraf.conf:/etc/telegraf/telegraf.conf:ro
depends_on:
- influxdb
networks:
- appwrite-net
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 appwrite:5 image: appwrite/appwrite:latest6 ports:7 - "80:80"8 - "443:443"9 environment:10 - _APP_ENV=production11 - _APP_OPENSSL_KEY_V1=${OPENSSL_KEY}12 - _APP_DOMAIN=localhost13 - _APP_DOMAIN_TARGET=localhost14 - _APP_REDIS_HOST=redis15 - _APP_REDIS_PORT=637916 - _APP_DB_HOST=mariadb17 - _APP_DB_PORT=330618 - _APP_DB_SCHEMA=appwrite19 - _APP_DB_USER=${MYSQL_USER}20 - _APP_DB_PASS=${MYSQL_PASSWORD}21 - _APP_INFLUXDB_HOST=influxdb22 - _APP_INFLUXDB_PORT=808623 volumes:24 - appwrite_uploads:/storage/uploads25 - appwrite_cache:/storage/cache26 - appwrite_config:/storage/config27 - appwrite_certificates:/storage/certificates28 - appwrite_functions:/storage/functions29 depends_on:30 - mariadb31 - redis32 - influxdb33 networks:34 - appwrite-net35 restart: unless-stopped3637 mariadb:38 image: mariadb:1139 environment:40 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}41 MYSQL_DATABASE: appwrite42 MYSQL_USER: ${MYSQL_USER}43 MYSQL_PASSWORD: ${MYSQL_PASSWORD}44 volumes:45 - mariadb_data:/var/lib/mysql46 networks:47 - appwrite-net48 restart: unless-stopped4950 redis:51 image: redis:7-alpine52 volumes:53 - redis_data:/data54 networks:55 - appwrite-net56 restart: unless-stopped5758 influxdb:59 image: influxdb:2.7-alpine60 volumes:61 - influxdb_data:/var/lib/influxdb262 networks:63 - appwrite-net64 restart: unless-stopped6566 telegraf:67 image: telegraf:alpine68 volumes:69 - ./telegraf.conf:/etc/telegraf/telegraf.conf:ro70 depends_on:71 - influxdb72 networks:73 - appwrite-net74 restart: unless-stopped7576volumes:77 appwrite_uploads:78 appwrite_cache:79 appwrite_config:80 appwrite_certificates:81 appwrite_functions:82 mariadb_data:83 redis_data:84 influxdb_data:8586networks:87 appwrite-net:88 driver: bridge89EOF9091# 2. Create the .env file92cat > .env << 'EOF'93# Appwrite Configuration94OPENSSL_KEY=$(openssl rand -hex 32)9596# MariaDB97MYSQL_ROOT_PASSWORD=secure_root_password98MYSQL_USER=appwrite99MYSQL_PASSWORD=secure_mysql_password100EOF101102# 3. Start the services103docker compose up -d104105# 4. View logs106docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/appwrite-backend/run | bashTroubleshooting
- Appwrite Console shows 'Service Unavailable': Check MariaDB container health and ensure database schema initialization completed successfully
- OAuth authentication fails with redirect URI mismatch: Update _APP_DOMAIN and _APP_DOMAIN_TARGET environment variables to match your actual domain
- File uploads return 500 errors: Verify appwrite_uploads volume permissions and available disk space for large file storage
- InfluxDB connection timeouts in Appwrite logs: Ensure InfluxDB container is fully initialized and create required buckets and tokens
- Redis connection refused errors: Check Redis container status and verify network connectivity between Appwrite and Redis containers
- Telegraf not collecting metrics: Validate telegraf.conf file syntax and ensure proper InfluxDB authentication credentials are configured
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
appwritemariadbredisinfluxdbtelegraf
Tags
#appwrite#baas#firebase-alternative#backend#serverless
Category
Full Web StacksAd Space
Shortcuts: C CopyF FavoriteD Download