Skip to content

Latest commit

 

History

History
140 lines (100 loc) · 6.39 KB

docker_compose_install.md

File metadata and controls

140 lines (100 loc) · 6.39 KB
title weight
🐳 Docker Compose ✨(Recommended)
-10

Docker Compose Installation Guide

Docker Compose installation is recommended for most use cases. It's the easiest, simplest, and most reliable method to get started.

If you prefer to watch a video, we have video guides for Windows and Ubuntu 22.04 LTS

Installation and Configuration

Preparation

Start by cloning the repository or downloading it to your desired location:

  git clone https://github.com/danny-avila/LibreChat.git

Docker Installation

Install Docker on your system. Docker Desktop is recommended for managing your Docker containers.

LibreChat Configuration

Before running LibreChat with Docker, you need to configure some settings:

  • Edit the credentials you see in docker-compose.yml under the API service as needed.
    • See my notes below for specific instructions on some of the configuration
  • Provide all necessary credentials in the .env file before the next step.
    • Docker will read this env file. See the .env.example file for reference.

AI Setup (Required)

At least one AI endpoint should be setup for use.

Safely access and manage your MongoDB database using Mongo Express

How to set up the user/auth system and Google login.

Running LibreChat

Once you have completed all the setup, you can start the LibreChat application by running the command docker-compose up in your terminal. After running this command, you can access the LibreChat application at http://localhost:3080.

If you build your own containers out of the git checkout with docker-compose up --build you should pre-create the mount points for the volumes. This avoids occasional trouble with directory permissions when rebuilding:

mkdir meili_data images .env.production .env.development data-node

Note: MongoDB does not support older ARM CPUs like those found in Raspberry Pis. However, you can make it work by setting MongoDB’s version to mongo:4.4.18 in docker-compose.yml, the most recent version compatible with

That's it! If you need more detailed information on configuring your compose file, see my notes below.

Updating LibreChat

  • Run npm run update from the project directory for a clean installation.

If you're having issues running this command, you can try running what the script does manually:

Prefix commands with sudo according to your environment permissions.

# Stop the container (if running)
docker-compose down
# Fetch the latest changes from Github
git fetch origin
# Switch to the repo's main branch
git checkout main
# Pull the latest changes to the main branch from Github
git pull origin main
# Prune all LibreChat Docker images
docker rmi librechat:latest
# Remove all unused dangling Docker images
docker image prune -f
# Building a new LibreChat image without cache
docker-compose build --no-cache

# Start LibreChat
docker-compose up

Advanced Settings

Config notes for docker-compose.yml file

Modification to the docker-compose.yml should be made with docker-compose.override.yml whenever possible to prevent conflicts when updating. You can create a new file named docker-compose.override.yml in the same directory as your main docker-compose.yml file for LibreChat, where you can set your .env variables as needed under environment, or modify the default configuration provided by the main docker-compose.yml, without the need to directly edit or duplicate the whole file.

For more info see:

    env_file:
      - .env
    environment:
      - HOST=0.0.0.0
      - MONGO_URI=mongodb://mongodb:27017/LibreChat
# ...
      - MEILI_HOST=http://meilisearch:7700
      - MEILI_HTTP_ADDR=meilisearch:7700
# ...
    env_file:
      - .env
    environment:
      - MEILI_HOST=http://meilisearch:7700
      - MEILI_HTTP_ADDR=meilisearch:7700
  • If for some reason you're not able to build the app image, you can pull the latest image from Dockerhub.
  • Create a new file named docker-compose.override.yml in the same directory as your main docker-compose.yml with this content:
version: '3.4'

services:
  api:
    image: ghcr.io/danny-avila/librechat-dev:latest
  • Then use docker-compose build as you would normally

  • Note: There are different Dockerhub images. the librechat:latest image is only updated with new release tags, so it may not have the latest changes to the main branch. To get the latest changes you can use librechat-dev:latest instead

Create a MongoDB database (Not required if you'd like to use the local database installed by Docker)


⚠️ Note: If you're having trouble, before creating a new issue, please search for similar ones on our #issues thread on our discord or our troubleshooting discussion on our Discussions page. If you don't find a relevant issue, feel free to create a new one and provide as much detail as possible.