CRM, Support & Productivity2 GB RAM (Pro recommended)· Port 3010

Deploy AFFiNE Workspace (Notion + Miro) with Docker Compose

Privacy-first, local-first knowledge base combining Notion docs and infinite whiteboard canvases.

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:
  affine:
    image: ghcr.io/toeverything/affine-graphql:stable
    restart: unless-stopped
    ports:
      - "3010:3010"
    environment:
      - DATABASE_URL=${DATABASE_URL:-postgresql://affine:secret@postgres:5432/affine}
      - REDIS_SERVER_HOST=${REDIS_SERVER_HOST:-redis}
      - AFFINE_SERVER_HOST=${AFFINE_SERVER_HOST:-docs.yourdomain.com}
    volumes:
      - app_data:/root/.affine/storage
    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=affine
    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
DATABASE_URLpostgresql://affine:secret@postgres:5432/affinePostgreSQL connection string for workspace metadata.
REDIS_SERVER_HOSTredisRedis hostname for real-time collaborative sync.
AFFINE_SERVER_HOSTdocs.yourdomain.comPublic hostname for workspace links.

AFFiNE Workspace (Notion + Miro) Self-Hosting FAQs

How much RAM is required to self-host AFFiNE Workspace (Notion + Miro) in production?

AFFiNE Workspace (Notion + Miro) requires a minimum of 2 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 AFFiNE Workspace (Notion + Miro) with automatic HTTPS/SSL on Vexlo Cloud?

Deploy the ghcr.io/toeverything/affine-graphql:stable container on Vexlo Cloud, set the exposed port to 3010, 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 AFFiNE Workspace (Notion + Miro)?

Mount /root/.affine/storage 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 →