Deploy LibreChat | Stable Release, Working Schedules, Uploads in a Bucket

Self-host LibreChat on Railway — stable release, uploads in a Bucket.

Deploy LibreChat | Stable Release, Working Schedules, Uploads in a Bucket

Just deployed

/meili_data

Just deployed

/data/db

Just deployed

Bucket

Bucket

Just deployed

Deploy and Host LibreChat on Railway

LibreChat, the open-source chat interface for OpenAI, Anthropic, Google and other models, self-hosted on its stable release with MongoDB, Meilisearch and a Railway Bucket for uploads. Every image is pinned.

Nothing to fill in. Open the domain, create the first account, and add your model keys in the chat settings.

About Hosting LibreChat

Four pieces, wired the way LibreChat's own compose file does it, adapted for this platform:

  • LibreChat v0.8.7, the stable release rather than the nightly librechat-dev:latest build (public)
  • MongoDB 8.0: accounts, conversations and settings, on its own volume, with authentication
  • Meilisearch: full-text search across your conversations, on its own volume
  • Bucket: Railway object storage for avatars, images and files you upload

Model keys are entered per user in the chat, so one deployment can serve a team where everyone brings their own key.

Common Use Cases

  • One chat for every model: GPT, Claude and Gemini side by side, switching mid-conversation.
  • A private ChatGPT for a team, with accounts, shared agents and conversation history in your own database.
  • Agents and scheduled prompts, with tools from MCP servers you configure.

Dependencies for LibreChat Hosting

Deployment Dependencies

  • LibreChat ghcr.io/danny-avila/librechat:v0.8.7 (public)
  • MongoDB mongo:8.0.20
  • Meilisearch getmeili/meilisearch:v1.35.1
  • A Railway Bucket
  • LibreChat, by Danny Avila and contributors, MIT. This template only configures the published image; its librechat.yaml lives in ak40u/librechat-railway-starter, pinned to a commit.

Implementation Details

  • Stable release, every image pinned. The common LibreChat template runs the nightly librechat-dev:latest and an untagged mongo, so what you deploy depends on the day you deploy it.
  • Scheduled prompts work. LibreChat refuses to arm its scheduler unless it is told it runs as a single replica, and every schedule write answers 503. SCHEDULES_SINGLE_PROCESS=true is set, which is what one Railway service is.
  • Uploads survive redeploys. The container's disk is wiped on every deploy, and the image runs as a non-root user that cannot write to a Railway volume. librechat.yaml switches file storage to S3, and the bucket's credentials arrive through the AWS_* variables; LibreChat hands out short-lived signed links to the files.
  • LibreChat waits for its databases. On a cold start the app can come up before MongoDB, crash on ECONNREFUSED, and after the restart hang without ever passing the health check. The start command waits until MongoDB and Meilisearch accept connections.
  • No RAG API. LibreChat's RAG service crashes at start without an embeddings key, so templates that include it ship a placeholder key and a document search that fails on first use. Here it is left out; LibreChat hides file search instead of breaking it. To add it, deploy ghcr.io/danny-avila/librechat-rag-api-dev-lite with Postgres and pgvector and set RAG_API_URL, following LibreChat's RAG documentation.

Configuration

CREDS_KEY, CREDS_IV, both JWT secrets, the MongoDB password and the Meilisearch key are generated. DOMAIN_CLIENT and DOMAIN_SERVER follow the public domain.

Registration is open so that you can create the first account. After that, set ALLOW_REGISTRATION=false on the LibreChat service unless you want anyone with the link to sign up.

To give everyone a shared key instead of their own, replace user_provided in OPENAI_API_KEY, ANTHROPIC_API_KEY or GOOGLE_KEY with the key itself.

Verification

Deployed from this template into an empty project, all services starting at once on fresh volumes: everything came up in under a minute and a half, with no ECONNREFUSED restart. LibreChat loaded librechat.yaml, initialised S3 with the bucket's credentials, armed the scheduler without the single-replica error, and connected to MongoDB with authentication. /health, the login page and /api/config answer 200, and the generated CREDS_KEY and CREDS_IV come out as the hex strings LibreChat requires.

Redeployed with LibreChat capped at the Free plan's 0.5 GB and 1 vCPU, it settled at about 0.37 GB and stayed up without restarts.

Locally, on the same image with the same librechat.yaml and a real Railway Bucket: registration, sign-in, and an avatar upload that landed in the bucket and came back through a signed link. Sign-up was not driven on the Railway deployment itself, and chatting needs a model key, which was not used during testing.

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.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
116
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
7
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
82