Self-hosting AFFiNE: documents, whiteboards, and the stack behind them
A practical look at AFFiNE's document and canvas workspace, its Docker stack, and the data you need to protect.
A project plan often starts as a page, spills onto a whiteboard, and ends up in a table. AFFiNE brings those forms into one workspace: documents, an open canvas, and databases built around blocks. It also has a self-hosted server for people who want to run the collaboration infrastructure themselves.
This is an established project worth discovering, not a new launch. Its release history shows recent canary and beta builds; those are prereleases, not a reason by themselves to upgrade a working server. The interesting question for a homelab is whether a flexible workspace is worth operating a database, cache, storage, and sync service to keep it.
One workspace, two ways to think
AFFiNE’s repository describes a local-first editor with real-time collaboration across clients. A document can hold structured text and other blocks; the edgeless canvas places content spatially. Think of a project brief that starts as a written outline, then gets linked to a board of notes and diagrams. Database views can organize blocks in tables or Kanban boards. The database documentation lists other views as work in progress or planned, so check the current release before designing a workflow around one.
The closest comparison is a combination of Notion’s structured pages and Miro’s canvas. AFFiNE puts both ideas in one product, but a migration still deserves a trial with representative documents and collaborators. Import fidelity, permissions, and habits matter more than a feature checklist. A local-first client also does not eliminate the need for backups or make a shared server automatically private.
What the server adds
The self-hosting guide recommends at least four CPU cores and 2 GB of RAM for basic use, with more memory for larger documents. Storage grows with documents and uploaded files. The recommended Compose deployment runs the AFFiNE server, a migration job, PostgreSQL, and Redis. PostgreSQL holds application data; uploaded blobs and configuration have their own persistent paths.
That is more infrastructure than a plain Markdown directory. In return, the operator controls the host, domain, and backup policy. AFFiNE’s basic quota documentation says a self-hosted workspace has up to ten seats; larger teams need a team license. It also describes existing blob limits, so do not assume storage is unlimited merely because the disk is yours.
The repository license is mixed: code outside specified backend/native directories is MIT, while those directories have separate terms. The backend license distinguishes community-edition code under MPL 2.0 from enterprise-edition terms. Read the applicable files before redistributing or building a commercial service around it.
Bring up a local evaluation
On a Linux host with Docker and Compose v2 installed, the official installation guide starts with a directory and the current release’s Compose and configuration files:
1
2
3
4
5
6
mkdir -p affine/config
cd affine
curl -L -o docker-compose.yml \
https://github.com/toeverything/AFFiNE/releases/latest/download/docker-compose.yml
curl -L -o config/config.json \
https://github.com/toeverything/AFFiNE/releases/latest/download/config.json.example
Inspect both files before running them. The example configuration uses http://localhost:3010 as the external URL. For an evaluation on the host itself, keep that value; for a real deployment, configure the eventual HTTPS URL and follow the project’s domain and proxy guidance. The Compose example publishes port 3010 on the host, so restrict access with a firewall or bind it to loopback if only local access is intended. Create the administrator account promptly before making the service reachable to other users.
1
2
docker compose up -d
docker compose ps
The documentation says the migration container should finish successfully while AFFiNE, PostgreSQL, and Redis remain running. Open http://localhost:3010 on the host to complete first-run setup. If startup stalls, inspect the application and migration logs:
1
docker compose logs --tail=200 affine affine_migration
The published Compose example does not publish PostgreSQL or Redis ports, but configures PostgreSQL trust authentication on the Compose network. Keep untrusted containers off that network. If you expose the database or change its network boundaries, configure authentication appropriately. Review the actual downloaded file because latest and its images can change; record the version you deploy and plan updates deliberately.
Back up the whole workspace
A database dump alone is incomplete. The backup guide calls for PostgreSQL data, uploaded files, and configuration. In the current documented layout, the latter two live under ./data/storage and ./config; older deployments may use different paths. Include the Compose file and any proxy, mail, or authentication settings needed to rebuild the service.
Store backups away from the host and test a restore into a separate target before relying on them. The guide’s database dump reads the running container’s effective database user and name, which matters for older installations with custom settings. Keep the original data intact until the restored workspace, attachments, and admin access have been checked.
For a personal knowledge base or a small team that wants pages and a canvas in one place, AFFiNE is a useful candidate. The decision to self-host rests on the operational side: if maintaining the database, upgrades, and recovery is more work than the control is worth, the managed service or a simpler local notes tool may fit better.