← Back to posts
comparison guide self-hosted · · 10 min read

Joplin vs Trilium Notes vs AFFiNE: Best Self-Hosted Note-Taking 2026

Compare the three best open-source self-hosted note-taking platforms: Joplin Server, Trilium Notes, and AFFiNE. Docker deployment guides, feature comparison, and recommendations.

OS
Editorial Team

Why Self-Host Your Notes and Knowledge Base

Cloud note-taking apps like Notion, Evernote, and Obsidian Sync lock your personal knowledge behind proprietary services with recurring subscriptions. When you self-host, you own your data, control access, eliminate vendor lock-in, and can integrate with your existing infrastructure — all without paying monthly fees.

The three strongest open-source options for self-hosted note-taking in 2026 each take a different approach:

  • Joplin Server — a sync backend for the Joplin note-taking app, focused on cross-platform note capture with end-to-end encryption.
  • Trilium Notes — a hierarchical knowledge base with a powerful scripting API, designed for deep personal knowledge management.
  • AFFiNE — a modern workspace that blends documents, whiteboards, and databases, positioning itself as a Notion and Miro alternative.

Project Overview and Live Stats

FeatureJoplin ServerTrilium NotesAFFiNE
GitHub Stars54,44635,64767,496
Last Updated2026-04-202026-04-212026-04-20
LanguageTypeScriptTypeScriptTypeScript
LicenseAGPL-3.0 (server)AGPL-3.0MIT / AGPL-3.0
DatabasePostgreSQL / SQLiteSQLitePostgreSQL
E2E EncryptionYesNoPlanned
Real-time CollaborationNoNoYes
Whiteboard / CanvasNoNoYes
Mobile AppsiOS, AndroidNoiOS, Android
API / Plugin SystemWeb Clipper, sync APIJavaScript scriptingBlock-level API
Minimum RAM512 MB256 MB1 GB

Joplin has the longest track record as a privacy-focused note app with sync. Trilium excels at structured knowledge management with its unique note hierarchy. AFFiNE brings the most modern feature set with real-time collaboration and mixed document/whiteboard editing.

Joplin Server: Cross-Platform Notes with Sync

Joplin Server acts as a synchronization backend for the Joplin client apps available on Windows, macOS, Linux, Android, and iOS. Your notes are stored locally on each device and synchronized through the server, optionally with end-to-end encryption.

The Joplin ecosystem includes a web clipper browser extension, markdown import/export, notebook organization, and support for attachments and images. The server component itself is lightweight — it handles authentication, note storage, and delta sync without running a full web UI.

Deploying Joplin Server with docker Compose

Joplin Server requires a PostgreSQL database. Here is a production-ready docker-compose.yml:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
version: '3'

services:
  db:
    image: postgres:16
    container_name: joplin_db
    restart: unless-stopped
    volumes:
      - ./joplin-db:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: your-secure-password
      POSTGRES_USER: joplin
      POSTGRES_DB: joplin
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U joplin"]
      interval: 10s
      timeout: 5s
      retries: 5

  joplin-server:
    image: joplin/server:latest
    container_name: joplin_server
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
    ports:
      - "22300:22300"
    environment:
      APP_PORT: 22300
      APP_BASE_URL: http://localhost:22300
      DB_CLIENT: pg
      POSTGRES_PASSWORD: your-secure-password
      POSTGRES_DATABASE: joplin
      POSTGRES_USER: joplin
      POSTGRES_PORT: 5432
      POSTGRES_HOST: db

Start the stack:

1
2
mkdir -p joplin-db
docker-compose up -d

Configure your Joplin clients by navigating to Tools > Options > Synchronization, selecting Joplin Server as the sync target, and entering http://your-server-ip:22300 with your admin credentials.

Key Joplin Server Features

  • End-to-end encryption — notes are encrypted on the client before syncing, so the server never sees plaintext content.
  • Web clipper — browser extension to save web pages, articles, and screenshots directly to your notes.
  • Markdown-first — all notes are stored in markdown, making them portable and future-proof.
  • Notebook hierarchy — organize notes into nested notebooks with tags for cross-cutting categorization.
  • Attachment support — images, PDFs, and files sync alongside note text.

For a reverse proxy setup with HTTPS, see our file sync and sharing guide which covers Traefik and Nginx proxy patterns applicable to Joplin Server as well.

Trilium Notes: Hierarchical Knowledge Base

Trilium Notes takes a fundamentally different approach. Instead of flat notebooks, it uses a tree-based note hierarchy where every note can have child notes, and notes can appear in multiple locations via cloning. This makes it ideal for building a personal wiki or knowledge graph.

The built-in code editor supports syntax highlighting for dozens of languages, and Trilium’s scripting API lets you automate note creation, build custom views, and integrate with external services. Notes can contain rich text, markdown, rendered HTML, code blocks, maps, and canvases.

Deploying Trilium Notes with Docker

Trilium is the simplest to deploy — a single container with no external database required:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
version: '3'

services:
  trilium:
    image: triliumnext/trilium:latest
    container_name: trilium_notes
    restart: unless-stopped
    environment:
      - TRILIUM_DATA_DIR=/home/node/trilium-data
    ports:
      - "8080:8080"
    volumes:
      - ./trilium-data:/home/node/trilium-data

Start the container:

1
2
mkdir -p trilium-data
docker-compose up -d

Open http://your-server-ip:8080 to complete the initial setup. The first visit lets you set a master password and configure the note tree structure.

Key Trilium Features

  • Note tree with cloning — hierarchical organization where a single note can appear in multiple branches without duplication.
  • Relation maps — create visual graphs showing how notes link together, surfacing connections you might miss in linear browsing.
  • Scripting API — write JavaScript to automate workflows, build custom note types, or integrate with external APIs.
  • Code note types — dedicated code notes with syntax highlighting and execution support for JavaScript, Python, and more.
  • ETAPI — RESTful API for programmatic access to notes, enabling integrations with other tools and automation pipelines.
  • Mobile web interface — responsive design works well in mobile browsers, though no native app exists.

AFFiNE: Notion and Miro Alternative

AFFiNE positions itself as a next-generation workspace that unifies documents, whiteboards, and databases in a single application. Unlike traditional note-taking apps, AFFiNE lets you switch between page mode (linear document editing) and edgeless mode (infinite canvas) for the same content.

The self-hosted server provides real-time collaboration, workspace management, and cloud sync across desktop and mobile clients. AFFiNE supports markdown, block-based editing, databases with multiple views, and embedded whiteboards — making it the most feature-rich option of the three.

Deploying AFFiNE with Docker Compose

AFFiNE requires PostgreSQL, Redis, and runs a migration job before the main service starts. Here is the official self-hosted compose configuration:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: affine

services:
  affine:
    image: ghcr.io/toeverything/affine:stable
    container_name: affine_server
    ports:
      - '3010:3010'
    depends_on:
      redis:
        condition: service_healthy
      postgres:
        condition: service_healthy
    volumes:
      - ./affine-storage:/root/.affine/storage
      - ./affine-config:/root/.affine/config
    env_file:
      - .env
    restart: unless-stopped

  redis:
    image: redis:7
    container_name: affine_redis
    healthcheck:
      test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped

  postgres:
    image: pgvector/pgvector:pg16
    container_name: affine_postgres
    volumes:
      - ./affine-db:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: affine
      POSTGRES_PASSWORD: your-secure-password
      POSTGRES_DB: affine
      POSTGRES_INITDB_ARGS: '--data-checksums'
    healthcheck:
      test: ['CMD', 'pg_isready', '-U', 'affine', '-d', 'affine']
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped

Create a .env file in the same directory with required variables:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
NODE_ENV=production
SERVER_FLAVOR=affine
AFFINE_ADMIN_EMAIL=admin@example.com
AFFINE_ADMIN_PASSWORD=your-admin-password
DATABASE_URL=postgresql://affine:your-secure-password@postgres:5432/affine
REDIS_SERVER_HOST=redis
MAILER_HOST=smtp.example.com
MAILER_PORT=587
MAILER_USER=noreply@example.com
MAILER_PASSWORD=your-smtp-password
MAILER_SENDER=Affine <noreply@example.com>

Start the stack:

1
docker compose up -d

Access AFFiNE at http://your-server-ip:3010 and log in with the admin credentials from your .env file.

Key AFFiNE Features

  • Page and edgeless modes — toggle between traditional document editing and freeform canvas/whiteboard view for the same workspace.
  • Real-time collaboration — multiple users can edit documents simultaneously, with live cursors and presence indicators.
  • Database views — create tables, kanban boards, and gallery views from structured data blocks within your pages.
  • Local-first architecture — data is stored locally first and synced to the server, providing offline access and resilience.
  • Block-based editing — every element is a movable, nestable block supporting text, images, code, embeds, and databases.
  • Mobile support — native iOS and Android apps with full sync to your self-hosted server.

Direct Feature Comparison

CapabilityJoplin ServerTrilium NotesAFFiNE
Note editingMarkdown, rich textRich text, markdown, code, HTMLBlock editor, markdown, whiteboard
OrganizationNotebooks + tagsTree hierarchy + cloningWorkspaces + pages + databases
SyncClient-server syncServer-based accessReal-time collaboration sync
EncryptionE2E (client-side)NoneIn transit (TLS)
SearchFull-text, tag filteringFull-text, attribute-basedFull-text, semantic (vector DB)
APISync API, WebDAVETAPI (REST)GraphQL + REST
PluginsDesktop pluginsJavaScript scriptingExtensions (in development)
Multi-userPer-account notesSingle userWorkspace collaboration
OfflineFull (local-first)Full (server access)Partial (local-first, needs sync)
Best forPersonal notes across devicesDeep knowledge managementTeam collaboration, visual planning

Deployment Requirements and Resource Usage

RequirementJoplin ServerTrilium NotesAFFiNE
Minimum RAM512 MB256 MB1 GB
Minimum CPU1 core1 core2 cores
Storage (base)~200 MB + note data~100 MB + note data~500 MB + workspace data
External ServicesPostgreSQLNonePostgreSQL, Redis
Docker Images2 (server + db)13 (server + plex redis)
Backup ComplexityDump PostgreSQL + data dirCopy data directoryDump PostgreSQL + storage volume
Reverse ProxyStandard HTTPStandard HTTPStandard HTTP + WebSocket support

For users already running a self-hosted wiki, note that AFFiNE overlaps with tools like Wiki.js and BookStack in the documentation space, though AFFiNE focuses more on personal and team productivity than public-facing documentation.

Migration Paths

From Evernote: Joplin has the most mature Evernote import tool — it can import .enex files with attachments, formatting, and notebook structure intact. Run the import from the desktop client, then notes sync to your self-hosted server.

From Notion: Export your Notion workspace as markdown and HTML (Settings > Export), then import into AFFiNE or Trilium. AFFiNE handles Notion-style block structures most naturally, while Trilium requires reorganizing into its tree hierarchy.

From Obsidian: Joplin supports markdown import natively. Trilium can import markdown files via its import menu. AFFiNE accepts markdown paste directly into the editor.

Choosing the Right Tool

Pick Joplin Server if:

  • You need cross-platform sync between desktop and mobile apps.
  • End-to-end encryption is a non-negotiable requirement.
  • You prefer a simple, reliable note-taking workflow without complex features.
  • You already use or want to use the Joplin client ecosystem.

Pick Trilium Notes if:

  • You are building a personal knowledge base with deep hierarchical structure.
  • You want scripting capabilities to automate note workflows.
  • You value a desktop-first experience with powerful organizational tools like cloning and relation maps.
  • You prefer the simplest possible deployment (single container, no database).

Pick AFFiNE if:

  • You need real-time multi-user collaboration on documents.
  • You want whiteboard and canvas capabilities alongside traditional notes.
  • You are replacing Notion or Miro and need block-based editing with databases.
  • You value a modern UI with mobile app support.

FAQ

Can I use Joplin without self-hosting a server?

Yes. Joplin supports multiple sync targets including Dropbox, OneDrive, S3-compatible storage, and WebDAV. The Joplin Server is optional but recommended for privacy — it gives you full control over where your note data is stored and enables faster delta sync compared to generic cloud storage.

Does Trilium Notes support mobile access?

Trilium does not have native mobile apps, but the web interface is responsive and works well in mobile browsers. You can access your notes from any device by pointing a browser to your server’s URL. For offline mobile access, consider using the Trilium desktop client with file sync.

Is AFFiNE stable enough for production use?

AFFiNE’s self-hosted server reached stable release status and is suitable for production use. However, as a rapidly evolving project, breaking changes can occur between major versions. Always back up your PostgreSQL database and storage volumes before upgrading, and test updates in a staging environment first.

Can multiple users share a single Trilium Notes instance?

Trilium is designed as a single-user application. Multiple users cannot have separate accounts on one instance. If you need multi-user support, consider Joplin Server (per-account sync) or AFFiNE (workspace collaboration with role-based access).

How do I back up each platform?

Joplin Server: Back up the PostgreSQL database with pg_dump and the server data directory. Trilium: Stop the container, then copy the trilium-data volume — it contains the entire SQLite database and attachments. AFFiNE: Back up the PostgreSQL database and the storage volume (/root/.affine/storage). Automate backups with a cron job or use a tool like restic for backup verification.

Which platform handles the largest note collections?

Trilium Notes has been tested with 100,000+ notes thanks to its efficient SQLite storage. Joplin handles large collections well but sync performance can degrade with thousands of attachments. AFFiNE’s PostgreSQL backend scales well but the block-based editor may slow down with extremely long documents containing hundreds of blocks.

Advertise here