---
title: "Deploy AFFiNE-latest"
description: "Selfhosted sync backend for AFFiNE version 0.23.0+"
category: "Starters"
url: https://railway.com/deploy/affine-selfhost
---

# Deploy AFFiNE-latest

Selfhosted sync backend for AFFiNE version 0.23.0+

**[Deploy AFFiNE-latest on Railway](https://railway.com/template/affine-selfhost)**

- **Creator:** Sylvia Ke's Projects
- **Category:** Starters
- **Total deploys:** 79

## Template content

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** pgvector/pgvector:pg16

### AFFiNE https://affine.pro/favicon-96.png

- **Image:** ghcr.io/toeverything/affine:stable
- **Public domain:** Yes

## Documentation

!!!All you need to do is to setup the AFFiNE service domain port to 3010 (or your port of choice if not using the default) in the service settings.!!!

!!! Please use a railway environment/project created post Oct 16th 2025, since the ipv4 address for interal networking is needed for the redis connection to be found by the backend server.!!!

# Deploy and Host AFFiNE Cloud on Railway

[AFFiNE](https://affine.pro) is an open-source, all-in-one workspace and an operating system for all the building blocks that assemble your knowledge base and much more -- wiki, knowledge management, presentation and digital assets. It's a better alternative to Notion and Miro. 

## About Hosting AFFiNE Cloud

This template offers a simple way to host AFFiNE Cloud on Railway with all the default settings. Tested for AFFiNE 0.25.7 on Jan 27, 2026 with the official recommended docker-compose setup mirrored as a Railway project. Auto update are disabled by default, but can be enabled by the user.

## Common Use Cases

* Knowledge management and wikis
* Collaborative whiteboarding
* Project planning with kanban boards
* Team documentation
* Personal note-taking with privacy

Check out https://affine.pro/ for more information. It's basically notion + miro + linear, but self-hosted and open source :)

## Dependencies for AFFiNE-selfhost Hosting

No dependencies are required for this template! Though it is possible to use other storage services like R2 or S3 for blobs to go over Railway's limit (depending on which plan you are on), but that requires additional configuration.

### Deployment Dependencies

Just an email account to set up the admin account, nothing else :)

### Implementation Details

This template mirrors the official docker compose setup for AFFiNE 0.25.7 fetched on Jan 27, 2026.
See https://github.com/toeverything/affine/releases/latest/download/docker-compose.yml

## Why Deploy AFFiNE-selfhost 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-selfhost 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.

## Similar templates

- [open-excalidraw](https://railway.com/deploy/open-excalidraw) — Self-hostable collaborative drawing built on Excalidraw
- [caring-vibrancy](https://railway.com/deploy/caring-vibrancy) — Deploy and Host caring-vibrancy with Railway
- [Appsmith](https://railway.com/deploy/appsmith-1) — Low-code platform for internal tools, dashboards, and admin panels.

Open this page in a browser: https://railway.com/deploy/affine-selfhost
