Backend-as-a-Service Guide

    Self-Host Appwrite

    Appwrite is an open-source backend-as-a-service platform providing authentication, database, storage, and serverless functions. Deploy it on your RamNode VPS for complete control over your backend infrastructure.

    Ubuntu 22.04/24.04
    Full BaaS Platform
    ⏱️ 30-45 minutes

    What is Appwrite?

    Appwrite is an open-source, self-hosted backend-as-a-service platform that provides developers with a comprehensive set of APIs and tools to build modern applications.

    Core Features

    • Authentication - Email, OAuth, magic links, phone
    • Database - Document-based NoSQL with real-time
    • Storage - File storage with image manipulation
    • Functions - Serverless in multiple runtimes
    • Messaging - Email, SMS, push notifications
    • Realtime - WebSocket for live updates

    Why Self-Host?

    • • Complete control over your data
    • • Data sovereignty and compliance
    • • No vendor lock-in
    • • Customize to your needs
    • • Cost-effective for consistent workloads
    • • Integrate with existing infrastructure

    Prerequisites

    Before starting, ensure you have:

    RequirementSpecification
    RamNode VPSMinimum 2 vCPU, 4GB RAM, 40GB SSD (recommended: 4 vCPU, 8GB RAM)
    Operating SystemUbuntu 22.04 LTS or Ubuntu 24.04 LTS
    Domain NameA registered domain with DNS access (e.g., appwrite.yourdomain.com)
    SSH AccessRoot or sudo access to your VPS
    3

    Initial Server Setup

    Connect to Your VPS

    SSH into your server
    ssh root@your-server-ip

    Update System Packages

    Update and upgrade
    apt update && apt upgrade -y

    Create a Non-Root User

    Create dedicated user
    # Create new user
    adduser appwrite
    
    # Add to sudo group
    usermod -aG sudo appwrite
    
    # Switch to new user
    su - appwrite

    Configure Firewall

    Setup UFW firewall
    # Enable UFW
    sudo ufw enable
    
    # Allow SSH
    sudo ufw allow 22/tcp
    
    # Allow HTTP and HTTPS
    sudo ufw allow 80/tcp
    sudo ufw allow 443/tcp
    
    # Verify status
    sudo ufw status

    ⚠️ Important: Never close your SSH session before confirming UFW allows port 22, or you may lock yourself out of the server.

    4

    Install Docker

    Appwrite runs as a set of Docker containers. Install Docker Engine using the official repository:

    Install prerequisites
    sudo apt install -y ca-certificates curl gnupg lsb-release
    Add Docker GPG key
    sudo install -m 0755 -d /etc/apt/keyrings
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
    sudo chmod a+r /etc/apt/keyrings/docker.gpg
    Add Docker repository
    echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    Install Docker Engine
    sudo apt update
    sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    Configure Docker for non-root user
    # Add current user to docker group
    sudo usermod -aG docker $USER
    
    # Apply group changes (or log out and back in)
    newgrp docker
    
    # Verify installation
    docker --version
    docker compose version
    5

    Install Appwrite

    Create Installation Directory

    Create directory
    mkdir -p ~/appwrite
    cd ~/appwrite

    Download and Run Appwrite Installer

    Run Appwrite installer
    docker run -it --rm \
        --volume /var/run/docker.sock:/var/run/docker.sock \
        --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
        --entrypoint="install" \
        appwrite/appwrite:1.6

    💡 Note: Replace '1.6' with the latest stable version. Check the Appwrite GitHub releases page for the current version.

    Installation Prompts

    PromptRecommended Value
    HTTP Port80 (default)
    HTTPS Port443 (default)
    Hostnameappwrite.yourdomain.com
    DNS Challengedisabled (use HTTP challenge)
    6

    Configure DNS Records

    Point your domain to your RamNode VPS by creating DNS records with your domain registrar:

    TypeNameValue
    AappwriteYour VPS IP Address
    AAAAappwriteYour VPS IPv6 (if available)
    Verify DNS propagation
    dig +short appwrite.yourdomain.com
    7

    Start Appwrite Services

    Start all services
    cd ~/appwrite
    docker compose up -d
    Monitor startup
    # View all container statuses
    docker compose ps
    
    # View logs for all services
    docker compose logs -f
    
    # View logs for a specific service
    docker compose logs -f appwrite

    ✅ Wait for all containers to show a healthy status. This typically takes 2-5 minutes on first startup.

    8

    Initial Configuration

    Access the Console

    Open your browser and navigate to your Appwrite hostname (e.g., https://appwrite.yourdomain.com). You'll be presented with the initial setup wizard.

    Create Admin Account

    1. Enter your name, email address, and a strong password
    2. This account becomes the root administrator for your Appwrite instance
    3. Store these credentials securely - they cannot be recovered without database access

    Create Your First Project

    After logging in, create a new project. Each project provides:

    • Separate database collections and documents
    • Independent user authentication pools
    • Isolated file storage buckets
    • Unique API keys and endpoints

    Environment Variables

    Edit environment file
    nano ~/appwrite/.env
    VariableDescription
    _APP_ENVSet to 'production' for live deployments
    _APP_DOMAINYour Appwrite hostname
    _APP_OPENSSL_KEY_V1Encryption key - NEVER change after setup
    _APP_STORAGE_LIMITMaximum file upload size (default: 30MB)
    Restart after changes
    cd ~/appwrite
    docker compose down
    docker compose up -d
    9

    Configure SMTP for Email

    Appwrite requires SMTP configuration for sending verification emails, password resets, and notifications.

    Add to .env file
    _APP_SMTP_HOST=smtp.your-email-provider.com
    _APP_SMTP_PORT=587
    _APP_SMTP_SECURE=tls
    _APP_SMTP_USERNAME=your-smtp-username
    _APP_SMTP_PASSWORD=your-smtp-password

    💡 Tip: Popular SMTP providers include Mailgun, SendGrid, Amazon SES, and Postmark. Many offer free tiers suitable for development and small projects.

    10

    SSL & Security Hardening

    SSL/TLS Certificate

    Appwrite includes Traefik as a reverse proxy which automatically handles SSL certificate provisioning via Let's Encrypt.

    Verify SSL status
    # Check Traefik logs for certificate status
    docker compose logs traefik | grep -i certificate
    
    # Test HTTPS connection
    curl -I https://appwrite.yourdomain.com

    SSL certificates auto-renew before expiration. Ensure port 80 remains accessible for the HTTP-01 challenge validation.

    Disable Public Registration (Optional)

    In .env file
    _APP_CONSOLE_WHITELIST_ROOT=enabled

    Enable Rate Limiting

    In .env file
    _APP_OPTIONS_ABUSE=enabled

    Secure SSH Access

    Configure SSH
    # Edit SSH config
    sudo nano /etc/ssh/sshd_config
    
    # Set these values:
    # PasswordAuthentication no
    # PermitRootLogin no
    # PubkeyAuthentication yes
    
    # Restart SSH
    sudo systemctl restart sshd
    11

    Maintenance & Operations

    Backup Strategy

    backup-appwrite.sh
    #!/bin/bash
    # backup-appwrite.sh
    BACKUP_DIR="/backup/appwrite"
    DATE=$(date +%Y%m%d_%H%M%S)
    
    # Stop services for consistent backup
    cd ~/appwrite
    docker compose stop
    
    # Backup data volumes
    tar -czf "$BACKUP_DIR/appwrite-data-$DATE.tar.gz" \
        /var/lib/docker/volumes/appwrite_*
    
    # Backup configuration
    cp ~/appwrite/.env "$BACKUP_DIR/env-$DATE.bak"
    
    # Restart services
    docker compose start
    
    # Retain last 7 days of backups
    find "$BACKUP_DIR" -type f -mtime +7 -delete

    Upgrading Appwrite

    Upgrade process
    cd ~/appwrite
    
    # Pull latest images
    docker compose pull
    
    # Stop current services
    docker compose down
    
    # Start with new version
    docker compose up -d
    
    # Run any required migrations
    docker compose exec appwrite migrate

    Monitoring

    Monitor your instance
    # View real-time logs
    docker compose logs -f
    
    # Check resource usage
    docker stats
    
    # View container health
    docker compose ps
    12

    Troubleshooting

    IssueSolution
    Console not loadingVerify DNS propagation; check container health with docker compose ps
    SSL certificate errorsEnsure port 80 is open; check Traefik logs for ACME errors
    Database connection failedRestart MariaDB container: docker compose restart mariadb
    High memory usageConsider upgrading VPS; disable unused services in docker-compose.yml
    Emails not sendingVerify SMTP credentials; check appwrite-worker-mails logs

    Deployment Complete!

    You now have a fully functional, self-hosted Appwrite instance on your RamNode VPS with authentication, database, storage, and serverless functions ready to use.