Skip to main content

Get Started in 3 Steps

This guide will have you chatting with AI in minutes using Docker.
Prerequisites: Docker and Docker Compose installed on your system.
1

Clone and Configure

Download LibreChat and create your environment file:
git clone https://github.com/danny-avila/LibreChat.git
cd LibreChat
cp .env.example .env
The .env file contains all configuration. You can run LibreChat immediately with defaults, or add your API keys now.
2

Add API Keys (Optional)

Open .env in your text editor and add your API keys:
# OpenAI
OPENAI_API_KEY=sk-your-key-here

# Anthropic (Claude)
ANTHROPIC_API_KEY=sk-ant-your-key-here

# Google (Gemini)
GOOGLE_KEY=your-key-here
You can also set OPENAI_API_KEY=user_provided to let users enter their own keys in the UI.
Connect to local AI models instead of cloud providers:
# In librechat.yaml (create if it doesn't exist)
version: 1.3.4
endpoints:
  custom:
    - name: "Ollama"
      apiKey: "not-needed"
      baseURL: "http://host.docker.internal:11434/v1"
      models:
        default:
          - "llama3.1"
          - "mistral"
Make sure Ollama is running: ollama serve
3

Launch LibreChat

Start all services with Docker Compose:
docker compose up -d
This will:
  • Pull the latest LibreChat image
  • Start MongoDB for data storage
  • Start Meilisearch for conversation search
  • Start the RAG API for file processing
  • Launch LibreChat on port 3080
First launch takes 2-3 minutes to download images and initialize databases. Subsequent starts are much faster.
Check the status:
docker compose logs -f
Wait until you see:
LibreChat | Server listening on port 3080

Access LibreChat

Open your browser and navigate to:
http://localhost:3080
1

Create Your Account

On first visit, you’ll see the registration page.
  1. Enter your email and password
  2. Click Sign up
  3. You’re ready to chat!
The first account created becomes the admin. Subsequent users need to be invited or registration must be enabled in .env.
2

Start Chatting

Select an AI model from the dropdown and start your first conversation:
  1. Click the model selector at the top
  2. Choose an AI provider (OpenAI, Anthropic, Google, etc.)
  3. Select a model (GPT-4, Claude 3.5 Sonnet, Gemini Pro)
  4. Type your message and press Enter
Try asking: “What can you help me with?” to see what your chosen model can do.
3

Explore Features

LibreChat includes powerful features out of the box:
Click the 📎 paperclip icon to:
  • Upload images for vision models (GPT-4o, Claude 3.5 Sonnet)
  • Attach documents for file search and RAG
  • Share context across messages

Quick Configuration Tips

Edit your .env file to add more providers:
# AWS Bedrock (Claude, Llama on AWS)
BEDROCK_AWS_DEFAULT_REGION=us-east-1
BEDROCK_AWS_ACCESS_KEY_ID=your-key
BEDROCK_AWS_SECRET_ACCESS_KEY=your-secret

# Azure OpenAI
# See docs for Azure-specific configuration
# Use librechat.yaml for Azure setup
Restart to apply:
docker compose restart
By default, only the first user can register. To allow more users:
# In .env
ALLOW_REGISTRATION=true
Or invite specific users:
docker compose exec api npm run invite-user
If port 3080 is already in use:
# In .env
PORT=8080
Then in docker-compose.yml, update the ports mapping:
ports:
  - "8080:8080"  # Change both numbers
Restart: docker compose up -d
Enable secure code execution:
# In .env
LIBRECHAT_CODE_API_KEY=your-key-from-code.librechat.ai
Get your API key at code.librechat.aiNow agents can execute Python, JavaScript, and more!

Common Docker Commands

docker compose down

Troubleshooting

  1. Check if containers are running:
docker compose ps
  1. View logs for errors:
docker compose logs api
  1. Ensure port 3080 isn’t already in use:
# Linux/Mac
lsof -i :3080
# Windows
netstat -ano | findstr :3080
If you see “Invalid API key” errors:
  1. Verify your .env file has the correct format:
OPENAI_API_KEY=sk-proj-abc123...  # No spaces, no quotes
  1. Restart after changing .env:
docker compose restart
  1. Check if the key is valid:
If MongoDB fails to start:
# Check MongoDB logs
docker compose logs mongodb

# Reset database (warning: deletes data)
docker compose down
sudo rm -rf data-node/
docker compose up -d
If you see memory errors during build:
  1. Increase Docker memory limit (Docker Desktop → Settings → Resources)
  2. Or reduce memory usage:
# In .env
NODE_OPTIONS="--max-old-space-size=4096"

Next Steps

You’re now running LibreChat! Here’s what to explore next:

Detailed Installation

Learn about local development setup and advanced configuration

Configure AI Endpoints

Set up all supported AI providers and custom models

User Guide

Master LibreChat features and workflows

Create Agents

Build custom AI assistants with tools and capabilities

Enable MCP

Add Model Context Protocol servers for extended functionality

Production Deployment

Deploy LibreChat for production use
Need help? Join our Discord community with 50,000+ users, or check the GitHub discussions.

Build docs developers (and LLMs) love