Self-hosted Notion and Miro alternative: AFFiNE on Railway
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 RailwayWhen AFFiNE makes sense
AFFiNE puts documents and whiteboards on one canvas, with table and kanban views linked to pages. Typical uses:
- a team knowledge base or wiki on your own infrastructure,
- whiteboards and diagrams next to the documents they belong to,
- project planning with database views linked to pages,
- personal or family notes synced across desktop, mobile and web apps.
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.
- Enter your email. Set
AFFINE_ADMIN_EMAILwhen you deploy. It becomes the administrator login. - Deploy the template. All five services start together.
- Find your password. Open the AFFiNE service, then Variables, and copy
AFFINE_ADMIN_PASSWORD. - Sign in and change it. The admin panel is at
/admin. - Add people. Sign-up starts closed. Either open it under Admin, then Settings, or create accounts under Admin, then Accounts.
- Use the apps. In the AFFiNE desktop or mobile app, add a self-hosted server with your Railway domain.
- Optional: custom domain. Update
AFFINE_SERVER_HOSTandAFFINE_SERVER_EXTERNAL_URLand 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:
- Measured locally after install and test uploads: AFFiNE 375 MiB, Indexer 455 to 680 MiB, Postgres 50 MiB, Redis 7 MiB. The Indexer is large because it loads multilingual dictionaries.
- Estimated: about $10 a month idle, and about $17 to $40 a month for a team of 5 to 20 active editors. Files in the Bucket are estimated at $0.015 per GB. These use the Railway prices listed in the template’s TEMPLATE.md and can change.
- Optional saving: the template estimates that dropping the Indexer saves about $5 a month. Set
AFFINE_INDEXER_ENABLED=false, then remove the service. - Plan guidance from the template: Hobby at minimum.
Limitations and licence
- Seats: AFFiNE states that self-hosting is free for up to 10 seats per workspace, with a paid self-hosted Team plan beyond that. Confirm current terms on AFFiNE’s pricing page before deploying for a larger team.
- Licence: the server code is under the AFFiNE EE licence, except the parts distributed as Community Edition (MPL-2.0), per the template’s TEMPLATE.md. The Manticore indexer is GPL-3.0.
- Email: invitations and password resets need SMTP, which Railway allows on the Pro plan.
- Scaling: one server process, so add memory and CPU rather than replicas.
- Affiliation: a community template, not affiliated with AFFiNE’s publisher.
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.