Deploy LibreChat

LibreChat is a free, open source AI chat platform.

Deploy LibreChat

MongoDB

mongo

Just deployed

/data/db

Just deployed

Just deployed

/meili_data

Just deployed

/var/lib/postgresql/data

Deploy and Host LibreChat on Railway

LibreChat is an open-source AI chat platform that replicates the ChatGPT experience while supporting multiple AI providers. It features a familiar interface with advanced capabilities like multimodal chat, code artifacts, conversation branching, and comprehensive multi-user management.

About Hosting LibreChat

Hosting LibreChat provides a comprehensive AI chat platform that combines the familiar ChatGPT interface with extensive customization and multi-provider support. Built for both individual and enterprise use, it supports OpenAI, Anthropic, Google, local AI services like Ollama, and many others through a unified interface. With features like conversation branching, custom presets, file uploads, generative UI with code artifacts, and robust multi-user authentication, LibreChat offers a complete solution for organizations wanting control over their AI chat infrastructure while maintaining security and flexibility.

Common Use Cases

  • Enterprise AI Chat Platform: Deploy a secure, customizable AI chat interface for teams with role-based access, usage monitoring, and support for multiple AI providers
  • Multi-Model AI Testing: Compare and switch between different AI models (OpenAI, Claude, Gemini, local models) within the same conversation for optimal results
  • Educational AI Environment: Provide students and researchers with access to various AI models through a controlled, monitored interface with conversation management
  • Customer Support Enhancement: Integrate multiple AI capabilities including file analysis, code generation, and multimodal chat for comprehensive customer assistance

Dependencies for LibreChat Hosting

  • MongoDB: Database for storing conversations, users, and configuration data
  • Redis (Optional): For session management and caching to improve performance

Deployment Dependencies

Implementation Details

Key environment variables for deployment:

# Database Configuration
MONGO_URI=your-mongodb-connection-string
REDIS_URI=your-redis-connection-string

# Authentication
JWT_SECRET=your-jwt-secret
JWT_REFRESH_SECRET=your-refresh-secret

# AI Provider API Keys
OPENAI_API_KEY=your-openai-key
ANTHROPIC_API_KEY=your-claude-key
GOOGLE_KEY=your-google-key

# Optional: Email verification
EMAIL_SERVICE=your-email-provider
EMAIL_USERNAME=your-email
EMAIL_PASSWORD=your-email-password

# Security
ALLOW_EMAIL_LOGIN=true
ALLOW_REGISTRATION=true
ALLOW_SOCIAL_LOGIN=false

Upgrading an existing deployment to v0.8.8

LibreChat v0.8.8 is published at ghcr.io/librechat-ai/librechat; the project moved from the danny-avila namespace, which stops at v0.8.7.

v0.8.8 refuses to start unless CREDS_KEY is exactly 64 hexadecimal characters. This template now generates CREDS_KEY (64 hex) and CREDS_IV (32 hex) in that format. Deployments created from an earlier version of this template received keys that are not hexadecimal, so before changing the image set CREDS_KEY to the output of openssl rand -hex 32 and CREDS_IV to the output of openssl rand -hex 16. Credentials stored under the old key, such as user-provided provider API keys, must be entered again afterwards.

Meilisearch stays pinned: it will not start on a data volume written by a different version unless MEILI_UPGRADE_DB=true is set.

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

MongoDB

mongo

More templates in this category

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

okisdev
117
View Template
NEW
Weaviate
Vector database with hybrid search and an API key-protected API

zer0person
1
View Template
Möbius v0.1 Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1