LibreChat

Docker

How to install LibreChat locally with Docker, verify your setup, and configure custom endpoints

For most scenarios, Docker Compose is the recommended installation method due to its simplicity, ease of use, and reliability.

Prerequisites

Docker Desktop is recommended for most users. For remote server installations, see the Ubuntu Docker Deployment Guide.

Apple Silicon (M-series) Macs

Mac computers with Apple Silicon (M1, M2, M3, M4) processors do not support AVX instructions, which are required by the default MongoDB image used in LibreChat's Docker Compose setup. If you're on an M-series Mac, MongoDB will crash on startup.

Fix: Create a docker-compose.override.yml to use an older, compatible MongoDB image:

services:
  mongodb:
    image: mongo:4.4.18

See the Docker Override guide for more details.

Installation

Clone the Repository

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

Create Your Environment File

cp .env.example .env

The default .env file works out of the box for a basic setup. For in-depth configuration, see the .env reference.

Windows

On Windows, use copy .env.example .env if cp is not available.

Start LibreChat

docker compose up -d

The first launch pulls Docker images and may take a few minutes. Subsequent starts are much faster.

Verify and Log In

Open your browser and visit http://localhost:3080. You should see the LibreChat login page.

First Account = Admin

The first account you register becomes the admin account. There are no default credentials -- you create your own username and password during registration.

Click Register to create your account and start using LibreChat.

Mounting librechat.yaml

To use a custom librechat.yaml configuration file with Docker, you need to mount it as a volume so the container can access it.

Copy the example override file and edit it:

cp docker-compose.override.yml.example docker-compose.override.yml

Ensure the librechat.yaml volume mount is uncommented in docker-compose.override.yml:

services:
  api:
    volumes:
      - type: bind
        source: ./librechat.yaml
        target: /app/librechat.yaml

Restart for changes to take effect:

docker compose down && docker compose up -d

For full setup instructions including creating the file from scratch, see the librechat.yaml guide. For more override options, see the Docker override guide.

Updating LibreChat

The following commands will fetch the latest LibreChat project changes, including any necessary changes to the docker compose files, as well as the latest prebuilt images.

Permissions

You may need to prefix commands with sudo according to your environment permissions.

docker compose down
# Linux/Mac
docker images -a | grep "librechat" | awk '{print $3}' | xargs docker rmi
 
# Windows (PowerShell)
docker images -a --format "{{.ID}}" --filter "reference=*librechat*" | ForEach-Object { docker rmi $_ }
git pull
docker compose pull
docker compose up

Troubleshooting

Port Already in Use

If you see an error like bind: address already in use for port 3080, another application is using that port.

Either stop the conflicting application, or change the port in docker-compose.override.yml:

services:
  api:
    ports:
      - "3081:3080"

Then visit http://localhost:3081 instead.

Container Crashes on Startup

If containers exit immediately after starting, check the logs:

docker compose logs api

Common causes:

  • Invalid librechat.yaml syntax -- validate with the YAML Validator
  • Missing .env file -- ensure .env exists in the project root
  • Docker not running -- ensure Docker Desktop is open and running

Missing Environment Variables

If features are not working as expected, check that required environment variables are set in your .env file.

docker compose exec api env | grep -i "your_variable"

See the .env reference for all available variables and their defaults.

Next Steps

How is this guide?