BaaS & Databases1 GB RAM (Pro recommended)· Port 8055

Deploy Directus Headless Data Platform with Docker Compose

Instant REST + GraphQL API and no-code data studio wrapped around any SQL database.

1. Production docker-compose.yml Configuration

Copy this stack definition or deploy directly from your Vexlo Cloud console with automatic Let's Encrypt TLS and persistent volume mounts.

docker-compose.yml
yaml
services:
  directus:
    image: directus/directus:11
    restart: unless-stopped
    ports:
      - "8055:8055"
    environment:
      - KEY=${KEY:-directus-project-unique-key}
      - SECRET=${SECRET:-32-char-random-signing-secret}
      - ADMIN_EMAIL=${ADMIN_EMAIL:[email protected]}
      - ADMIN_PASSWORD=${ADMIN_PASSWORD:-change-me-immediately}
    volumes:
      - app_data:/directus/uploads
    depends_on:
      - postgres
      - redis

  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-change-me-db-password}
      - POSTGRES_DB=directus
    volumes:
      - postgres_data:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine
    restart: unless-stopped
    command: redis-server --maxmemory 256mb --maxmemory-policy allkeys-lru
    volumes:
      - redis_data:/data

volumes:
  app_data:
  postgres_data:
  redis_data:

2. Required Environment Variables

VariableDefault / ExampleDescription
KEYdirectus-project-unique-keyUnique identifier key for this Directus instance.
SECRET32-char-random-signing-secretSecret string used for token signing.
ADMIN_EMAIL[email protected]Initial administrator login email.
ADMIN_PASSWORDchange-me-immediatelyInitial administrator password.

Directus Headless Data Platform Self-Hosting FAQs

How much RAM is required to self-host Directus Headless Data Platform in production?

Directus Headless Data Platform requires a minimum of 1 GB RAM (Pro recommended). On Vexlo Cloud Pro (₹149/mo via UPI in India or $5/mo globally), you get 2 vCPU, 3 GB RAM, and 2 managed databases—more than enough headroom for production workloads.

How do I expose Directus Headless Data Platform with automatic HTTPS/SSL on Vexlo Cloud?

Deploy the directus/directus:11 container on Vexlo Cloud, set the exposed port to 8055, and attach your custom domain in the Domains tab. Vexlo automatically provisions and renews Let's Encrypt TLS certificates.

How is persistent data backed up for Directus Headless Data Platform?

Mount /directus/uploads to a persistent Docker volume and connect Vexlo Cloud's automated S3 / Cloudflare R2 backup scheduler to snapshot your database daily or weekly.

More 1-Click Docker Templates

View all 25 templates →