Deploy LibreChat Multi Model AI
LibreChat v0.8.7 with MongoDB 8 and Meilisearch, all state on volumes
meilisearch
Just deployed
/meili_data
librechat
Just deployed
/app/uploads
mongo
Just deployed
/data/db
Deploy and Host LibreChat on Railway
LibreChat is the open-source, self-hosted ChatGPT alternative: one interface across OpenAI, Anthropic, Google, Azure, and any OpenAI-compatible endpoint, with multi-user accounts, conversation search, file uploads, and agents. This template deploys LibreChat v0.8.7 with MongoDB 8 for conversations and Meilisearch 1.50 for full-text search — each on its own persistent volume.
About Hosting LibreChat
LibreChat is a three-part system and needs all three parts to behave. Conversations, users, presets, and agent definitions live in MongoDB. Message search is served by Meilisearch, which maintains its own index. Uploaded files land on the application's filesystem. A deployment that skips the volumes keeps none of it past a redeploy.
This template mounts all three: MongoDB at /data/db, Meilisearch at /meili_data, and LibreChat's uploads at /app/uploads. MongoDB runs with root authentication enabled rather than open on the internal network, and Meilisearch runs in production mode behind a generated master key. Neither datastore has a public domain — LibreChat reaches both over Railway's private network only.
Meilisearch binds to loopback by default, which makes it unreachable from a sibling container and is a common cause of a LibreChat deployment that starts but never returns search results; MEILI_HTTP_ADDR is set to 0.0.0.0:7700 here so the private-network connection works.
The four cryptographic secrets LibreChat requires — CREDS_KEY, CREDS_IV, JWT_SECRET, and JWT_REFRESH_SECRET — are generated at deploy as hex values of the exact lengths LibreChat expects. CREDS_KEY and CREDS_IV encrypt the provider API keys users store in the UI, so those two must never be rotated after people have saved keys.
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.
- All three stores persisted — Mongo, Meilisearch, and uploads each on their own volume.
- Search actually works — Meilisearch bound to the private network instead of loopback.
- Correctly sized secrets — hex keys of the exact lengths LibreChat requires, generated at deploy.
- Authenticated datastores — Mongo with root auth, Meilisearch behind a master key, neither publicly exposed.
- Bring your own keys — pay providers directly at API rates instead of per-seat chat subscriptions.
Common Use Cases
- Team ChatGPT replacement — one self-hosted interface with accounts, shared presets, and history.
- Multi-provider comparison — run the same prompt against several models side by side.
- Private document chat — upload files and query them without sending data to a third-party product.
Dependencies for LibreChat Hosting
- A MongoDB 8 service with a volume mounted at
/data/db(included in this template). - A Meilisearch 1.50 service with a volume mounted at
/meili_data(included in this template). - At least one model provider API key (OpenAI, Anthropic, Google, or any OpenAI-compatible endpoint), added after deploy.
Deployment Dependencies
- LibreChat — upstream project (MIT)
- LibreChat documentation — configuration, providers, and agents reference
- librechat/librechat — the image this template deploys
Implementation Details
Three services on Railway's private network:
| Service | Image | Volume | Public |
|---|---|---|---|
librechat | librechat/librechat:v0.8.7 | /app/uploads | yes |
mongo | mongo:8.3.7-noble | /data/db | no |
meilisearch | getmeili/meilisearch:v1.50.0 | /meili_data | no |
Confirm the app is serving:
curl https:///health
Open your public domain and register the first account, then add your provider API keys from the UI. Registration is open by default so you can create that first account — set ALLOW_REGISTRATION to false afterwards if the instance should not accept public signups.
Search indexing runs against Meilisearch in the background; conversations become searchable shortly after they are created.
Template Content
meilisearch
getmeili/meilisearch:v1.50.0MEILI_ENV
MEILI_HTTP_ADDR
MEILI_NO_ANALYTICS
librechat
librechat/librechat:v0.8.7HOST
PORT
SEARCH
NO_INDEX
ALLOW_EMAIL_LOGIN
ALLOW_REGISTRATION
MEILI_NO_ANALYTICS
mongo
mongo:8.3.7-nobleMONGO_INITDB_ROOT_USERNAME
