10 Sentinels Active
SENTINEL 01: [AEGIS] AUDITING POCKETBASE INFRASTRUCTURE...
Back to Self-Hosted Stacks
AFFiNE

Deploy AFFiNE

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

Quick Start

1

Create a directory

mkdir affine-self-hosted && cd affine-self-hosted
2

Create config file

Copy the content from the Config tab below into a file named docker-compose.yml

3

Deploy

docker compose up -d
Fast Track

Deploy AFFiNE in Minutes

Use our optimized Docker templates to deploy AFFiNE on any cloud provider. Get $200 in free credit to start on DigitalOcean.

Start with free creditDeploy on DigitalOcean
$200

Metadata

License
Other
Language
TypeScript
Last Updated
10/12/2026
Category
Productivity

Configuration

yaml

# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# 🚀 BUILT & MAINTAINED BY THE ALTSTACK
# 🌍 https://thealtstack.com
# 💡 Open-source deployment templates for modern self-hosting.
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

# Docker Compose for AFFiNE
version: '3.8'

services:
  affine:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: affine-pro
    ports:
      - "3000:3000"
    depends_on:
      affine_postgres:
        condition: service_healthy
      affine_redis:
        condition: service_healthy
    environment:
      - DATABASE_URL=postgres://affine:affine@affine_postgres:5432/affine
      - REDIS_URL=redis://affine_redis:6379
      - NODE_ENV=production
    volumes:
      - affine_storage:/app/.affine/storage
      - affine_config:/app/.affine/config
    networks:
      - affine_net
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
      interval: 30s
      timeout: 10s
      retries: 3

  affine_postgres:
    image: postgres:15-alpine
    container_name: affine-postgres
    environment:
      - POSTGRES_USER=affine
      - POSTGRES_PASSWORD=affine
      - POSTGRES_DB=affine
    volumes:
      - affine_pg_data:/var/lib/postgresql/data
    networks:
      - affine_net
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U affine"]
      interval: 5s
      timeout: 5s
      retries: 5

  affine_redis:
    image: redis:7-alpine
    container_name: affine-redis
    volumes:
      - affine_redis_data:/data
    networks:
      - affine_net
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 5s
      retries: 5

networks:
  affine_net:
    driver: bridge

volumes:
  affine_pg_data:
  affine_redis_data:
  affine_storage:
  affine_config:

Community Notes

Help others by adding context, corrections, or warnings about this tool. Sign in to contribute.

No community notes yet. Be the first to add context.