---
title: "Deploy FastGPT Core + RAG"
description: "FastGPT chat and RAG with MongoDB, pgvector, Redis and object storage."
category: "AI/ML"
url: https://railway.com/deploy/fastgpt-core-rag
---

# Deploy FastGPT Core + RAG

FastGPT chat and RAG with MongoDB, pgvector, Redis and object storage.

**[Deploy FastGPT Core + RAG on Railway](https://railway.com/template/fastgpt-core-rag)**

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

- **Creator:** orenaksakal
- **Category:** AI/ML

## Template content

### aiproxy

- **Image:** ghcr.io/labring/aiproxy:v0.6.5@sha256:9b2d9148c8d8a09d2e70577b492b7b32aab5877fe48c2c78a6d300005f4d42bb

### redis

- **Image:** redis:7.4@sha256:71da9275c5f3fcb97d0fa0c8c5b36cc995327265420f17a04bfd544f458059f7
- **Start command:** `sh -c 'exec redis-server --bind 0.0.0.0 :: --appendonly yes --maxmemory-policy noeviction --requirepass "$REDIS_PASSWORD"'`

### storage

- **Source:** orenaksakal/railway-templates

### plugin

- **Image:** ghcr.io/labring/fastgpt-plugin:v1.1.2@sha256:80049419369c7c8ad207acc09d7df0a62fdeafcb489651d3b2bdad769f6dc6a2

### vector

- **Image:** pgvector/pgvector:0.8.0-pg15@sha256:1dec32aaba982ea73c51e93bee0319abf54150110321e24101c3d9de0b88db98

### fastgpt

- **Image:** ghcr.io/labring/fastgpt:v4.16.2@sha256:23f0f23e69d8c22f547bc8887d7089a87bbef10e67fa239489bcc241cff6ee1e
- **Public domain:** Yes

### mongo

- **Source:** orenaksakal/railway-templates

### code-sandbox

- **Image:** ghcr.io/labring/fastgpt-code-sandbox:v4.16.0@sha256:4ba4613d7fa6534e72a3adbfe3cd26f6617ba55df99e21d71a8fe7c6ebff36ab

### aiproxy-db

- **Image:** postgres:15@sha256:9b1d34adbce1dd07ee6e94b4a2cf698884b89bd44a6c9c12f5da8f3acbfe4957

## Documentation

# Deploy and Host FastGPT Core + RAG on Railway

FastGPT chat and RAG with MongoDB, pgvector, Redis and object storage.

**Deployment template.** Deployment incurs Railway charges. Supply your own required model, search and external-service credentials; no example provider credentials are included.

## About Hosting FastGPT Core + RAG

This template provisions 9 services in one Railway project, with image digests or upstream source revisions pinned, generated internal credentials, linked environment variables and the persistent paths listed below. Public HTTP routes use Railway HTTPS. SQL and internal dependency endpoints stay private. Keep stateful services single-replica and configure your own backup policy.

## Live verification — 2026-09-08

All nine services started. MongoDB replica became primary. Public web route and root password login passed. Model-backed chat, RAG quality, restore and external sandbox execution were not tested; the Docker-socket agent sandbox is excluded.

## Setup

Log in as root with fastgpt.DEFAULT_ROOT_PSW. Configure your model provider and embedding model in FastGPT before ingesting documents. Keep all generated encryption keys and MongoDB replica identity with your backups.

## Dependencies for FastGPT Core + RAG Hosting

### Deployment Dependencies

| Service | Source | Persistent volume | Public HTTP |
|---|---|---|---|
| vector | pgvector/pgvector:0.8.0-pg15 (digest pinned) | /var/lib/postgresql/data | Private only |
| mongo | repository adapter: templates/fastgpt/Mongo.Dockerfile | /data | Private only |
| redis | redis:7.4 (digest pinned) | /data | Private only |
| storage | repository adapter: shared/round4-storage/Dockerfile | /data | Private only |
| aiproxy-db | postgres:15 (digest pinned) | /var/lib/postgresql/data | Private only |
| fastgpt | ghcr.io/labring/fastgpt:v4.16.2 (digest pinned) | None | 3000 |
| plugin | ghcr.io/labring/fastgpt-plugin:v1.1.2 (digest pinned) | None | Private only |
| code-sandbox | ghcr.io/labring/fastgpt-code-sandbox:v4.16.0 (digest pinned) | None | Private only |
| aiproxy | ghcr.io/labring/aiproxy:v0.6.5 (digest pinned) | None | Private only |

## Required inputs

No external secrets are required for initial configuration. Follow the setup instructions for application-level onboarding.

Generated credentials: `vector.POSTGRES_PASSWORD`, `mongo.MONGO_INITDB_ROOT_PASSWORD`, `redis.REDIS_PASSWORD`, `storage.MINIO_ROOT_USER`, `storage.MINIO_ROOT_PASSWORD`, `aiproxy-db.POSTGRES_PASSWORD`, `fastgpt.ROOT_KEY`, `fastgpt.DEFAULT_ROOT_PSW`, `fastgpt.FILE_TOKEN_KEY`, `fastgpt.AES256_SECRET_KEY`, `fastgpt.INVOKE_TOKEN_SECRET`, `fastgpt.PLUGIN_TOKEN`, `fastgpt.CODE_SANDBOX_TOKEN`, `fastgpt.AIPROXY_API_TOKEN`. Keep them private and preserve relevant encryption keys with backups. Every editor variable includes a description.

## Scope and limitations

Nine services. Full OpenSandbox agent execution, agent previews and Docker volume management are excluded: those upstream services require a Docker socket. The separate workflow code sandbox is included. Confirm the current UI handles unavailable agent features clearly. Both S3 buckets start private; confirm signed/proxied downloads and intended public assets.

## Recommended acceptance checks

Build and first boot; root login; model-provider configuration; document upload and retrieval; workflow execution; authenticated replica recovery; object downloads; restart and restore. Verify MongoDB 5 lifecycle/support before release.

## Operations

Keep database and internal service endpoints private. Railway provides HTTPS for the explicitly exposed HTTP services. Back up the listed persistent volumes and database exports, preserve encryption keys, and test a restore before relying on this instance. Review upstream migrations before upgrades. Single-volume services use one replica; no multi-region or high-availability guarantee is made. A gateway health response only proves the gateway is alive.

## Sources

- [Upstream project](https://github.com/labring/FastGPT)
- [Reviewed source snapshot](https://github.com/labring/FastGPT/tree/0058e223edfcb1035b437cadb9370462b562f685)
- Image digest pins: `images.round4.lock.json` in the template source repository. Source snapshots are research references; image digests do not prove the image was built from that same commit.
- Base-image pins do not lock every package installed by apt/apk/pip. See the verification scope above before relying on this deployment.

## Common Use Cases

- Build a private knowledge-base assistant with your own model provider.
- Configure chat and RAG workflows with persistent document storage.

## Why Deploy FastGPT Core + RAG on Railway?

Railway groups service deployment, logs, private networking, generated environment references and persistent volumes in one project. This community template supplies the configuration and setup notes; Railway resource charges and external provider costs remain separate. No fixed cost or capacity guarantee is made.


## 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/fastgpt-core-rag
