---
title: "Deploy LibreChat"
description: "Multi-provider AI chat with agents, files, search, and RAG."
category: "AI/ML"
url: https://railway.com/deploy/librechat-1
---

# Deploy LibreChat

Multi-provider AI chat with agents, files, search, and RAG.

**[Deploy LibreChat on Railway](https://railway.com/template/librechat-1)**

- **Creator:** Agaz Self-Host
- **Category:** AI/ML

## Template content

### RAG API

- **Image:** ghcr.io/danny-avila/librechat-rag-api-dev-lite:v0.7.3
- **Health check:** /health

### LibreChat

- **Image:** ghcr.io/danny-avila/librechat:v0.8.7
- **Start command:** `/bin/sh -c 'mkdir -p /app/uploads && chown -R 1000:1000 /app/uploads && exec su node -s /bin/sh -c "exec npm run backend"'`
- **Health check:** /readyz
- **Public domain:** Yes

### Meilisearch

- **Image:** getmeili/meilisearch:v1.12.3
- **Health check:** /health

### MongoDB

- **Image:** mongo:8.0.10

### VectorDB

- **Image:** ankane/pgvector:v0.5.1

## Documentation

# Deploy and Host LibreChat on Railway

LibreChat is an open-source, multi-user AI chat interface that brings multiple model providers into one customizable application. It supports agents, files, conversation search, retrieval-augmented generation (RAG), model switching, presets, and secure authentication while letting operators retain control of application data and provider credentials.

## About Hosting LibreChat

Hosting LibreChat requires five coordinated services: the LibreChat web application, MongoDB for users and conversations, Meilisearch for full-text conversation search, PostgreSQL with pgvector for embeddings, and the LibreChat RAG API for file indexing and retrieval. This template pins the Umbrel-tested LibreChat 0.8.7 service graph. Only LibreChat receives a public Railway domain; every dependency remains on Railway's private network. Persistent volumes protect uploaded files, MongoDB records, Meilisearch indexes, and vector data. Railway generates internal database, search, encryption, and signing credentials, while AI-provider keys remain optional external inputs with no defaults.

## Common Use Cases

- Give teams one self-hosted interface for OpenAI, Anthropic, Google, and other AI providers
- Build agents that work with uploaded documents through retrieval-augmented generation
- Keep authenticated conversation history, presets, files, and full-text search under operator control

## Dependencies for LibreChat Hosting

- MongoDB 8.0.10 for accounts, conversations, agents, and application metadata
- Meilisearch 1.12.3 for private full-text conversation and message indexes
- PostgreSQL 15 with pgvector 0.5.1 for RAG embeddings and metadata
- LibreChat RAG API 0.7.3 for document extraction, embedding, indexing, and retrieval

### Deployment Dependencies

- [LibreChat 0.8.7 source and deployment files](https://github.com/danny-avila/LibreChat/tree/v0.8.7)
- [LibreChat Docker installation](https://www.librechat.ai/docs/local/docker)
- [LibreChat RAG API configuration](https://www.librechat.ai/docs/configuration/rag_api)
- [LibreChat Meilisearch configuration](https://www.librechat.ai/docs/configuration/meilisearch)
- [Umbrel LibreChat 0.8.7 package](https://github.com/getumbrel/umbrel-apps/tree/master/librechat)

## Implementation Details

| Service | Image | Networking | Persistent volume |
| --- | --- | --- | --- |
| `LibreChat` | `ghcr.io/danny-avila/librechat:v0.8.7` | Public port `3080`; private dependencies | `/app/uploads` |
| `MongoDB` | `mongo:8.0.10` | Private port `27017` only | `/data/db` |
| `Meilisearch` | `getmeili/meilisearch:v1.12.3` | Private port `7700` only | `/meili_data` |
| `VectorDB` | `ankane/pgvector:v0.5.1` | Private port `5432` only | `/var/lib/postgresql/data` |
| `RAG API` | `ghcr.io/danny-avila/librechat-rag-api-dev-lite:v0.7.3` | Private port `8000` only | None; vectors persist in `VectorDB` |

LibreChat 0.8.7 treats `librechat.yaml` as optional: when it is absent, the application logs that custom configuration was not loaded and continues with validated defaults. The official image already contains the built client and starts with `npm run backend`, so this template uses the pinned image directly rather than fabricating a repository build. The first registered account becomes the administrator. Add at least one supported AI-provider key after deployment to chat; an OpenAI-compatible embeddings key is needed only when using RAG with the default embedding provider.

The `LibreChat` volume is mounted at `/app/uploads`. Railway starts the container as root only long enough to assign that root-owned mount to UID/GID 1000, then `su` launches the documented `npm run backend` process as the image's `node` user. Application logs stay in Railway's log stream. MongoDB authentication, Meilisearch authentication, RAG JWT verification, PostgreSQL authentication, credential encryption, and session signing all use independently generated deployment secrets; shared values are generated once and consumed through Railway references.

Railway checks LibreChat's `/readyz` endpoint, Meilisearch's `/health` endpoint, and the RAG API's `/health` endpoint. LibreChat initializes MongoDB collections and indexes through Mongoose and starts Meilisearch synchronization in the background. RAG API 0.7.3 initializes pgvector's LangChain tables and idempotently creates its `custom_id`, `file_id`, and JSONB GIN indexes during startup.

## Why Deploy LibreChat 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 LibreChat 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

- [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/librechat-1
