---
title: "Deploy R2R RAG backend"
description: "Authenticated R2R retrieval with pgvector ingestion and cited RAG."
category: "AI/ML"
url: https://railway.com/deploy/r2r-rag-backend
---

# Deploy R2R RAG backend

Authenticated R2R retrieval with pgvector ingestion and cited RAG.

**[Deploy R2R RAG backend on Railway](https://railway.com/template/r2r-rag-backend)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/r2r-rag-backend/manifest.json

- **Creator:** Anton Orel's Projects
- **Category:** AI/ML
- **Total deploys:** 1

## Template content

### R2R Dashboard

- **Image:** sciphiai/r2r-dashboard:1.0.3@sha256:ba9bcb43c5e7d7d4eb9fe38970f976f6a0842297f3da078cb6223d1f078741d1
- **Health check:** /
- **Public domain:** Yes

### R2R API

- **Source:** tech-progress/railway-template-r2r
- **Health check:** /v3/health
- **Public domain:** Yes

### R2R PostgreSQL

- **Image:** pgvector/pgvector:pg16@sha256:7b822b0aac60967beb1ea5e576b8602c94c300a157d187f385ae3e0da199b90a
- **Start command:** `/bin/sh -ec 'exec docker-entrypoint.sh postgres -c max_connections=256'`

### R2R Graph Clustering

- **Image:** ragtoriches/cluster-prod@sha256:53bcbcc114fe08906b6df6b4d3863644145b1efa240fd6643ef65986593938b6
- **Health check:** /health

## Documentation

# Deploy and Host R2R RAG backend on Railway

Deploy an authenticated R2R retrieval API and dashboard with durable pgvector storage and private graph clustering. The template pins every runtime image, generates administrator and database secrets, and keeps PostgreSQL off the public Internet.

## About Hosting R2R RAG backend

R2R is an MIT-licensed retrieval system for document ingestion, hybrid search, knowledge graphs, and retrieval-augmented generation through a REST API. This template uses R2R 3.6.5's standard single-replica configuration: files, chunks, vectors, users, and metadata live in PostgreSQL while orchestration runs in the API process.

## Why Deploy R2R RAG backend on Railway

Railway gives the dashboard and API separate managed-TLS domains while dependency traffic stays on private networking. Generated credentials, immutable image digests, a persistent database volume, health checks, and an explicit OpenAI requirement remove the hidden setup gaps found in mutable community deployments.

## Common Use Cases

- Build an authenticated internal document-search and RAG API.
- Ingest product, support, research, or policy documents into pgvector.
- Evaluate cited retrieval through the bundled dashboard and official SDKs.
- Add knowledge-graph clustering without exposing another public service.

## Dependencies for R2R RAG backend

The deployment uses R2R 3.6.5, R2R Dashboard 1.0.3, pgvector/PostgreSQL 16, R2R's graph-clustering service, and an OpenAI API key. The PostgreSQL volume defaults to 5 GB.

### Deployment Dependencies

- Provide an OpenAI API key with access to `text-embedding-3-small` and `gpt-4.1-mini` so ingestion and cited generation can complete.
- Use a Railway plan with enough memory for roughly 900 MB of settled service usage plus workload headroom, or the four-service topology may exceed its limits.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius v0.1 Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/r2r-rag-backend
