mirror of
https://github.com/LibreChat-AI/librechat.ai.git
synced 2026-03-27 18:58:32 +07:00
* ✨ v0.8.3-rc2
- Added new `document_parser` OCR strategy for local text extraction from various document formats.
- Introduced `thinkingLevel` parameter for Gemini 3+ models to control thinking effort.
- Added `reasoning_effort` parameter for Bedrock models to configure reasoning capabilities.
- Enabled document uploads for Bedrock endpoints.
- Updated default model lists to include new Gemini models.
- Changed date template variable format for improved readability.
- Updated OpenRouter reasoning configuration to align with API changes.
- Bumped configuration version to 1.3.5 across multiple documentation files.
* docs: enhance `document_parser` functionality and update OCR configuration details
- Updated the `document_parser` to run automatically for agent file uploads without requiring an `ocr` configuration, providing seamless text extraction from supported document types.
- Added fallback logic for the `document_parser` when a configured OCR strategy fails, ensuring text extraction remains effective.
- Expanded documentation to clarify the automatic operation of the `document_parser` and its limitations regarding image-based documents.
* chore: update changelog for v0.8.3-rc2
- Added new features including credential variables for DB-sourced MCP servers, updates for the `gemini-3.1-flash-lite-preview` window and pricing, and the introduction of gpt-5.3 context window and pricing.
- Enhanced agent editor functionality by allowing duplication of agents.
- Implemented fixes for OIDC logout, post-auth navigation, and URL query parameter preservation.
- Updated various dependencies and improved internationalization with new translations.
* docs: add credential variables support for UI-created MCP servers
- Introduced a new section detailing how users can provide their own API keys when adding MCP servers through the UI.
- Explained the creation of `customUserVars` for user-provided API keys and the security measures in place to prevent unauthorized access to sensitive data.
- Updated documentation to enhance clarity on the configuration process for MCP servers.
* chore: update changelog for v0.8.3-rc2
- Added new features including expanded toolkit definitions for child tools in event-driven mode and consistent Mermaid theming for inline and artifact renderers.
- Updated the Agent Tool with new SVG assets for improved visual representation.
* chore: update changelog for v1.3.5
- Updated release date to 2026-03-04.
- Adjusted date template variable format to reflect the new date and include named weekdays.
- Updated OpenRouter reasoning configuration to align with API changes.
435 lines
16 KiB
Plaintext
435 lines
16 KiB
Plaintext
---
|
|
title: Docker (Remote Linux)
|
|
icon: Container
|
|
description: These instructions are designed for someone starting from scratch for a Docker Installation on a remote Ubuntu server
|
|
---
|
|
|
|
In order to use this guide you need a remote computer or VM deployed. While you can use this guide with a local installation, keep in mind that it was originally written for cloud deployment.
|
|
|
|
> ⚠️ This guide was originally designed for [Digital Ocean](/docs/remote/digitalocean), so you may have to modify the instruction for other platforms, but the main idea remains unchanged.
|
|
|
|
## Part I: Installing Docker and Other Dependencies:
|
|
|
|
There are many ways to setup Docker on Linux systems. I'll walk you through the best and the recommended way [based on this guide](https://www.smarthomebeginner.com/install-docker-on-ubuntu-22-04/).
|
|
|
|
> Note that the "Best" way for Ubuntu docker installation does not mean the "fastest" or the "easiest". It means, the best way to install it for long-term benefit (i.e. faster updates, security patches, etc.).
|
|
|
|
### **1. Update and Install Docker Dependencies**
|
|
|
|
First, let's update our packages list and install the required docker dependencies.
|
|
|
|
```bash
|
|
sudo apt update
|
|
```
|
|
|
|
Then, use the following command to install the dependencies or pre-requisite packages.
|
|
|
|
```bash
|
|
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release
|
|
```
|
|
|
|
#### **Installation Notes**
|
|
|
|
- Input "Y" for all [Y/n] (yes/no) terminal prompts throughout this entire guide.
|
|
- After the first [Y/n] prompt, you will get the first of a few **purple screens** asking to restart services.
|
|
- Each time this happens, you can safely press ENTER for the default, already selected options:
|
|
|
|

|
|
|
|
- If at any point your droplet console disconnects, do the following and then pick up where you left off:
|
|
- Access the console again as indicated above
|
|
- Switch to the user you created with `su - <yourusername>`
|
|
|
|
### **2. Add Docker Repository to APT Sources**
|
|
|
|
While installing Docker Engine from Ubuntu repositories is easier, adding official docker repository gives you faster updates. Hence why this is the recommended method.
|
|
|
|
First, let us get the GPG key which is needed to connect to the Docker repository. To that, use the following command.
|
|
|
|
```bash
|
|
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
|
```
|
|
|
|
Next, add the repository to the sources list. While you can also add it manually, the command below will do it automatically for you.
|
|
|
|
```bash
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
```
|
|
|
|
The above command will automatically fill in your release code name (jammy for 22.04, focal for 20.04, and bionic for 18.04).
|
|
|
|
Finally, refresh your packages again.
|
|
|
|
```bash
|
|
sudo apt update
|
|
```
|
|
|
|
If you forget to add the GPG key, then the above step would fail with an error message. Otherwise, let's get on with installing Docker on Ubuntu.
|
|
|
|
### **3. Install Docker**
|
|
|
|
> What is the difference between docker.io and docker-ce?
|
|
|
|
> docker.io is the docker package that is offered by some popular Linux distributions (e.g. Ubuntu/Debian). docker-ce on the other hand, is the docker package from official Docker repository. Typically docker-ce more up-to-date and preferred.
|
|
|
|
We will now install the docker-ce (and not docker.io package)
|
|
|
|
```bash
|
|
sudo apt install docker-ce
|
|
```
|
|
|
|
Purple screen means press ENTER. :)
|
|
|
|
Recommended: you should make sure the created user is added to the docker group for seamless use of commands:
|
|
|
|
```bash
|
|
sudo usermod -aG docker $USER
|
|
```
|
|
|
|
Now let's reboot the system to make sure all is well.
|
|
|
|
```bash
|
|
sudo reboot
|
|
```
|
|
|
|
After rebooting, if using the browser droplet console, you can click reload and wait to get back into the console.
|
|
|
|

|
|
|
|
**Reminder:** Any time you reboot with `sudo reboot`, you should switch to the user you setup as before with `su - <yourusername>`.
|
|
|
|
### **4. Verify that Docker is Running on Ubuntu**
|
|
|
|
There are many ways to check if Docker is running on Ubuntu. One way is to use the following command:
|
|
|
|
```bash
|
|
sudo systemctl status docker
|
|
```
|
|
|
|
You should see an output that says **active (running)** for status.
|
|
|
|

|
|
|
|
Exit this log by pressing CTRL (or CMD) + C.
|
|
|
|
### **5. Install Docker Compose**
|
|
|
|
Since we already added Docker's official repository in step 2, installing Docker Compose is straightforward using the [official Compose plugin](https://docs.docker.com/compose/install/linux/):
|
|
|
|
```bash
|
|
sudo apt install docker-compose-plugin
|
|
```
|
|
|
|
Verify the installation:
|
|
|
|
```bash
|
|
docker compose version
|
|
```
|
|
|
|
> Note: Docker Compose v2 uses the `docker compose` command (without hyphen) instead of the legacy `docker-compose`. All commands in this guide use the modern syntax.
|
|
|
|
### **6. As part of this guide, I will recommend you have git and npm installed:**
|
|
|
|
Though not technically required, having git and npm will make installing/updating very simple:
|
|
|
|
```bash
|
|
sudo apt install git nodejs npm
|
|
```
|
|
|
|
Cue the matrix lines.
|
|
|
|
You can confirm these packages installed successfully with the following:
|
|
|
|
```bash
|
|
git --version
|
|
node -v
|
|
npm -v
|
|
```
|
|
|
|

|
|
|
|
> Note: this will install some pretty old versions, for npm in particular. LibreChat requires Node.js v20.19.0+ (or ^22.12.0 or >= 23.0.0) for compatibility with openid-client v6 when using CommonJS. If you need to run LibreChat directly on the host (not using Docker), you'll need to install a compatible Node.js version. However, for this Docker-based guide, the Node.js version on the host doesn't matter as the application runs inside containers.
|
|
|
|
**Ok, now that you have set up the Droplet, you will now setup the app itself**
|
|
|
|
---
|
|
|
|
## Part II: Setup LibreChat
|
|
|
|
### **1. Clone down the repo**
|
|
|
|
From the _droplet_ commandline (as your user, not root):
|
|
|
|
```bash
|
|
# clone down the repository
|
|
git clone https://github.com/danny-avila/LibreChat.git
|
|
|
|
# enter the project directory
|
|
cd LibreChat/
|
|
```
|
|
|
|
### **2. Create LibreChat Config and Environment files**
|
|
|
|
#### Config (librechat.yaml) File
|
|
|
|
Next, we create the [LibreChat Config file](/docs/configuration/librechat_yaml), AKA `librechat.yaml`, allowing for customization of the app's settings as well as [custom endpoints](/docs/configuration/librechat_yaml/ai_endpoints).
|
|
|
|
Whether or not you want to customize the app further, it's required for the `deploy-compose.yml` file we are using, so we can create one with the bare-minimum value to start:
|
|
|
|
```bash
|
|
nano librechat.yaml
|
|
```
|
|
|
|
You will enter the editor screen, and you can paste the following:
|
|
|
|
```yaml
|
|
# For more information, see the Configuration Guide:
|
|
# https://www.librechat.ai/docs/configuration/librechat_yaml
|
|
|
|
# Configuration version (required)
|
|
version: 1.3.5
|
|
# This setting caches the config file for faster loading across app lifecycle
|
|
cache: true
|
|
```
|
|
|
|
Exit the editor with `CTRL + X`, then `Y` to save, and `ENTER` to confirm.
|
|
|
|
<Callout type="info" title="Configuration Validation">
|
|
LibreChat will exit with an error (exit code 1) if your `librechat.yaml` file contains validation errors. This fail-fast behavior ensures configuration issues are caught early in deployment.
|
|
|
|
Before deploying, validate your configuration using the [YAML Validator](/toolkit/yaml_checker). If your CI/CD pipeline starts the server, it will fail fast on invalid configuration, preventing deployments with misconfigured settings.
|
|
</Callout>
|
|
|
|
#### Environment (.env) File
|
|
|
|
The default values are enough to get you started and running the app, allowing you to provide your credentials from the web app.
|
|
|
|
```bash
|
|
# Copies the example file as your global env file
|
|
cp .env.example .env
|
|
```
|
|
|
|
However, it's **highly recommended** you adjust the "secret" values from their default values for added security. The API startup logs will warn you if you don't.
|
|
|
|
For conveninence, you can run this to generate your own values:
|
|
|
|
[https://www.librechat.ai/toolkit/creds_generator](https://www.librechat.ai/toolkit/creds_generator)
|
|
|
|
```bash
|
|
nano .env
|
|
|
|
# FIND THESE VARIABLES AND REPLACE THEIR DEFAULT VALUES!
|
|
|
|
# Must be a 16-byte IV (32 characters in hex)
|
|
|
|
CREDS_IV=e2341419ec3dd3d19b13a1a87fafcbfb
|
|
|
|
# Must be 32-byte keys (64 characters in hex)
|
|
|
|
CREDS_KEY=f34be427ebb29de8d88c107a71546019685ed8b241d8f2ed00c3df97ad2566f0
|
|
JWT_SECRET=16f8c0ef4a5d391b26034086c628469d3f9f497f08163ab9b40137092f2909ef
|
|
JWT_REFRESH_SECRET=eaa5191f2914e30b9387fd84e254e4ba6fc51b4654968a9b0803b456a54b8418
|
|
```
|
|
|
|
If you'd like to provide any credentials for all users of your instance to consume, you should add them while you're still editing this file:
|
|
|
|
```bash
|
|
OPENAI_API_KEY=sk-yourKey
|
|
```
|
|
|
|
As before, exit the editor with `CTRL + X`, then `Y` to save, and `ENTER` to confirm.
|
|
|
|
**That's it!**
|
|
|
|
For thorough configuration, however, you should edit your .env file as needed, and do read the comments in the file and the resources below.
|
|
|
|
```bash
|
|
# if editing the .env file
|
|
nano .env
|
|
```
|
|
|
|
This is one such env variable to be mindful of. This disables external signups, in case you would like to set it after you've created your account.
|
|
|
|
```shell
|
|
ALLOW_REGISTRATION=false
|
|
```
|
|
|
|
**Resources:**
|
|
- [Tokens/Apis/etc](/docs/configuration/pre_configured_ai)
|
|
- [User/Auth System](/docs/configuration/authentication)
|
|
|
|
### **3. Start docker**
|
|
|
|
```bash
|
|
# should already be running, but just to be safe
|
|
sudo systemctl start docker
|
|
|
|
# confirm docker is running
|
|
docker info
|
|
```
|
|
|
|
Now we can start the app container. For the first time, we'll use the full command and later we can use a shorthand command
|
|
|
|
```bash
|
|
sudo docker compose -f ./deploy-compose.yml up -d
|
|
```
|
|
|
|

|
|
|
|
It's safe to close the terminal if you wish -- the docker app will continue to run.
|
|
|
|
> Note: this is using a special compose file optimized for this deployed environment. If you would like more configuration here, you should inspect the deploy-compose.yml and Dockerfile.multi files to see how they are setup. We are not building the image in this environment since it's not enough RAM to properly do so. Instead, we pull the latest dev-api image of librechat, which is automatically built after each push to main.
|
|
|
|
> If you are setting up a domain to be used with LibreChat, this compose file is using the nginx file located in client/nginx.conf. Instructions on this below in part V.
|
|
|
|
### **4. Once the app is running, you can access it at `http://yourserverip`**
|
|
|
|
#### Go back to the droplet page to get your server ip, copy it, and paste it into your browser!
|
|
|
|

|
|
|
|
#### Sign up, log in, and enjoy your own privately hosted, remote LibreChat :)
|
|
|
|

|
|
|
|

|
|
|
|
## Part III: Updating LibreChat
|
|
|
|
I've made this step pretty painless, provided everything above was installed successfully and you haven't edited the git history.
|
|
|
|
> Note: If you are working on an edited branch, with your own commits, for example, such as with edits to client/nginx.conf, you should inspect config/deployed-update.js to run some of the commands manually as you see fit. See part V for more on this.
|
|
|
|
Run the following for an automated update
|
|
|
|
```bash
|
|
npm run update:deployed
|
|
```
|
|
|
|
**Stopping the docker container**
|
|
|
|
```bash
|
|
npm run stop:deployed
|
|
```
|
|
|
|
> This simply runs `docker compose -f ./deploy-compose.yml down`
|
|
|
|
**Starting the docker container**
|
|
|
|
```bash
|
|
npm run start:deployed
|
|
```
|
|
|
|
> This simply runs `docker compose -f ./deploy-compose.yml up -d`
|
|
|
|
**Check active docker containers**
|
|
|
|
```bash
|
|
docker ps
|
|
```
|
|
|
|
You can update manually without the scripts if you encounter issues.
|
|
|
|
```bash filename="Stop the running container(s)""
|
|
docker compose -f ./deploy-compose.yml down
|
|
```
|
|
|
|
```bash filename="Remove all existing docker images"
|
|
# 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 $_ }
|
|
```
|
|
|
|
```bash filename="Pull latest project changes"
|
|
git pull
|
|
```
|
|
|
|
```bash filename="Pull the latest LibreChat image""
|
|
docker compose -f ./deploy-compose.yml pull
|
|
```
|
|
|
|
```bash filename="Start LibreChat"
|
|
docker compose -f ./deploy-compose.yml up
|
|
```
|
|
|
|
## Part IV: Editing the NGINX file (for custom domains and advanced configs)
|
|
|
|
In case you would like to edit the NGINX file for whatever reason, such as pointing your server to a custom domain, use the following:
|
|
|
|
```bash filename="First, stop the active instance if running"
|
|
npm run stop:deployed
|
|
```
|
|
```bash filename="now you can safely edit"
|
|
nano client/nginx.conf
|
|
```
|
|
|
|
I won't be walking you through custom domain setup or any other changes to NGINX, you can look into the [Cloudflare guide](/docs/remote/cloudflare), the [Traefik guide](/docs/remote/traefik) or the [NGINX guide](/docs/remote/nginx) to get you started with custom domains.
|
|
|
|
However, I will show you what to edit on the LibreChat side for a custom domain with this setup.
|
|
|
|
Since NGINX is being used as a proxy pass by default, I only edit the following:
|
|
|
|
```shell
|
|
# before
|
|
server_name localhost;
|
|
|
|
# after
|
|
server_name custom.domain.com;
|
|
```
|
|
|
|
> Note: this works because the deploy-compose.yml file is using NGINX by default, unlike the main docker-compose.yml file. As always, you can configure the compose files as you need.
|
|
|
|
Now commit these changes to a separate branch:
|
|
|
|
```bash
|
|
# create a new branch
|
|
# example: git checkout -b edit
|
|
git checkout -b <branchname>
|
|
|
|
# stage all file changes
|
|
git add .
|
|
```
|
|
|
|
To commit changes to a git branch, you will need to identify yourself on git. These can be fake values, but if you would like them to sync up with GitHub, should you push this branch to a forked repo of LibreChat, use your GitHub email
|
|
|
|
```bash
|
|
# these values will work if you don't care what they are
|
|
git config --global user.email "you@example.com"
|
|
git config --global user.name "Your Name"
|
|
|
|
# Now you can commit the change
|
|
git commit -m "edited nginx.conf"
|
|
```
|
|
|
|
Updating on an edited branch will work a little differently now
|
|
|
|
```bash
|
|
npm run rebase:deployed
|
|
```
|
|
|
|
You should be all set!
|
|
|
|
> **Warning** You will experience merge conflicts if you start significantly editing the branch and this is not recommended unless you know what you're doing
|
|
|
|
> Note that any changes to the code in this environment won't be reflected because the compose file is pulling the docker images built automatically by GitHub
|
|
|
|
## Part V: Use the Latest Stable Release instead of Latest Main Branch
|
|
|
|
By default, this setup will pull the latest updates to the main branch of Librechat. If you would rather have the latest "stable" release, which is defined by the [latest tags](https://github.com/danny-avila/LibreChat/releases), you will need to edit deploy-compose.yml and commit your changes exactly as above in Part V. Be aware that you won't benefit from the latest feature as soon as they come if you do so.
|
|
|
|
Let's edit `deploy-compose.yml`:
|
|
|
|
```bash
|
|
nano deploy-compose.yml
|
|
```
|
|
|
|
Change `librechat-dev-api` to `librechat-api`:
|
|
|
|
```yaml
|
|
image: registry.librechat.ai/danny-avila/librechat-api:latest
|
|
```
|
|
|
|
Stage and commit as in Part V, and you're all set!
|