Railway

Deploy AFFiNE

A basic, out-of-the-box setup of Affine.

Deploy AFFiNE

/var/lib/postgresql/data

Just deployed

/root/.affine

Just deployed

/data

Deploy and Host AFFiNE

One-click template for AFFiNE workspace. Auto-provisions backend, database, caching. Zero config required.

About Hosting AFFiNE

Template orchestrates AFFiNE NestJS server, PostgreSQL, Redis. Links environment variables and runs pre-deploy DB migrations automatically.

Common Use Cases

  • Instant self-hosted workspace deployment
  • Zero-config team wiki/whiteboard setup
  • Fast AFFiNE evaluation

Dependencies for AFFiNE Hosting

None. Template automatically spins up:

  • AFFiNE Web/API service
  • PostgreSQL database
  • Redis instance

Deployment Dependencies

Implementation Details

Custom start command handles DB migrations automatically: sh -c "node ./scripts/self-host-predeploy.js && node dist/main.js"

Healthcheck configured at /api/health with 120s timeout to allow initial DB setup.

Why Deploy AFFiNE on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying AFFiNE on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

Shahed Nasser
View Template
peppermint
Docker-compose port for peppermint.sh

HamiltonAI