Analytics cookies only (Google Analytics, PostHog). No ad networks, no cross-site tracking. See our privacy policy.
A workspace that combines documents, whiteboards and databases on one canvas, with a local-first editor and real-time collaboration. The self-hosted server runs with PostgreSQL and Redis; upstream plans for at least 2 GB of RAM.
Runs on a VPS from $12/mo (Kamatera 4GB, 4 GB RAM) · prices checked Nov 2026
Fits home hardware (223 MB measured idle, RAM only): Raspberry Pi 4 (4 GB) (arm64 untested), Raspberry Pi 5 (8 GB) (arm64 untested), Repurposed laptop (8 GB), Intel N100 mini PC (16 GB), AMD Ryzen mini PC (32 GB).
Paid link — we earn a commission if you shop through it.
Run these commands on your server:
# AFFiNE — the official Compose file, pinned to a release (server + migration job + PostgreSQL + Redis) behind Caddy for HTTPS, per our AFFiNE deploy guide
# needs a domain pointed at this server and ports 80/443 open; AFFiNE binds 127.0.0.1 and PostgreSQL gets a real password
mkdir -p ~/affine/config && cd ~/affine
DOMAIN=notes.example.com
printf 'DOMAIN=%s\nDB_PASSWORD=%s\n' "$DOMAIN" "$(openssl rand -hex 16)" > .env && chmod 600 .env
curl -fsSL --retry 5 --retry-delay 3 -o config/config.json https://github.com/toeverything/AFFiNE/releases/download/v0.27.4/config.json.example
# server.externalUrl is the base AFFiNE uses for the links it generates: the public HTTPS address
sed -i "s|\"externalUrl\": \".*\"|\"externalUrl\": \"https://$DOMAIN\"|" config/config.json
cat > docker-compose.yml <<'EOF'
services:
affine:
image: ghcr.io/toeverything/affine:0.27.4
restart: unless-stopped
ports: ["127.0.0.1:3010:3010"]
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
affine_migration:
condition: service_completed_successfully
volumes:
- ./data/storage:/root/.affine/storage
- ./config:/root/.affine/config
environment:
REDIS_SERVER_HOST: redis
DATABASE_URL: postgresql://affine:${DB_PASSWORD}@postgres:5432/affine
AFFINE_INDEXER_ENABLED: "false"
affine_migration:
image: ghcr.io/toeverything/affine:0.27.4
command: ["sh", "-c", "node ./scripts/self-host-predeploy.js"]
volumes:
- ./data/storage:/root/.affine/storage
- ./config:/root/.affine/config
environment:
REDIS_SERVER_HOST: redis
DATABASE_URL: postgresql://affine:${DB_PASSWORD}@postgres:5432/affine
AFFINE_INDEXER_ENABLED: "false"
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
redis:
image: redis:7-alpine
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 5s
retries: 5
postgres:
image: pgvector/pgvector:pg16
restart: unless-stopped
environment:
POSTGRES_USER: affine
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: affine
POSTGRES_INITDB_ARGS: "--data-checksums"
volumes: ["pg_data:/var/lib/postgresql/data"]
healthcheck:
test: ["CMD", "pg_isready", "-U", "affine", "-d", "affine"]
interval: 10s
timeout: 5s
retries: 5
caddy:
image: caddy:2
restart: always
ports: ["80:80", "443:443"]
environment:
DOMAIN: ${DOMAIN}
volumes: ["./Caddyfile:/etc/caddy/Caddyfile:ro", "caddy_data:/data"]
depends_on: [affine]
volumes:
pg_data:
caddy_data:
EOF
cat > Caddyfile <<'EOF'
{$DOMAIN} {
encode zstd gzip
reverse_proxy affine:3010
}
EOF
sudo docker compose up -d # → AFFiNE on http://127.0.0.1:3010 (server-local); Caddy serves https://DOMAIN
# the first visitor to https://DOMAIN creates the admin account: do it as soon as HTTPS answersAFFiNE used 223 MB of RAM at idle on GCP e2-standard-2 · Ubuntu 26.04 LTS · Docker 29.9.0 (first boot, measured Oct 2026). We list a minimum of 2048 MB.
The AFFiNE install snippet is marked verified on Ubuntu 26.04 (Oct 2026).