---
title: "Deploy Affine with AI Copilot"
description: "One-click template for AFFiNE with optional AI (NVIDIA NIM/Google Gemini)"
category: "Starters"
url: https://railway.com/deploy/affine-with-ai-copilot
---

# Deploy Affine with AI Copilot

One-click template for AFFiNE with optional AI (NVIDIA NIM/Google Gemini)

**[Deploy Affine with AI Copilot on Railway](https://railway.com/template/affine-with-ai-copilot)**

- **Creator:** Paul Gadi's Projects
- **Category:** Starters
- **Total deploys:** 9

## Template content

### postgres https://devicons.railway.com/i/postgresql.svg

- **Source:** https://github.com/polats/railway-affine
- **Start command:** `docker-entrypoint.sh postgres -c listen_addresses=*`

### affine

- **Source:** https://github.com/polats/railway-affine
- **Start command:** `sh -c 'node ./scripts/self-host-predeploy.js && node ./dist/main.js'`
- **Health check:** /
- **Public domain:** Yes

### redis https://devicons.railway.com/i/redis.svg

- **Source:** https://github.com/polats/railway-affine
- **Start command:** `redis-server --bind 0.0.0.0 :: --port 6379`

## Documentation

# Deploy and Host Affine with AI Copilot on Railway

AFFiNE is an open-source alternative to Notion and Miro that combines documents, whiteboards, and databases in one workspace. This template deploys AFFiNE with optional AI Copilot powered by NVIDIA NIM or Google Gemini for chat, writing assistance, summarization, and code generation.

## About Hosting Affine with AI Copilot

AI Copilot is enabled by simply providing an NVIDIA NIM or Google Gemini API key — the template auto-generates AFFiNE's config.json at startup to route all AI tasks through your chosen provider. No AI key is required for basic functionality.

## Common Use Cases

* Self-hosted knowledge base and wiki with AI-powered writing, summarization, and search
* Collaborative workspace with real-time editing, whiteboards, and databases — fully under your control
* Private AI-assisted document creation using NVIDIA NIM or Google Gemini instead of cloud-hosted alternatives

## Dependencies for Affine with AI Copilot Hosting

* PostgreSQL 16 with pgvector extension (included in template)
* Redis (included in template)

### Deployment Dependencies

* [AFFiNE Self-Hosting Documentation](https://docs.affine.pro/self-host-affine)                                                                                                                     
 * [NVIDIA NIM API Keys](https://build.nvidia.com/) (optional — for AI Copilot)
 * [Google Gemini API Keys](https://aistudio.google.com/apikey) (optional — for AI Copilot)                                                                                                          
 * [AFFiNE GitHub Repository](https://github.com/toeverything/AFFiNE) 

## Why Deploy Affine with AI Copilot 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 with AI Copilot 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-with-ai-copilot
