Self-hosted Notion and Miro alternative: AFFiNE on Railway

By Tracklayer · Updated 2026-11-20

Short answer: yes. AFFiNE is an open-source workspace that combines docs, whiteboards and databases, and Tracklayer’s template deploys its self-hosted server on Railway. It runs AFFiNE 0.27.4 with Postgres (pgvector), Redis, a Manticore search indexer and a Railway Bucket for files, and it creates your administrator account on first start. Check the seat licensing below before you invite a larger team.

Deploy AFFiNE on Railway

When AFFiNE makes sense

AFFiNE puts documents and whiteboards on one canvas, with table and kanban views linked to pages. Typical uses:

Self-hosting means you keep the documents and files. It also means you run the updates and watch the licence terms.

What the template deploys

Service Image Role
AFFiNE ghcr.io/toeverything/affine:0.27.4 Web app, API and real-time sync
Indexer manticoresearch/manticore:10.1.0 Server-side full-text search
Postgres pgvector/pgvector:0.8.7-pg16 Documents, users, AI embeddings
Redis redis:8.2 Sync, cache, job queues
Bucket Railway Bucket Images, attachments, AI files

Since version 0.27 most AFFiNE settings live in a config.json file. The template generates it from Railway variables at every start, so you do not edit it by hand. Database migrations run in Railway’s pre-deploy step. A server key is derived from a generated secret, so sessions survive redeploys.

Deploy AFFiNE, step by step

These steps use Tracklayer’s AFFiNE 0.27 template.

  1. Enter your email. Set AFFINE_ADMIN_EMAIL when you deploy. It becomes the administrator login.
  2. Deploy the template. All five services start together.
  3. Find your password. Open the AFFiNE service, then Variables, and copy AFFINE_ADMIN_PASSWORD.
  4. Sign in and change it. The admin panel is at /admin.
  5. Add people. Sign-up starts closed. Either open it under Admin, then Settings, or create accounts under Admin, then Accounts.
  6. Use the apps. In the AFFiNE desktop or mobile app, add a self-hosted server with your Railway domain.
  7. Optional: custom domain. Update AFFINE_SERVER_HOST and AFFINE_SERVER_EXTERNAL_URL and redeploy.

Persistence

Documents are stored in Postgres, with Postgres and Redis each on a volume, and files go to the Bucket. Because the server key is stable, you stay signed in across redeploys.

AI features

AI is enabled as bring-your-own-key. A workspace owner adds a provider key under Workspace Settings, then Integrations. Provider usage is billed by that provider.

Costs

The template documents:

Limitations and licence

Upgrades

The version is the FROM line in services/affine/Dockerfile in the template. Read the release notes, change it and push. Migrations run before the new version starts. Desktop and mobile apps must be on a compatible version.

Other options

For file sync and calendars, see the Nextcloud template. For notebooks and data work, see the JupyterLab template. More walkthroughs are listed under guides.

FAQ

How do I log in to AFFiNE after deploying?

Enter your email in AFFINE_ADMIN_EMAIL when you deploy. After the first deploy, sign in with that email and the generated AFFINE_ADMIN_PASSWORD from the service variables, then change the password. In the desktop or mobile app, add a self-hosted server with your Railway domain.

How do I add people?

Sign-up is closed by default. Open it under Admin, then Settings, or create accounts under Admin, then Accounts. Invitation and password-reset emails need the MAILER_ SMTP variables, which Railway allows on the Pro plan.

Does the AI feature work?

AI is bring-your-own-key. Workspace owners add a provider key under Workspace Settings, then Integrations. Usage is billed by that provider.

Are there licensing limits?

AFFiNE states that self-hosting is free for up to 10 seats per workspace, and larger teams need AFFiNE's self-hosted Team plan. Check AFFiNE's pricing page for current terms. The server code is under the AFFiNE EE licence except the parts distributed as Community Edition (MPL-2.0). This is a community template, not affiliated with AFFiNE's publisher.

What drives the cost?

Memory on the AFFiNE server and the Indexer, then Postgres and Redis. Files accumulate in the Bucket, which is billed per GB. AFFiNE runs as one server process, so scale it vertically.