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:
See the Docker Override guide for more details.
Installation
Create Your Environment File
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
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:
Ensure the librechat.yaml volume mount is uncommented in docker-compose.override.yml:
Restart for changes to take effect:
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.
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:
Then visit http://localhost:3081 instead.
Container Crashes on Startup
If containers exit immediately after starting, check the logs:
Common causes:
- Invalid
librechat.yamlsyntax -- validate with the YAML Validator - Missing
.envfile -- ensure.envexists 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.
See the .env reference for all available variables and their defaults.
Next Steps
How is this guide?