Deployment guide

How to Host LibreChat on a VPS

Deploy on a VPS Cloud →

Artificial Intelligence9 min read

How to Host LibreChat on a VPS

LibreChat reproduces the ChatGPT experience in open source, but multi-provider: OpenAI, Anthropic, Google, or your local models, in the same interface. Self-hosted on a VPS, it offers your team a private, multi-user conversational assistant, with access management and history under your control. Here is how to deploy it.

Why self-host LibreChat on a VPS

LibreChat is a chat interface, not an inference engine: its value is to centralize several LLM providers behind a polished UI, with authentication, user management, presets, and a RAG module to chat with your documents. For a company, distributing individual ChatGPT accounts is expensive and scatters the data. With LibreChat on a VPS, you pool access: a single API key per provider, internal accounts that you manage, and all conversation history in your own MongoDB. You decide which models are available, you can plug in a local Ollama for zero-cloud, and you keep full control of the data exchanged.

The concrete benefits of a self-hosted LibreChat

  • A single interface for OpenAI, Anthropic, Google and your local models.
  • Internal accounts and roles managed by you, without individual subscriptions per employee.
  • Conversation history stored in your MongoDB, never with a third party.
  • Pooled API keys: a single provider access shared by the whole team.
  • Built-in RAG module to query your own documents.
  • Fine control over the exposed models and the default parameters.

Hardware and software requirements

LibreChat relies on several services (the app, MongoDB, Meilisearch for search, and the RAG API). Count on 2 vCPU and 4 GB of RAM for a modest team using cloud APIs; move to 4 vCPU / 8 GB if you enable RAG with local embeddings or an Ollama on the same machine. Plan for 15 to 20 GB of disk for MongoDB and the indexes. Docker and Docker Compose are indispensable because LibreChat deploys as a multi-container stack. Add a subdomain (e.g. chat.your-domain.com), port 443 open, and the API keys of the providers you plan to offer.

Deploy LibreChat with Docker, MongoDB and HTTPS

01

Clone the repository and prepare the config

Over SSH: git clone https://github.com/danny-avila/LibreChat && cd LibreChat. Copy the environment example: cp .env.example .env. The project already provides a docker-compose.yml orchestrating the app, MongoDB and Meilisearch.

02

Configure the .env

Fill in your keys (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.), generate the JWT_SECRET and CREDS_KEY secrets, and set ALLOW_REGISTRATION=false if you want to create accounts manually rather than opening registration.

03

Launch the stack

Start with docker compose up -d. Check that all containers are healthy via docker compose ps. The app listens internally on port 3080.

04

Configure librechat.yaml (models and RAG)

To add custom endpoints (local Ollama, groq, etc.) or enable RAG, create a librechat.yaml file. For example, point a custom endpoint to http://host.docker.internal:11434/v1 to connect your Ollama.

05

Set up the reverse proxy

Route chat.your-domain.com to localhost:3080 via Caddy or Nginx, with Let's Encrypt. Enable WebSocket support and increase the timeouts so as not to cut off long streaming responses.

06

Create the accounts and test

Create the first user, log in, select a model and send a message. If RAG is enabled, upload a document in a conversation and check that the answers rely on it.

LibreChat or AnythingLLM: which to choose?

CriterionLibreChatAnythingLLM
Main purposeMulti-provider chat interfaceRAG engine over documents
Multi-models in one UIExcellent (OpenAI, Anthropic, Google, local)Good, but centered on one provider per workspace
RAG over documentsAdditional module to configureCore of the product, ready to use
Multi-user managementNative accounts and rolesMulti-user mode and partitioned workspaces
Deployment architectureMulti-container stack (Mongo, Meili, RAG)Single container + vector database
Data storageSelf-hosted MongoDBstorage volume + LanceDB/Qdrant
Ideal use caseTeam conversational assistantQueryable knowledge base
Resource footprintHeavier (several services)Lighter at startup

For a zero-cloud deployment, combine LibreChat with an Ollama hosted on the same VPS: declare a custom endpoint in librechat.yaml pointing to Ollama's OpenAI-compatible API. You thus get LibreChat's ergonomics with 100% local models, without any external key or data leaving the server. Remember to set the proxy timeouts accordingly, as CPU inference is slower.

Give your team a private ChatGPT on a ServOrbit Cloud VPS

The ServOrbit Cloud VPS provides the Docker environment and the resources to deploy the full LibreChat stack, MongoDB included. Scale on demand as your team grows.

Need help?

Browse our help center and FAQ, or write to our team — support in French, English and Arabic.