Self-Hosting AFFiNE
AFFiNE can be self-hosted on your own infrastructure, giving you complete control over your data, privacy, and deployment environment. This guide will help you understand the architecture and get started with your own AFFiNE instance.Architecture
AFFiNE’s self-hosted deployment consists of several components working together:Application Server
The main Node.js application server handling API requests, WebSocket connections, and serving the web interface.
PostgreSQL Database
PostgreSQL with pgvector extension for storing user data, workspaces, and vector embeddings for search.
System Requirements
Minimum Requirements
- CPU: 2 cores
- RAM: 4 GB
- Storage: 20 GB (plus space for user data)
- OS: Linux (Ubuntu 20.04+, Debian 11+, or equivalent)
Recommended Requirements
- CPU: 4+ cores
- RAM: 8 GB+
- Storage: SSD with 50 GB+ (plus space for user data)
- OS: Linux (Ubuntu 22.04+ or Debian 12+)
Software Dependencies
- Docker 24.0+ and Docker Compose 2.0+
- OR Node.js 22.x, PostgreSQL 16 with pgvector, Redis 7.0+
Deployment Options
AFFiNE supports multiple deployment methods:Docker Compose (Recommended)
The easiest way to deploy AFFiNE is using Docker Compose. This method handles all dependencies and configuration automatically.Manual Installation
For advanced users who want more control, you can install AFFiNE components manually. This requires setting up:- PostgreSQL 16 with pgvector extension
- Redis server
- Node.js 22 runtime
- AFFiNE application server
Kubernetes
For production deployments at scale, AFFiNE can be deployed to Kubernetes using Helm charts.Key Features
Data Privacy & Control
Data Privacy & Control
All your data stays on your infrastructure. You have complete control over backups, retention policies, and data access.
Customizable Configuration
Customizable Configuration
Configure authentication providers, storage backends, email settings, AI features, and more through environment variables or JSON configuration files.
Scalable Architecture
Scalable Architecture
The stateless application server design allows horizontal scaling. Redis and PostgreSQL can be clustered for high availability.
S3-Compatible Storage
S3-Compatible Storage
Use local file system or any S3-compatible storage (AWS S3, MinIO, Cloudflare R2) for user uploads and attachments.
Available Versions
AFFiNE provides three release channels:| Channel | Image Tag | Description | Stability |
|---|---|---|---|
| Stable | ghcr.io/toeverything/affine:stable | Production-ready releases | High |
| Beta | ghcr.io/toeverything/affine:beta | Pre-release features | Medium |
| Canary | ghcr.io/toeverything/affine:canary | Latest development builds | Low |
Quick Start
To get started with a basic deployment:Next Steps
Deployment Guide
Detailed deployment instructions and configuration
Configuration
Complete configuration reference and options
Security
Security best practices and hardening
Maintenance
Backup, updates, and operational tasks
Getting Help
If you encounter issues:- Check the GitHub Issues
- Join the Discord Community
- Review the Troubleshooting Guide (coming soon)
Self-hosting AFFiNE requires technical knowledge of Linux, Docker, and database administration. For a managed solution, consider AFFiNE Cloud.