docker.recipes

Appwrite Backend Platform

advanced

Self-hosted Appwrite backend-as-a-service with databases, auth, storage, and functions.

Overview

Appwrite is an open-source Backend-as-a-Service (BaaS) platform that provides developers with a complete set of APIs and tools for building modern applications. Originally created to simplify backend development, Appwrite offers authentication, database management, file storage, cloud functions, and real-time capabilities through a unified platform with SDKs for web, mobile, and server-side applications. This comprehensive stack combines Appwrite with MariaDB for robust relational data storage, Redis for high-performance caching and session management, InfluxDB for time-series analytics and monitoring data, and Telegraf for metrics collection and forwarding. The integration creates a production-ready backend infrastructure that handles user management, data persistence, real-time subscriptions, and comprehensive monitoring without requiring separate service configurations. This configuration is ideal for development teams building modern web applications, mobile apps, or SaaS platforms who need enterprise-grade backend capabilities without the complexity of managing individual microservices. The combination provides everything from user authentication and database operations to real-time features and system monitoring in a single deployable stack.

Key Features

  • Multi-database authentication with OAuth providers, email/password, phone, and anonymous login support
  • Real-time subscriptions and WebSocket connections for live data updates across clients
  • File storage with automatic image transformations, compression, and CDN capabilities
  • Cloud Functions runtime supporting multiple programming languages with event triggers
  • MariaDB with Aria storage engine for enhanced crash recovery and improved performance
  • Redis-powered session management and real-time collaboration features
  • InfluxDB integration for application analytics, user behavior tracking, and performance metrics
  • Telegraf-based system monitoring with StatsD protocol support for custom metrics

Common Use Cases

  • 1Mobile app backends requiring authentication, push notifications, and offline-first data sync
  • 2SaaS applications needing multi-tenant user management with role-based access control
  • 3Real-time collaboration platforms with live document editing and user presence indicators
  • 4IoT applications collecting sensor data with time-series analysis and alerting capabilities
  • 5E-commerce platforms requiring user accounts, product catalogs, and order management
  • 6Content management systems with file uploads, image processing, and user-generated content
  • 7Gaming backends with leaderboards, user profiles, and real-time multiplayer features

Prerequisites

  • Minimum 4GB RAM (2GB for Appwrite, 1GB for MariaDB, 512MB for Redis, 512MB for InfluxDB)
  • Docker Engine 20.10+ and Docker Compose 2.0+ installed on the host system
  • Ports 80 and 443 available for Appwrite web console and API access
  • Basic understanding of REST APIs, authentication flows, and database concepts
  • SSL certificate for production deployments with custom domains
  • Understanding of time-series data concepts for InfluxDB analytics features

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:1.4
4 container_name: appwrite
5 volumes:
6 - appwrite_uploads:/storage/uploads
7 - appwrite_cache:/storage/cache
8 - appwrite_config:/storage/config
9 - appwrite_certs:/storage/certificates
10 - appwrite_functions:/storage/functions
11 ports:
12 - "80:80"
13 - "443:443"
14 environment:
15 - _APP_ENV=production
16 - _APP_LOCALE=en
17 - _APP_CONSOLE_WHITELIST_ROOT=enabled
18 - _APP_CONSOLE_WHITELIST_EMAILS=
19 - _APP_CONSOLE_WHITELIST_IPS=
20 - _APP_SYSTEM_EMAIL_NAME=Appwrite
21 - _APP_SYSTEM_EMAIL_ADDRESS=team@appwrite.io
22 - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS=security@appwrite.io
23 - _APP_OPTIONS_ABUSE=enabled
24 - _APP_OPTIONS_FORCE_HTTPS=disabled
25 - _APP_OPENSSL_KEY_V1=${APPWRITE_KEY}
26 - _APP_DOMAIN=localhost
27 - _APP_DOMAIN_TARGET=localhost
28 - _APP_REDIS_HOST=redis
29 - _APP_REDIS_PORT=6379
30 - _APP_DB_HOST=mariadb
31 - _APP_DB_PORT=3306
32 - _APP_DB_SCHEMA=appwrite
33 - _APP_DB_USER=${MARIADB_USER}
34 - _APP_DB_PASS=${MARIADB_PASSWORD}
35 - _APP_INFLUXDB_HOST=influxdb
36 - _APP_INFLUXDB_PORT=8086
37 - _APP_STATSD_HOST=telegraf
38 - _APP_STATSD_PORT=8125
39 depends_on:
40 - mariadb
41 - redis
42 - influxdb
43 networks:
44 - appwrite-network
45
46 mariadb:
47 image: mariadb:10.11
48 container_name: appwrite-mariadb
49 environment:
50 - MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
51 - MYSQL_DATABASE=appwrite
52 - MYSQL_USER=${MARIADB_USER}
53 - MYSQL_PASSWORD=${MARIADB_PASSWORD}
54 volumes:
55 - mariadb_data:/var/lib/mysql
56 networks:
57 - appwrite-network
58
59 redis:
60 image: redis:7-alpine
61 container_name: appwrite-redis
62 volumes:
63 - redis_data:/data
64 networks:
65 - appwrite-network
66
67 influxdb:
68 image: influxdb:1.8
69 container_name: appwrite-influxdb
70 volumes:
71 - influxdb_data:/var/lib/influxdb
72 networks:
73 - appwrite-network
74
75 telegraf:
76 image: appwrite/telegraf:1.4
77 container_name: appwrite-telegraf
78 networks:
79 - appwrite-network
80
81volumes:
82 appwrite_uploads:
83 appwrite_cache:
84 appwrite_config:
85 appwrite_certs:
86 appwrite_functions:
87 mariadb_data:
88 redis_data:
89 influxdb_data:
90
91networks:
92 appwrite-network:
93 driver: bridge

.env Template

.env
1# Appwrite Backend
2APPWRITE_KEY=your-secret-key-min-128-bits
3MARIADB_ROOT_PASSWORD=rootpassword
4MARIADB_USER=appwrite
5MARIADB_PASSWORD=appwrite_password

Usage Notes

  1. 1Console at http://localhost
  2. 2Create account on first visit
  3. 3SDKs available for web, mobile, server
  4. 4Supports OAuth providers
  5. 5Built-in realtime subscriptions

Individual Services(5 services)

Copy individual services to mix and match with your existing compose files.

appwrite
appwrite:
  image: appwrite/appwrite:1.4
  container_name: appwrite
  volumes:
    - appwrite_uploads:/storage/uploads
    - appwrite_cache:/storage/cache
    - appwrite_config:/storage/config
    - appwrite_certs:/storage/certificates
    - appwrite_functions:/storage/functions
  ports:
    - "80:80"
    - "443:443"
  environment:
    - _APP_ENV=production
    - _APP_LOCALE=en
    - _APP_CONSOLE_WHITELIST_ROOT=enabled
    - _APP_CONSOLE_WHITELIST_EMAILS=
    - _APP_CONSOLE_WHITELIST_IPS=
    - _APP_SYSTEM_EMAIL_NAME=Appwrite
    - _APP_SYSTEM_EMAIL_ADDRESS=team@appwrite.io
    - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS=security@appwrite.io
    - _APP_OPTIONS_ABUSE=enabled
    - _APP_OPTIONS_FORCE_HTTPS=disabled
    - _APP_OPENSSL_KEY_V1=${APPWRITE_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=${MARIADB_USER}
    - _APP_DB_PASS=${MARIADB_PASSWORD}
    - _APP_INFLUXDB_HOST=influxdb
    - _APP_INFLUXDB_PORT=8086
    - _APP_STATSD_HOST=telegraf
    - _APP_STATSD_PORT=8125
  depends_on:
    - mariadb
    - redis
    - influxdb
  networks:
    - appwrite-network
mariadb
mariadb:
  image: mariadb:10.11
  container_name: appwrite-mariadb
  environment:
    - MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
    - MYSQL_DATABASE=appwrite
    - MYSQL_USER=${MARIADB_USER}
    - MYSQL_PASSWORD=${MARIADB_PASSWORD}
  volumes:
    - mariadb_data:/var/lib/mysql
  networks:
    - appwrite-network
redis
redis:
  image: redis:7-alpine
  container_name: appwrite-redis
  volumes:
    - redis_data:/data
  networks:
    - appwrite-network
influxdb
influxdb:
  image: influxdb:1.8
  container_name: appwrite-influxdb
  volumes:
    - influxdb_data:/var/lib/influxdb
  networks:
    - appwrite-network
telegraf
telegraf:
  image: appwrite/telegraf:1.4
  container_name: appwrite-telegraf
  networks:
    - appwrite-network

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 appwrite:
5 image: appwrite/appwrite:1.4
6 container_name: appwrite
7 volumes:
8 - appwrite_uploads:/storage/uploads
9 - appwrite_cache:/storage/cache
10 - appwrite_config:/storage/config
11 - appwrite_certs:/storage/certificates
12 - appwrite_functions:/storage/functions
13 ports:
14 - "80:80"
15 - "443:443"
16 environment:
17 - _APP_ENV=production
18 - _APP_LOCALE=en
19 - _APP_CONSOLE_WHITELIST_ROOT=enabled
20 - _APP_CONSOLE_WHITELIST_EMAILS=
21 - _APP_CONSOLE_WHITELIST_IPS=
22 - _APP_SYSTEM_EMAIL_NAME=Appwrite
23 - _APP_SYSTEM_EMAIL_ADDRESS=team@appwrite.io
24 - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS=security@appwrite.io
25 - _APP_OPTIONS_ABUSE=enabled
26 - _APP_OPTIONS_FORCE_HTTPS=disabled
27 - _APP_OPENSSL_KEY_V1=${APPWRITE_KEY}
28 - _APP_DOMAIN=localhost
29 - _APP_DOMAIN_TARGET=localhost
30 - _APP_REDIS_HOST=redis
31 - _APP_REDIS_PORT=6379
32 - _APP_DB_HOST=mariadb
33 - _APP_DB_PORT=3306
34 - _APP_DB_SCHEMA=appwrite
35 - _APP_DB_USER=${MARIADB_USER}
36 - _APP_DB_PASS=${MARIADB_PASSWORD}
37 - _APP_INFLUXDB_HOST=influxdb
38 - _APP_INFLUXDB_PORT=8086
39 - _APP_STATSD_HOST=telegraf
40 - _APP_STATSD_PORT=8125
41 depends_on:
42 - mariadb
43 - redis
44 - influxdb
45 networks:
46 - appwrite-network
47
48 mariadb:
49 image: mariadb:10.11
50 container_name: appwrite-mariadb
51 environment:
52 - MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
53 - MYSQL_DATABASE=appwrite
54 - MYSQL_USER=${MARIADB_USER}
55 - MYSQL_PASSWORD=${MARIADB_PASSWORD}
56 volumes:
57 - mariadb_data:/var/lib/mysql
58 networks:
59 - appwrite-network
60
61 redis:
62 image: redis:7-alpine
63 container_name: appwrite-redis
64 volumes:
65 - redis_data:/data
66 networks:
67 - appwrite-network
68
69 influxdb:
70 image: influxdb:1.8
71 container_name: appwrite-influxdb
72 volumes:
73 - influxdb_data:/var/lib/influxdb
74 networks:
75 - appwrite-network
76
77 telegraf:
78 image: appwrite/telegraf:1.4
79 container_name: appwrite-telegraf
80 networks:
81 - appwrite-network
82
83volumes:
84 appwrite_uploads:
85 appwrite_cache:
86 appwrite_config:
87 appwrite_certs:
88 appwrite_functions:
89 mariadb_data:
90 redis_data:
91 influxdb_data:
92
93networks:
94 appwrite-network:
95 driver: bridge
96EOF
97
98# 2. Create the .env file
99cat > .env << 'EOF'
100# Appwrite Backend
101APPWRITE_KEY=your-secret-key-min-128-bits
102MARIADB_ROOT_PASSWORD=rootpassword
103MARIADB_USER=appwrite
104MARIADB_PASSWORD=appwrite_password
105EOF
106
107# 3. Start the services
108docker compose up -d
109
110# 4. View logs
111docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/appwrite-stack/run | bash

Troubleshooting

  • Appwrite console shows 'Database connection failed': Verify MariaDB container is running and MARIADB_USER/MARIADB_PASSWORD environment variables match database credentials
  • Redis connection errors in Appwrite logs: Check Redis container health and ensure _APP_REDIS_HOST points to 'redis' service name in Docker network
  • InfluxDB metrics not appearing: Confirm _APP_INFLUXDB_HOST and _APP_STATSD_HOST environment variables are correctly set to container names
  • File upload failures with storage errors: Ensure appwrite_uploads volume has proper write permissions and sufficient disk space available
  • Appwrite functions not executing: Verify appwrite_functions volume is mounted and Docker daemon allows container-in-container execution
  • MariaDB startup fails with 'Lock wait timeout exceeded': Increase innodb_lock_wait_timeout or restart MariaDB container to clear locked transactions

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

Ad Space