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:
| Requirement | Specification |
|---|---|
| RamNode VPS | Minimum 2 vCPU, 4GB RAM, 40GB SSD (recommended: 4 vCPU, 8GB RAM) |
| Operating System | Ubuntu 22.04 LTS or Ubuntu 24.04 LTS |
| Domain Name | A registered domain with DNS access (e.g., appwrite.yourdomain.com) |
| SSH Access | Root or sudo access to your VPS |
Initial Server Setup
Connect to Your VPS
ssh root@your-server-ipUpdate System Packages
apt update && apt upgrade -yCreate a Non-Root User
# Create new user
adduser appwrite
# Add to sudo group
usermod -aG sudo appwrite
# Switch to new user
su - appwriteConfigure 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.
Install Docker
Appwrite runs as a set of Docker containers. Install Docker Engine using the official repository:
sudo apt install -y ca-certificates curl gnupg lsb-releasesudo 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.gpgecho "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/nullsudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin# 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 versionInstall Appwrite
Create Installation Directory
mkdir -p ~/appwrite
cd ~/appwriteDownload and 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
| Prompt | Recommended Value |
|---|---|
| HTTP Port | 80 (default) |
| HTTPS Port | 443 (default) |
| Hostname | appwrite.yourdomain.com |
| DNS Challenge | disabled (use HTTP challenge) |
Configure DNS Records
Point your domain to your RamNode VPS by creating DNS records with your domain registrar:
| Type | Name | Value |
|---|---|---|
| A | appwrite | Your VPS IP Address |
| AAAA | appwrite | Your VPS IPv6 (if available) |
dig +short appwrite.yourdomain.comStart Appwrite Services
cd ~/appwrite
docker compose up -d# 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.
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
- Enter your name, email address, and a strong password
- This account becomes the root administrator for your Appwrite instance
- 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
nano ~/appwrite/.env| Variable | Description |
|---|---|
| _APP_ENV | Set to 'production' for live deployments |
| _APP_DOMAIN | Your Appwrite hostname |
| _APP_OPENSSL_KEY_V1 | Encryption key - NEVER change after setup |
| _APP_STORAGE_LIMIT | Maximum file upload size (default: 30MB) |
cd ~/appwrite
docker compose down
docker compose up -dConfigure SMTP for Email
Appwrite requires SMTP configuration for sending verification emails, password resets, and notifications.
_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.
SSL & Security Hardening
SSL/TLS Certificate
Appwrite includes Traefik as a reverse proxy which automatically handles SSL certificate provisioning via Let's Encrypt.
# Check Traefik logs for certificate status
docker compose logs traefik | grep -i certificate
# Test HTTPS connection
curl -I https://appwrite.yourdomain.comSSL certificates auto-renew before expiration. Ensure port 80 remains accessible for the HTTP-01 challenge validation.
Disable Public Registration (Optional)
_APP_CONSOLE_WHITELIST_ROOT=enabledEnable Rate Limiting
_APP_OPTIONS_ABUSE=enabledSecure SSH Access
# Edit SSH config
sudo nano /etc/ssh/sshd_config
# Set these values:
# PasswordAuthentication no
# PermitRootLogin no
# PubkeyAuthentication yes
# Restart SSH
sudo systemctl restart sshdMaintenance & Operations
Backup Strategy
#!/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 -deleteUpgrading Appwrite
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 migrateMonitoring
# View real-time logs
docker compose logs -f
# Check resource usage
docker stats
# View container health
docker compose psTroubleshooting
| Issue | Solution |
|---|---|
| Console not loading | Verify DNS propagation; check container health with docker compose ps |
| SSL certificate errors | Ensure port 80 is open; check Traefik logs for ACME errors |
| Database connection failed | Restart MariaDB container: docker compose restart mariadb |
| High memory usage | Consider upgrading VPS; disable unused services in docker-compose.yml |
| Emails not sending | Verify 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.
