AFFiNE Docs and Whiteboards
Deploys the AFFiNE 0.27 self-hosted server, an open-source workspace combining docs, whiteboards and databases. Runs with Postgres and pgvector, Redis, a Manticore search indexer and a Railway Bucket for files, and creates the admin account on first start.
What you get
- AFFiNE 0.27.4 server (web app, API, real-time sync) with migrations in the pre-deploy step
- Postgres 16 with pgvector and Redis 8.2, each on a volume
- Manticore Search as a server-side full-text indexer
- A Railway Bucket for images and attachments; the config.json is generated from Railway variables at every start
- A stable server key derived from a generated secret, so sessions survive redeploys; sign-up starts closed and the admin panel is at /admin
Good for
- A team knowledge base and wiki on your own infrastructure
- Whiteboards and diagrams alongside the documents they belong to
- Project planning with table and kanban database views linked to pages
- Personal or family notes synced across desktop, mobile and web apps
Cost
Memory measured locally after install and test uploads: AFFiNE 375 MiB, Indexer 455 to 680 MiB, Postgres 50 MiB and Redis 7 MiB, about 0.9 GB in total at idle. The template notes estimate idle at about $10 a month at Railway prices.
Services in this template
- AFFiNE · from
baranberkay96/affine-railway - Redis · image
redis:8.2 - Postgres · image
pgvector/pgvector:0.8.7-pg16 - Indexer · image
manticoresearch/manticore:10.1.0
Questions people ask
How do I log in?
Enter your e-mail in AFFINE_ADMIN_EMAIL when deploying. After the first deploy, sign in with that e-mail 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, Settings, or create accounts under Admin, Accounts. Invitation and password-reset e-mails need the MAILER_ SMTP variables, which Railway allows on the Pro plan.
What drives the cost?
Memory on the AFFiNE server and the Indexer, which loads multilingual dictionaries, then Postgres and Redis. Files accumulate in the Bucket. AFFiNE runs as one server process, so scale it vertically.
Does the AI feature work?
AI is bring-your-own-key: workspace owners add a provider key under Workspace Settings, Integrations. Provider 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 its pricing page for current terms. This is a community template, not affiliated with AFFiNE's publisher.
Full template README
Deploy and Host AFFiNE with Railway
AFFiNE is an open-source workspace that combines docs, whiteboards and databases on one canvas. This community template runs the AFFiNE 0.27 self-hosted server on Railway with PostgreSQL (pgvector), Redis, a Manticore search indexer and a Railway Bucket for files, and creates your administrator account on first start.
About Hosting AFFiNE
AFFiNE's server is a Node.js application that stores documents in PostgreSQL, uses Redis for real-time sync and background jobs, and keeps uploaded images and attachments in a file store. Since version 0.27 most settings live in a config.json file; this template generates it from Railway variables on every start, so files go to a Railway Bucket and no manual configuration is needed. Database migrations run in Railway's pre-deploy step. A stable server key is derived from a generated secret, so sessions and stored secrets survive redeploys. The Manticore indexer adds server-side full-text search, and AI features work with your own provider key.
Common Use Cases
- Team knowledge base and wiki that replaces Notion, with data on your own infrastructure.
- Whiteboards and diagrams next to the documents they belong to, like Miro inside your docs.
- Project planning with database views (tables, kanban) linked to pages.
- Personal or family notes synced across the desktop, mobile and web apps.
Dependencies for AFFiNE Hosting
- AFFiNE self-hosted server (
ghcr.io/toeverything/affine) - PostgreSQL 16 with pgvector
- Redis
- Manticore Search (indexer)
- S3-compatible storage (Railway Bucket)
- Optional: SMTP server for invitations and password resets (Railway Pro plan), AI provider key
Deployment Dependencies
- AFFiNE self-hosting documentation: https://docs.affine.pro/self-host-affine
- Configuration (
config.json): https://docs.affine.pro/self-host-affine/install/configuration - Indexer setup: https://docs.affine.pro/self-host-affine/administer/indexer
- AFFiNE releases: https://github.com/toeverything/AFFiNE/releases
- AFFiNE pricing and self-hosted plans: https://affine.pro/pricing
- Railway Buckets: https://docs.railway.com/storage-buckets
Implementation Details
| Service | Image | Role | Public |
|---|---|---|---|
AFFiNE |
ghcr.io/toeverything/affine:0.27.4 + start scripts |
Web app, API, real-time sync; migrations in pre-deploy | HTTPS domain |
Indexer |
manticoresearch/manticore:10.1.0 |
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 | — |
First login. Enter your email in AFFINE_ADMIN_EMAIL when deploying. After the first deploy, sign in with that email and the generated AFFINE_ADMIN_PASSWORD from the service variables, then change the password. The admin panel is at /admin.
Adding people. Sign-up is closed by default. Open it in Admin → Settings, or create accounts in Admin → Accounts. Invitation and password-reset emails need SMTP (MAILER_HOST, MAILER_PORT, MAILER_USER, MAILER_PASSWORD, MAILER_SENDER), which Railway allows on the Pro plan.
AI. AI is enabled with bring-your-own-key: workspace owners add a provider key under Workspace Settings → Integrations.
Apps. In the AFFiNE desktop or mobile app, add a self-hosted server with your Railway domain.
Custom domain. Update AFFINE_SERVER_HOST and AFFINE_SERVER_EXTERNAL_URL and redeploy.
Licensing. AFFiNE states that self-hosting is free for up to 10 seats per workspace; larger teams need AFFiNE's self-hosted Team plan. Check AFFiNE's pricing page for current terms.
Scaling. AFFiNE runs as one server process; give the service more memory and CPU as your team grows. Files scale with the Bucket.
Pinning and upgrades. The version is the FROM line in services/affine/Dockerfile. Change it after reading the release notes and push; migrations run before the new version starts. Desktop and mobile apps must be on a compatible version.
Why Deploy AFFiNE on Railway?
Railway runs AFFiNE with its database, cache, search engine and file storage on a private network with automatic HTTPS, so your team gets a self-hosted Notion and Miro alternative in one deploy. You own the data, files scale in a low-cost Bucket, and you pay for the resources you use.
Guides for this template
View AFFiNE Docs and Whiteboards on railway.com
Similar templates
| Template | Category | DeploymentsDeploys |
|---|---|---|
| Chatwoot A customer communication platform | Other | 5,871 |
| Ubuntu-Linux Ubuntu terminal accessible via web browser | Other | 4,926 |
| Ubuntu SSH + Claude ARA TM —SSH server with root access + Claude Code pre-installed. | Other | 4,682 |
| Debian-Linux Debian terminal accessible via web browser. | Other | 2,883 |
| Code Server VS Code in the browser | Other | 2,787 |
| Kali Linux (Web Terminal) Instant Kali Linux browser terminal powered by ttyd | Other | 2,632 |