# AppFlowy Notion Alternative

> AppFlowy open-source Notion alternative.

- Category: Productivity & Collaboration
- Difficulty: intermediate
- Components: appflowy-cloud, postgresql, redis, minio
- Tags: appflowy, notion, notes, wiki
- Source: https://docker.recipes/productivity/appflowy-stack

## Overview

AppFlowy is an open-source alternative to Notion that provides a privacy-focused, self-hosted workspace for notes, documents, and project management. Originally developed as a desktop application, AppFlowy Cloud extends the platform with server-side synchronization capabilities, allowing teams to collaborate on documents while maintaining full control over their data. The platform combines the familiar block-based editing experience of Notion with the security and customization benefits of self-hosting.

This deployment creates a complete AppFlowy Cloud infrastructure using four containerized services: the main AppFlowy Cloud application server, a PostgreSQL database for structured data storage, Redis for caching and real-time features, and MinIO for S3-compatible object storage. The AppFlowy Cloud service handles user authentication, document synchronization, and API endpoints, while PostgreSQL stores user data and document metadata with ACID compliance. Redis provides sub-millisecond response times for session management and real-time collaboration features, and MinIO offers high-performance object storage for file attachments and media assets.

This stack is ideal for teams and organizations seeking a self-hosted Notion alternative with enterprise-grade data control. The combination provides the scalability needed for growing teams while ensuring data sovereignty and customization flexibility that cloud-hosted solutions cannot offer.

## Features

- Self-hosted Notion-like workspace with block-based document editing and real-time collaboration
- PostgreSQL backend with ACID compliance ensuring data integrity for collaborative document editing
- Redis-powered real-time synchronization enabling instant updates across multiple AppFlowy clients
- S3-compatible object storage via MinIO for secure file attachments and media management
- Multi-user authentication and workspace management with granular permission controls
- Cross-platform synchronization supporting AppFlowy desktop, web, and mobile applications
- Privacy-focused architecture keeping all data within your infrastructure boundaries
- RESTful API endpoints for custom integrations and third-party application connectivity

## Use cases

- Teams migrating from Notion who need data sovereignty and privacy compliance
- Software development teams requiring technical documentation with code snippet support
- Educational institutions managing course materials and student collaboration spaces
- Consulting firms organizing client projects with secure document sharing capabilities
- Startups building knowledge bases while maintaining control over intellectual property
- Remote teams needing collaborative workspaces without relying on external cloud services
- Organizations in regulated industries requiring on-premises document management solutions

## Prerequisites

- Docker and Docker Compose installed with at least 3GB available RAM for optimal performance
- Port 8080 available for AppFlowy Cloud web interface access
- Environment variables configured: DB_USER, DB_PASSWORD, MINIO_USER, MINIO_PASSWORD
- Understanding of AppFlowy desktop application setup for client-server synchronization
- Basic knowledge of PostgreSQL and Redis for performance tuning and maintenance
- Sufficient storage space for PostgreSQL data and MinIO object storage volumes

## docker-compose.yml

```yaml
services:
  appflowy-cloud:
    image: appflowy/appflowy-cloud:latest
    container_name: appflowy-cloud
    restart: unless-stopped
    ports:
      - "${AF_PORT:-8080}:8080"
    environment:
      - APPFLOWY_DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@appflowy-db/appflowy
      - APPFLOWY_REDIS_URL=redis://appflowy-redis:6379
      - APPFLOWY_S3_URL=http://appflowy-minio:9000
    depends_on:
      - appflowy-db
      - appflowy-redis
      - appflowy-minio

  appflowy-db:
    image: postgres:15-alpine
    container_name: appflowy-db
    restart: unless-stopped
    environment:
      - POSTGRES_USER=${DB_USER}
      - POSTGRES_PASSWORD=${DB_PASSWORD}
      - POSTGRES_DB=appflowy
    volumes:
      - appflowy_db_data:/var/lib/postgresql/data

  appflowy-redis:
    image: redis:7-alpine
    container_name: appflowy-redis
    restart: unless-stopped

  appflowy-minio:
    image: minio/minio:latest
    container_name: appflowy-minio
    restart: unless-stopped
    environment:
      - MINIO_ROOT_USER=${MINIO_USER}
      - MINIO_ROOT_PASSWORD=${MINIO_PASSWORD}
    volumes:
      - minio_data:/data
    command: server /data

volumes:
  appflowy_db_data:
  minio_data:
```

## .env

```bash
# AppFlowy
AF_PORT=8080
DB_USER=appflowy
DB_PASSWORD=appflowy_password
MINIO_USER=minioadmin
MINIO_PASSWORD=minioadmin
```

## Usage notes

- AppFlowy Cloud at http://localhost:8080
- Use with AppFlowy desktop app
- Self-hosted sync server
- Notion-like experience

## Troubleshooting

- AppFlowy client connection failed: Verify AF_PORT environment variable matches client configuration and port 8080 is accessible
- PostgreSQL connection errors in appflowy-cloud logs: Check DB_USER and DB_PASSWORD environment variables match between appflowy-cloud and appflowy-db services
- Redis connection timeout errors: Ensure appflowy-redis container is running and accessible on default port 6379 within Docker network
- File upload failures: Verify MINIO_USER and MINIO_PASSWORD are set correctly and appflowy-minio service is responding on port 9000
- Slow document synchronization: Monitor Redis memory usage and consider increasing Redis memory limits for better caching performance
- AppFlowy Cloud startup failures: Check Docker logs for database migration errors and ensure PostgreSQL is fully initialized before AppFlowy Cloud starts

