Skip to content

Deployment Overview of Appwrite on Server

Prerequisites and Basic Requirements

To successfully deploy Appwrite, the server must meet the following requirements:

  • Operating System: Ubuntu or Debian.

  • Privileges: Root or sudo access is required for package installation and Docker configuration.

  • Docker: The docker-compose-plugin must be installed.

  • Ports:

  • Port 80: Used for HTTP traffic and Let's Encrypt certificate challenges.

  • Port 443: Used for secure HTTPS traffic.

FQDN of the final panel on the hostkey.in domain

The application is accessible via a specific subdomain template based on the server ID.

| Parameter | Value | | Prefix | appwrite | | Domain | hostkey.in | | Full template | appwrite{Server_ID_from_Invapi}.hostkey.in |

File and Directory Structure

The application uses several directories for configuration, data persistence, and SSL certificates:

  • /opt/appwrite: Main installation directory containing the Docker Compose files and environment variables.

  • /data/nginx: Contains Nginx and Certbot configurations.

  • /data/nginx/user_conf.d: Directory for custom Nginx virtual host configurations.

  • /data/nginx/nginx-certbot.env: Environment file for the SSL proxy container.

Application installation process

The application is deployed using a combination of package management and Docker Compose:

  1. System Preparation: The docker-compose-plugin is installed via the system package manager (apt).

  2. Directory Setup: A dedicated directory /opt/appwrite is created with permissions set to 0755.

  3. Configuration Deployment:

  4. A docker-compose.yml file is generated in /opt/appwrite/.

  5. An environment configuration file .env is generated in /opt/appwrite/ with strict permissions (0600).

  6. Container Orchestration: The application is started using the command:

    docker compose up -d --remove-orphans
    

Access Rights and Security

  • Firewall: Ensure ports 80 and 443 are open to allow web traffic and SSL certificate validation.

  • Permissions: Configuration files in /opt/appwrite/.env are restricted to the owner to protect sensitive credentials.

  • Network Isolation: Application containers communicate over a dedicated Docker network named appwrite.

Databases

Appwrite utilizes two primary database systems for its operations:

Database Type Storage Location (Volume)
MongoDB NoSQL Primary data storage and user information appwrite-mongodb
Redis In-memory Caching, session management, and queues appwrite-redis

Docker Containers and Their Deployment

The deployment consists of several containers managed via Docker Compose.

Proxy and SSL

  • nginx-certbot

  • Image: jonasal/nginx-certbot:latest

  • Ports: Host network mode (uses host ports)

  • Volumes:

  • nginx_secrets:/etc/letsencrypt

  • /data/nginx/user_conf.d:/etc/nginx/user_conf.d

  • Purpose: Handles SSL certificate acquisition and proxying.

Core Application Services

  • appwrite

  • Image: appwrite/appwrite:1.9.0

  • Volumes:

  • appwrite-uploads:/storage/uploads

  • appwrite-imports:/storage/imports

  • appwrite-cache:/storage/cache

  • appwrite-config:/storage/config

  • appwrite-certificates:/storage/certificates

  • appwrite-functions:/storage/functions

  • appwrite-sites:/storage/sites

  • appwrite-builds:/storage/builds

  • Restart Policy: unless-stopped

  • appwrite-console

  • Image: appwrite/appwrite:7.8.26 (Console specific)

  • Purpose: Provides the administrative web interface via /console.

  • appwrite-realtime

  • Image: appwrite/appwrite:1.9.0

  • Entrypoint: realtime

  • Purpose: Handles real-time WebSocket connections.

Workers and Tasks

The application uses several worker containers to process background tasks:

  • appwrite-worker-audits: Processes audit logs.

  • appwrite-worker-webhooks: Manages webhook triggers.

  • appwrite-worker-deletes: Handles data deletion processes.

  • appwrite-worker-databases: Manages database operations.

  • appwrite-worker-functions: Executes serverless functions.

  • appwrite-worker-mails: Processes outgoing emails.

  • appwrite-task-maintenance: Runs scheduled maintenance tasks.

Infrastructure and Support Services

  • traefik

  • Image: traefik:3.6

  • Ports: 127.0.0.1:8080:80 (Internal management)

  • Volumes:

  • /var/run/docker.sock:/var/run/docker.sock

  • appwrite-config:/storage/config:ro

  • appwrite-certificates:/storage/certificates:ro

  • Purpose: Edge router and load balancer for the Appwrite stack.

  • openruntimes-executor

  • Image: openruntimes/executor:0.7.22

  • Volumes:

  • /var/run/docker.sock:/var/run/docker.sock

  • appwrite-builds:/storage/builds

  • appwrite-functions:/storage/functions

  • /tmp:/tmp

  • Purpose: Executes serverless functions in isolated environments.

  • mariadb (Used in older versions or specific configurations)

  • Image: mariadb:10.11

  • Volumes: appwrite-mariadb:/var/lib/mysql

  • mongodb

  • Image: mongo:8.2.5

  • Volumes:

  • appwrite-mongodb:/data/db

  • appwrite-mongodb-keyfile:/data/keyfile

  • Purpose: Primary database for modern Appwrite versions.

  • redis

  • Image: redis:7.4.7-alpine

  • Volumes: appwrite-redis:/data

  • Purpose: High-performance caching and messaging.

Application Update Instructions

To update the main application, navigate to the installation directory and run the following commands:

cd /opt/appwrite
docker compose pull
docker compose up -d

Location of configuration files and data

Component Path / Volume Name
Docker Compose File /opt/appwrite/docker-compose.yml
Environment Variables /opt/appwrite/.env
Nginx User Configs /data/nginx/user_conf.d
MongoDB Data appwrite-mongodb (Docker Volume)
Redis Data appwrite-redis (Docker Volume)

Available ports for connection

  • HTTPS: 443 (via Traefik/Nginx proxy)

  • HTTP: 80 (for redirects and challenges)

  • Traefik Management: 8080 (Localhost only)

Starting and Stopping the application

The application is managed using Docker Compose from the /opt/appwrite directory.

To start the application:

docker compose up -d

To stop the application:

docker compose down

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×