DOKPLOY-GUIDE 10 min read fordnox

Deploy Appwrite with Dokploy: Docker Compose Setup Guide

Step-by-step guide to deploying Appwrite backend-as-a-service on your VPS using Dokploy and Docker Compose. Includes MariaDB, Redis, workers, and SSL configuration.


Deploy Appwrite with Dokploy

Dokploy is an open-source server management platform that simplifies deploying Docker Compose applications on your VPS. It handles reverse proxy configuration, SSL certificates, and deployment management — which is valuable for running Appwrite's multi-service backend platform.

This guide walks you through deploying Appwrite with MariaDB, Redis, and core worker services. Appwrite is a comprehensive backend-as-a-service platform providing authentication, databases, storage, functions, and messaging APIs.

Prerequisites

Docker Compose Configuration

Create a new Compose project in Dokploy and paste the following configuration:

version: "3.8"

services:
  appwrite:
    image: appwrite/appwrite:latest
    restart: unless-stopped
    ports:
      - "8080:80"
    environment:
      - _APP_ENV=production
      - _APP_LOCALE=en
      - _APP_DOMAIN=${APPWRITE_DOMAIN}
      - _APP_DOMAIN_TARGET=${APPWRITE_DOMAIN}
      - _APP_OPENSSL_KEY_V1=${APPWRITE_OPENSSL_KEY}
      - _APP_DB_HOST=appwrite-db
      - _APP_DB_PORT=3306
      - _APP_DB_SCHEMA=appwrite
      - _APP_DB_USER=appwrite
      - _APP_DB_PASS=${APPWRITE_DB_PASSWORD}
      - _APP_REDIS_HOST=appwrite-redis
      - _APP_REDIS_PORT=6379
      - _APP_STORAGE_DEVICE=local
      - _APP_STORAGE_LIMIT=30000000
      - _APP_FUNCTIONS_SIZE_LIMIT=30000000
      - _APP_SYSTEM_SECURITY_EMAIL_ADDRESS=${APPWRITE_ADMIN_EMAIL}
    volumes:
      - ../files/appwrite-uploads:/storage/uploads
      - ../files/appwrite-cache:/storage/cache
      - ../files/appwrite-certificates:/storage/certificates
      - ../files/appwrite-functions:/storage/functions
    depends_on:
      appwrite-db:
        condition: service_healthy
      appwrite-redis:
        condition: service_healthy
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost/v1/health || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 5

  appwrite-realtime:
    image: appwrite/appwrite:latest
    restart: unless-stopped
    entrypoint: realtime
    environment:
      - _APP_ENV=production
      - _APP_DB_HOST=appwrite-db
      - _APP_DB_PORT=3306
      - _APP_DB_SCHEMA=appwrite
      - _APP_DB_USER=appwrite
      - _APP_DB_PASS=${APPWRITE_DB_PASSWORD}
      - _APP_REDIS_HOST=appwrite-redis
      - _APP_REDIS_PORT=6379
      - _APP_OPENSSL_KEY_V1=${APPWRITE_OPENSSL_KEY}
    depends_on:
      appwrite-db:
        condition: service_healthy
      appwrite-redis:
        condition: service_healthy

  appwrite-worker-databases:
    image: appwrite/appwrite:latest
    restart: unless-stopped
    entrypoint: worker-databases
    environment:
      - _APP_ENV=production
      - _APP_DB_HOST=appwrite-db
      - _APP_DB_PORT=3306
      - _APP_DB_SCHEMA=appwrite
      - _APP_DB_USER=appwrite
      - _APP_DB_PASS=${APPWRITE_DB_PASSWORD}
      - _APP_REDIS_HOST=appwrite-redis
      - _APP_REDIS_PORT=6379
      - _APP_OPENSSL_KEY_V1=${APPWRITE_OPENSSL_KEY}
    depends_on:
      appwrite-db:
        condition: service_healthy
      appwrite-redis:
        condition: service_healthy

  appwrite-worker-deletes:
    image: appwrite/appwrite:latest
    restart: unless-stopped
    entrypoint: worker-deletes
    environment:
      - _APP_ENV=production
      - _APP_DB_HOST=appwrite-db
      - _APP_DB_PORT=3306
      - _APP_DB_SCHEMA=appwrite
      - _APP_DB_USER=appwrite
      - _APP_DB_PASS=${APPWRITE_DB_PASSWORD}
      - _APP_REDIS_HOST=appwrite-redis
      - _APP_REDIS_PORT=6379
      - _APP_OPENSSL_KEY_V1=${APPWRITE_OPENSSL_KEY}
    volumes:
      - ../files/appwrite-uploads:/storage/uploads
      - ../files/appwrite-cache:/storage/cache
      - ../files/appwrite-functions:/storage/functions
    depends_on:
      appwrite-db:
        condition: service_healthy
      appwrite-redis:
        condition: service_healthy

  appwrite-db:
    image: mariadb:10.11
    restart: unless-stopped
    environment:
      - MYSQL_ROOT_PASSWORD=${APPWRITE_DB_ROOT_PASSWORD}
      - MYSQL_DATABASE=appwrite
      - MYSQL_USER=appwrite
      - MYSQL_PASSWORD=${APPWRITE_DB_PASSWORD}
    command: >
      --innodb-flush-method=fsync
      --innodb-use-native-aio=0
    volumes:
      - ../files/appwrite-db-data:/var/lib/mysql
    healthcheck:
      test: ["CMD-SHELL", "mysqladmin ping -h localhost -u root -p${APPWRITE_DB_ROOT_PASSWORD}"]
      interval: 10s
      timeout: 5s
      retries: 5

  appwrite-redis:
    image: redis:7-alpine
    restart: unless-stopped
    volumes:
      - ../files/appwrite-redis-data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

Note: This is a simplified Appwrite deployment with core services. The full Appwrite stack includes additional workers (mails, builds, audits, messaging, functions) which can be added using the same pattern — each worker uses the appwrite/appwrite image with a different entrypoint. See the Appwrite self-hosting docs for the complete compose file.

Environment Variables

Set these in Dokploy's Environment tab for your compose project:

Variable Purpose Example
APPWRITE_DOMAIN Your Appwrite domain appwrite.yourdomain.com
APPWRITE_DB_PASSWORD MariaDB password for Appwrite user a-strong-random-password
APPWRITE_DB_ROOT_PASSWORD MariaDB root password another-strong-password
APPWRITE_OPENSSL_KEY Encryption key for secrets (32+ chars) a-long-random-encryption-key
APPWRITE_ADMIN_EMAIL System admin email address admin@yourdomain.com

In Dokploy, environment variables are set via the Environment editor in the project settings. Do not create a .env file manually — Dokploy manages this for you. The OpenSSL key is used for encrypting sensitive data — keep it safe and consistent across redeployments.

Volumes & Data Persistence

This setup uses Dokploy's ../files convention for bind-mounted volumes:

The ../files path is relative to the compose file inside Dokploy's project directory. This ensures your data persists across redeployments. Avoid using absolute paths because Dokploy may clean them during redeployment.

Domain & SSL Setup

  1. In your Dokploy project, navigate to the Domains tab
  2. Click Add Domain and enter your domain (e.g., appwrite.yourdomain.com)
  3. Set the container port to 80 (Appwrite's internal HTTP port)
  4. Enable HTTPS — Dokploy automatically provisions a Let's Encrypt SSL certificate
  5. Save and wait for the certificate to be issued (usually under a minute)

Dokploy's built-in Traefik reverse proxy handles TLS termination and routes traffic to the Appwrite container.

Verifying the Deployment

  1. In Dokploy, go to your project's Deployments tab and click Deploy
  2. Watch the build logs — all services should start (database and Redis first, then Appwrite and workers)
  3. Check the Logs tab for the appwrite service. Look for the health endpoint responding
  4. Open https://appwrite.yourdomain.com in your browser — you should see the Appwrite console
  5. Create your admin account on first access
  6. Create a test project and verify the database, authentication, and storage APIs work

Troubleshooting

Appwrite container keeps restarting Check that MariaDB and Redis are healthy before Appwrite starts. Verify that _APP_DB_PASS and MYSQL_PASSWORD match between services. Review appwrite service logs for specific connection or migration errors.

Workers not processing tasks Each worker service needs the same database and Redis connection settings as the main Appwrite service. Ensure all _APP_DB_* and _APP_REDIS_* variables are consistent. Check worker logs for connection errors.

File uploads failing Verify the upload volume is correctly mapped and the _APP_STORAGE_LIMIT is set high enough for your use case. The default is 30 MB. The upload directories must be writable by the container.

Realtime events not working The realtime service communicates via Redis pub/sub. Ensure appwrite-redis is running and healthy. WebSocket connections must be supported by the reverse proxy — Dokploy's Traefik handles this by default.

SSL certificate not issuing Ensure your domain's DNS A record points to your server's IP and has propagated. Dokploy uses Let's Encrypt HTTP-01 challenges, so port 80 must be accessible. Check Traefik logs in Dokploy for certificate-related errors.


Learn more about Appwrite in our complete overview.

Need a VPS? Hostinger VPS starts at $4.99/mo — perfect for running Appwrite.


For more on Docker Compose deployments in Dokploy, see the Dokploy Docker Compose documentation.

App data sourced from selfh.st open-source directory.

~/self-hosted-app/appwrite/dokploy/get-started

Ready to get started?

Get the best VPS hosting deal today. Hostinger offers 4GB RAM VPS starting at just $4.99/mo.

Get Hostinger VPS — $4.99/mo

// up to 75% off + free domain included

// related topics

appwrite dokploy docker compose self-hosted backend as a service appwrite deployment

fordnox

Expert VPS reviews and hosting guides. We test every provider we recommend.

// last updated: February 12, 2026. Disclosure: This article may contain affiliate links.