LibreChat: How to Self-Host It with Docker on Windows and Mac
By Shah Rukh, software developer · · 7 min read
LibreChat is a free, open-source chat app that looks like ChatGPT but runs on your own computer and can talk to many AI providers from one screen. This guide shows how to run it with Docker on a Windows PC or a Mac, what it really costs, and what to check before you start.
Read this first. LibreChat is only the chat interface. It does not include any AI model. The answers come from a provider such as OpenAI, Anthropic or Google, and their API keys are normally paid, charged by usage. The only way to avoid that is a free tier from some provider or a local model on your own machine. LibreChat is an independent project and is not made by any of those companies.
What LibreChat is
The project describes itself as “a self-hosted AI chat platform that unifies all major AI providers in a single, privacy-focused interface”. Self-hosted means you run the software yourself instead of using someone’s website.
The version in the repository is v0.8.8, and it is released under the MIT licence, which allows free use, including commercial use. The README lists support for Anthropic (Claude), OpenAI, Azure OpenAI, Google, Vertex AI and AWS Bedrock, plus “custom endpoints” for any OpenAI-compatible service such as Ollama, Groq, Mistral, OpenRouter and Deepseek.
Beyond plain chat, the project lists agents (custom assistants you build without code), file uploads, web search, image generation, speech, conversation import and export, and multi-user login. Many of these need extra keys or setup.
With Docker, LibreChat is not one program. The default docker-compose.yml file starts six containers (small isolated programs):
| Container | What it does |
|---|---|
LibreChat | The chat app itself, on port 3080 |
admin-panel | A browser page for managing users and settings, on port 3000 |
chat-mongodb | The database that stores accounts and chats |
chat-meilisearch | Search engine for your messages |
vectordb and rag_api | Used for chatting with uploaded files |
What you need
- A Windows PC or a Mac with Docker Desktop installed and running. Docker Desktop is free for personal use.
- Git, to download the project.
- A text editor such as Notepad or TextEdit.
- At least one AI provider key, or a local model. This is where the cost is. Check the provider’s own pricing page, because the repository does not list prices.
The repository does not state minimum RAM or disk space. Six containers and several downloaded images are a real load, so an older laptop with little memory may struggle. You do not need a graphics card unless you also run a local model.
You do not need Node.js for the Docker method. The project’s .nvmrc file names Node 24.16.0, but that is only for people who run it without Docker.
Precautions before you install
- Use the real repository. Clone only from github.com/LibreChat-AI/LibreChat. Popular projects attract fake copies.
- The first account becomes the admin. In the code, the first user who registers gets the admin role, and
ALLOW_REGISTRATION=trueis the default. Create your own account straight after the first start. - The ports are open to your network. The compose file publishes ports 3080 and 3000 without limiting them to your own computer. On hostel, office or café Wi-Fi, other people may be able to open your sign-up page. Use a trusted network, keep your firewall on, and turn registration off once your account exists (see below).
- Your chats still go to the AI provider. Self-hosting keeps your chat history on your own disk, but every message and uploaded file you send to a cloud model goes to that company. Don’t paste passwords or client data.
- Protect the
.envfile. It holds your secrets and any keys you add. Never share it or upload it to GitHub. - Don’t expose the databases. The bundled MongoDB runs with no password (
--noauth) and the file database uses the sample passwordmypassword. That is acceptable only because their ports are not published. Don’t add port mappings for them. - The default image is a development build. The compose file pulls
librechat-dev:latest. It gets the newest changes, and sometimes the newest bugs.
How to install LibreChat with Docker on Windows
The README does not print install steps. It points to the project’s documentation site. The steps below follow the compose file and .env.example in the repository.
- Start Docker Desktop and wait until it says it is running.
- Open PowerShell from the Start menu and download the project:
git clone https://github.com/LibreChat-AI/LibreChat.git cd LibreChat
- Make your settings file by copying the example:
copy .env.example .env
- Open it in Notepad:
notepad .env
- Find the line
ADMIN_PANEL_SESSION_SECRET=and put a random value of at least 32 characters after the equals sign. The compose file notes that the admin panel refuses to start without it. Save and close. - Start everything:
docker compose up -d
The first start downloads all the images, so it can take a while on a slow connection.
How to install LibreChat with Docker on Mac
The steps are the same. Only two commands differ.
- Start Docker Desktop.
- Open Terminal (Cmd + Space, type Terminal) and run:
git clone https://github.com/LibreChat-AI/LibreChat.git cd LibreChat cp .env.example .env
- Create the random secret with the command the project suggests, and copy the output:
openssl rand -hex 32
- Open the settings file, paste the value after
ADMIN_PANEL_SESSION_SECRET=and save:open -e .env
- Start everything:
docker compose up -d
If you see file-permission errors, note that .env.example has two commented lines, UID=1000 and GID=1000, which the compose file uses for the user the containers run as. The repository does not explain when to change them, so check the project’s documentation.
First use: create your account and add a key
- Open
http://localhost:3080in your browser. - Click the sign-up link and register with an email and password. The account is stored only in your local database, and it becomes the admin.
- Pick a provider in the model menu. In
.env.example,OPENAI_API_KEY,ANTHROPIC_API_KEYandGOOGLE_KEYare set touser_provided, so the app expects each user to enter their own key in the interface. - Send a short test message.
If you would rather set one key for everyone, replace user_provided with the key in .env and restart. The admin panel is at http://localhost:3000.
Useful settings in the .env file
| Setting | Default | What it does |
|---|---|---|
ALLOW_REGISTRATION | true | Set to false after you sign up, so nobody else can create an account |
PORT | 3080 | The port the chat app uses |
ADMIN_PANEL_PORT | 3000 | The port for the admin panel |
SEARCH | false | Message search. Needs SEARCH=true and a unique MEILI_MASTER_KEY |
CREDS_KEY, CREDS_IV, JWT_SECRET, JWT_REFRESH_SECRET | blank | If blank, LibreChat generates temporary values. The file says to set your own before any production use |
After changing .env, run docker compose down and then docker compose up -d.
Other providers and local models: services such as Groq, OpenRouter or Ollama are added in a second file, librechat.yaml. The repository includes librechat.example.yaml as a starting point, and docker-compose.override.yml.example shows how to load it: you save a copy as docker-compose.override.yaml and uncomment the “USE LIBRECHAT CONFIG FILE” section. The same file shows how to switch to the numbered release image, registry.librechat.ai/librechat-ai/librechat:latest. The project asks you not to edit docker-compose.yml directly.
How to stop, update and remove LibreChat
To stop it, run docker compose down inside the LibreChat folder. Your chats stay in the data-node folder, and uploads in uploads and images.
To update, the README asks you to read the changelog for breaking changes first. The repository also has an UPGRADING.md file, which says to back up MongoDB before database migrations. Copy the data-node folder while the app is stopped. Then:
docker compose down git pull origin main docker compose pull docker compose up -d
The project also ships a script, npm run update:docker, but it needs Node.js installed and rebuilds the image on your machine.
The repository does not document an uninstall. Stopping the containers and deleting the LibreChat folder removes the app and your chat history. Unused images can be cleaned up from Docker Desktop.
Common problems
| Problem | What to try |
|---|---|
| “Docker is not running” or cannot connect to Docker | Open Docker Desktop, wait for it to finish starting, then run the command again. |
Error about a missing .env file | You skipped the copy step. Copy .env.example to .env inside the LibreChat folder. |
| The admin panel at port 3000 will not open | Set ADMIN_PANEL_SESSION_SECRET to at least 32 characters and restart. |
| Port 3080 or 3000 is already in use | Change PORT or ADMIN_PANEL_PORT in .env. If you change PORT, update DOMAIN_CLIENT and DOMAIN_SERVER to match. |
| The model replies with a key or billing error | Check the key and that your provider account has credit. LibreChat cannot fix provider billing. |
| Search finds nothing | Search is off by default. Set SEARCH=true and a MEILI_MASTER_KEY. |
| MongoDB container keeps restarting on an old PC | The override example offers mongo:4.4.18 “for older CPU without AVX support”. |
To see what went wrong, run docker compose logs api, or look in the logs folder. You can report bugs on the project’s GitHub issues page.
This guide is based on the project’s repository as it was on October 2, 2026. The project changes often, so if a step looks different, follow the official documentation linked from the README. ToolsCloset is not connected to the project or to any AI provider named here.
Frequently asked questions
Is LibreChat free?
The LibreChat software is free and open source under the MIT licence. The AI models are not part of it. You pay the provider you connect, such as OpenAI, Anthropic or Google, unless you use a free tier or a local model.
Does LibreChat give me ChatGPT or Claude for free?
No. It is a chat interface only. To use those models you need your own API key from the provider, and API usage is normally paid.
Can I run LibreChat on Windows?
Yes, with Docker Desktop. The repository’s update script mentions Docker Desktop, and the Docker Compose file works the same way on Windows and Mac.
What port does LibreChat use?
The chat app uses port 3080 by default, so you open http://localhost:3080. The bundled admin panel uses port 3000. Both can be changed in the .env file.
Is LibreChat private?
Your accounts and chat history are stored on your own computer. But any message you send to a cloud model goes to that provider. For fully local chats you need a local model such as one served by Ollama.
Where are my LibreChat chats stored?
With the default Docker setup, the MongoDB database is kept in the data-node folder inside the LibreChat folder. Uploaded files are in the uploads and images folders. Back these up before updating.
How do I stop other people signing up on my LibreChat?
After creating your own account, set ALLOW_REGISTRATION=false in the .env file and restart the containers with docker compose down and docker compose up -d.
More AI tips
EmailOSINT Review and Guide
See which accounts, data breaches and stolen-password logs are tied to your email, and what to do about each result.
Free Claude Code Setup Guide
Run the Claude Code app with free AI models on Windows or Mac. Full steps, plus the precautions most guides skip.
OpenHands Agent Canvas Guide
Set up the OpenHands control centre for AI coding agents on Windows or Mac, with the safety steps to take first.
Dify Self-Hosting Guide
Run the Dify AI app builder on your own computer with Docker Compose, and know the costs and licence limits first.
Unity MCP Setup Guide
Let Claude Code, Cursor or Copilot work inside the Unity Editor. Full install steps, plus the precautions to take first.
sprite-gen Setup Guide
Turn one character drawing into a transparent game sprite sheet. Setup steps, real costs and precautions.
Logo Design Skill Setup Guide
Add a free logo-design skill to Claude or another AI agent on Windows or Mac, with the precautions to take first.
Openvid Screen Demo Guide
Record your screen and turn it into a polished demo in the browser, or run Openvid yourself on Windows or Mac.
ReelMimic Setup Guide
Set up ReelMimic to make an original 2D animation in the style of a reference video, with the copyright checks to do first.