---
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)**

- **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:a36250871de0833b8757561c72f2477ef1ddd1101afa4e617fb552e0de514c6b
- **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.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

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