Skip to main content

Installation Methods

Choose the installation method that best fits your needs:

Docker (Recommended)

Production-ready deployment with all dependencies managed

Local Development

For contributing or custom development work

Docker Installation

Docker is the recommended way to run LibreChat. It handles all dependencies and ensures consistent behavior across systems.

Prerequisites

1

Install Docker

You need Docker and Docker Compose installed:
  1. Download Docker Desktop for Windows
  2. Run the installer
  3. Restart your computer
  4. Verify installation:
docker --version
docker compose version
Minimum Requirements:
  • 4GB RAM (8GB+ recommended)
  • 10GB disk space
  • Docker Engine 20.10+ and Docker Compose 2.0+
2

Clone the Repository

Download LibreChat from GitHub:
git clone https://github.com/danny-avila/LibreChat.git
cd LibreChat
To install a specific version:
git clone --branch v0.8.3 https://github.com/danny-avila/LibreChat.git

Configuration

1

Create Environment File

Copy the example environment file:
cp .env.example .env
The .env file contains all configuration options. Key settings:
# Server Configuration
HOST=localhost
PORT=3080
MONGO_URI=mongodb://mongodb:27017/LibreChat

# Security (change these!)
JWT_SECRET=16f8c0ef4a5d391b26034086c628469d3f9f497f08163ab9b40137092f2909ef
JWT_REFRESH_SECRET=eaa5191f2914e30b9387fd84e254e4ba6fc51b4654968a9b0803b456a54b8418
CREDS_KEY=f34be427ebb29de8d88c107a71546019685ed8b241d8f2ed00c3df97ad2566f0
CREDS_IV=e2341419ec3dd3d19b13a1a87fafcbfb

# Meilisearch (for conversation search)
MEILI_MASTER_KEY=DrhYf7zENyR6AlUCKmnz0eYASOQdl6zxH7s7MKFSfFCt
Security: Generate new secrets for production:
# Generate secure random strings
openssl rand -hex 32
Replace the default JWT_SECRET, JWT_REFRESH_SECRET, CREDS_KEY, CREDS_IV, and MEILI_MASTER_KEY values.
2

Configure AI Providers

Add your API keys to .env:
OPENAI_API_KEY=sk-proj-your-key-here
# Or allow users to provide their own:
OPENAI_API_KEY=user_provided
For local or custom AI providers, create librechat.yaml:
version: 1.3.4
cache: true

endpoints:
  custom:
    # Ollama
    - name: "Ollama"
      apiKey: "ollama"
      baseURL: "http://host.docker.internal:11434/v1"
      models:
        default:
          - "llama3.1:latest"
          - "mistral:latest"
          - "qwen2.5:latest"
      titleConvo: true
      titleModel: "llama3.1:latest"

    # LM Studio
    - name: "LM Studio"
      apiKey: "lm-studio"
      baseURL: "http://host.docker.internal:1234/v1"
      models:
        default:
          - "local-model"

    # Any OpenAI-compatible API
    - name: "Custom API"
      apiKey: "${CUSTOM_API_KEY}"
      baseURL: "https://api.example.com/v1"
      models:
        default:
          - "custom-model-1"
host.docker.internal allows Docker containers to access services on your host machine.
3

Set User Permissions (Linux)

On Linux, set the user ID and group ID for proper file permissions:
# Add to .env
UID=1000
GID=1000
To find your UID/GID:
echo "UID=$(id -u)"
echo "GID=$(id -g)"

Launch LibreChat

1

Start Services

Launch all containers:
docker compose up -d
This command:
  1. Downloads required Docker images (LibreChat, MongoDB, Meilisearch, RAG API)
  2. Creates containers and networks
  3. Initializes databases
  4. Starts all services in the background
First run takes 2-5 minutes to download ~2GB of images and initialize databases.
2

Monitor Startup

Watch the logs to confirm successful startup:
docker compose logs -f
Wait for:
LibreChat | Server listening on port 3080
chat-mongodb | Waiting for connections
chat-meilisearch | MeiliSearch is ready
Press Ctrl+C to exit logs (services continue running).
3

Access the Application

Open your browser to:
http://localhost:3080
Create your admin account on first visit.
The first registered user becomes the admin. Secure your instance before making it publicly accessible.

Docker Compose Services

The docker-compose.yml file defines these services:
Main application server:
  • Image: registry.librechat.ai/danny-avila/librechat-dev:latest
  • Port: 3080
  • Volumes: .env, images/, uploads/, logs/
  • Depends on: MongoDB, Meilisearch, RAG API
services:
  api:
    container_name: LibreChat
    ports:
      - "${PORT}:${PORT}"
    image: registry.librechat.ai/danny-avila/librechat-dev:latest
    restart: always
    environment:
      - MONGO_URI=mongodb://mongodb:27017/LibreChat
      - MEILI_HOST=http://meilisearch:7700
    volumes:
      - ./.env:/app/.env
      - ./images:/app/client/public/images
      - ./uploads:/app/uploads
      - ./logs:/app/logs
Database for conversations, users, and settings:
  • Image: mongo:8.0.17
  • Port: 27017 (internal)
  • Volume: ./data-node
  • Command: mongod --noauth
Data persists in ./data-node/ directory.
Full-text search engine for conversations:
  • Image: getmeili/meilisearch:v1.35.1
  • Port: 7700 (internal)
  • Volume: ./meili_data_v1.35.1
  • Master Key: From MEILI_MASTER_KEY in .env
Powers the conversation search feature (Ctrl+K).
RAG (Retrieval-Augmented Generation) API:
  • Image: registry.librechat.ai/danny-avila/librechat-rag-api-dev-lite:latest
  • Port: 8000
  • Depends on: vectordb (PostgreSQL with pgvector)
Handles file processing, embeddings, and vector search for file-based conversations.
Vector database for RAG:
  • Image: pgvector/pgvector:0.8.0-pg15-trixie
  • Port: 5432 (internal)
  • Volume: pgdata2
Stores document embeddings for semantic search.

Docker Management

docker compose down

Custom Docker Overrides

To customize Docker Compose without editing the main file:
cp docker-compose.override.yml.example docker-compose.override.yml
Edit docker-compose.override.yml to add custom configurations:
services:
  api:
    environment:
      - CUSTOM_VAR=value
    volumes:
      - ./custom:/app/custom
Docker Compose automatically merges override files.

Post-Installation

First-Time Setup

1

Create Admin Account

The first registered user becomes the admin:
  1. Visit http://localhost:3080
  2. Click Sign up
  3. Enter email and password
  4. Register
Subsequent users need to be invited or you must enable public registration.
2

Configure User Access

Control who can register:
# In .env

# Allow anyone to register
ALLOW_REGISTRATION=true

# Or invite specific users
ALLOW_REGISTRATION=false
Invite users via CLI:
# Docker
docker compose exec api npm run invite-user

# Local
npm run invite-user
3

Test AI Integration

Verify your AI providers work:
  1. Click the model selector dropdown
  2. Select a provider (OpenAI, Anthropic, etc.)
  3. Choose a model
  4. Send a test message: “Hello!”
If you see errors, check:
  • API keys are correct in .env
  • API keys have sufficient credits
  • Network connectivity to AI providers

Optional Features

# In .env
LIBRECHAT_CODE_API_KEY=your-key-from-code.librechat.ai
Sign up at code.librechat.ai for API access.Now agents can execute Python, Node.js, Go, Java, PHP, Rust, and Fortran code securely.
By default, files are stored locally. Configure S3 or Firebase:
# In .env
AWS_ACCESS_KEY_ID=your-key
AWS_SECRET_ACCESS_KEY=your-secret
AWS_REGION=us-east-1
AWS_BUCKET_NAME=librechat-files
# In librechat.yaml
fileStrategy:
  avatar: "s3"
  image: "s3"
  document: "s3"
Configure OAuth providers:
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-secret
GOOGLE_CALLBACK_URL=/oauth/google/callback

Next Steps

Your LibreChat installation is complete! Here’s what to explore:

Configuration Guide

Deep dive into librechat.yaml and advanced settings

AI Endpoints

Configure all AI providers and custom models

Create Agents

Build custom AI assistants with tools and knowledge

Enable MCP

Add Model Context Protocol servers

User Management

Manage users, roles, and permissions

Production Deployment

Deploy LibreChat to production
Need help?

Build docs developers (and LLMs) love