docker.recipes

AFFiNE

beginner

Next-gen knowledge base combining docs, whiteboards, and databases.

Overview

AFFiNE represents a revolutionary approach to knowledge management, developed as an open-source alternative to Notion that combines document editing, whiteboard collaboration, and database management into a unified workspace. Built with a local-first architecture, AFFiNE ensures your data remains under your control while providing real-time collaboration features through its GraphQL-powered backend. The platform emerged from the need for a privacy-focused, self-hostable solution that doesn't compromise on modern productivity features like block-based editing, infinite canvas whiteboards, and relational databases. This Docker deployment utilizes the official AFFiNE GraphQL server image, which handles all backend operations including data synchronization, user authentication, and workspace management. The containerized setup provides a production-grade environment with persistent storage for your knowledge base, ensuring data integrity across container restarts and updates. AFFiNE excels for teams and individuals who prioritize data sovereignty while requiring sophisticated collaboration tools. Organizations moving away from cloud-dependent solutions will find this stack particularly valuable, as it delivers enterprise-level functionality with complete control over data residency and access policies.

Key Features

  • Block-based document editor with rich formatting, embeds, and collaborative editing capabilities
  • Infinite canvas whiteboard for visual brainstorming, mind mapping, and diagram creation
  • Integrated database views with customizable properties, filters, and sorting options
  • Local-first architecture ensuring data availability and performance without constant internet connectivity
  • Real-time collaboration through WebSocket connections managed by the GraphQL server
  • Workspace-based organization allowing multiple isolated knowledge bases per instance
  • Import functionality for Notion databases and Markdown files with format preservation
  • Plugin architecture supporting custom blocks and workflow integrations

Common Use Cases

  • 1Personal knowledge management system replacing cloud-based note-taking applications
  • 2Team documentation hub for software development projects with technical specifications and diagrams
  • 3Research organizations managing literature reviews, data analysis, and collaborative writing
  • 4Educational institutions providing students with self-hosted collaborative workspaces
  • 5Consulting firms organizing client projects with mixed document, visual, and database content
  • 6Privacy-conscious organizations requiring complete data control for sensitive information
  • 7Remote teams conducting visual brainstorming sessions with persistent whiteboard collaboration

Prerequisites

  • Docker Engine 20.10+ and Docker Compose V2 for container orchestration
  • Minimum 2GB RAM allocated to Docker for optimal AFFiNE GraphQL server performance
  • Port 3010 available on the host system for web interface access
  • At least 5GB free disk space for application data and workspace storage
  • Modern web browser with JavaScript enabled for accessing the AFFiNE interface
  • Basic understanding of workspace concepts and block-based editing paradigms

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 affine:
3 image: ghcr.io/toeverything/affine-graphql:stable
4 container_name: affine
5 restart: unless-stopped
6 environment:
7 NODE_ENV: production
8 AFFINE_SERVER_HOST: 0.0.0.0
9 volumes:
10 - affine_data:/root/.affine
11 ports:
12 - "3010:3010"
13
14volumes:
15 affine_data:

.env Template

.env
1# Self-hosted AFFiNE

Usage Notes

  1. 1Access at http://localhost:3010
  2. 2Notion alternative
  3. 3Local-first approach

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 affine:
5 image: ghcr.io/toeverything/affine-graphql:stable
6 container_name: affine
7 restart: unless-stopped
8 environment:
9 NODE_ENV: production
10 AFFINE_SERVER_HOST: 0.0.0.0
11 volumes:
12 - affine_data:/root/.affine
13 ports:
14 - "3010:3010"
15
16volumes:
17 affine_data:
18EOF
19
20# 2. Create the .env file
21cat > .env << 'EOF'
22# Self-hosted AFFiNE
23EOF
24
25# 3. Start the services
26docker compose up -d
27
28# 4. View logs
29docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/affine/run | bash

Troubleshooting

  • Container exits with 'EADDRINUSE' error: Another service is using port 3010, modify the port mapping to use an available port like 3011:3010
  • AFFiNE interface loads but workspaces won't save: Check that affine_data volume has proper write permissions and sufficient disk space available
  • GraphQL server fails to start with memory errors: Increase Docker's memory allocation to at least 2GB in Docker Desktop settings
  • Whiteboard features not loading properly: Clear browser cache and ensure WebSocket connections aren't blocked by firewall or proxy
  • Import from Notion fails with timeout: Break large Notion exports into smaller chunks and import incrementally
  • Collaboration features not working between users: Verify all users are accessing the same AFFiNE instance URL and check server logs for authentication errors

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space