---
title: "Self-host LibreChat"
description: "Run LibreChat on exe.dev: one private team chat for GPT, Claude, Grok, and open models through exe.dev's LLM gateway. No API keys; chats on your VM."
url: https://exe-staging.dev/deploy/librechat
category: "AI apps"
updated: 2026-11-16
---

# Self-host LibreChat

GPT, Claude, Grok, and open models in one private team chat. No API keys.

- **Software:** LibreChat (https://www.librechat.ai)
- **Source:** https://github.com/LibreChat-AI/LibreChat
- **License:** MIT
- **Time:** 15 minutes
- **Example VM name:** `my-librechat` (yours will differ; on the VM, `hostname` prints it)
- **Machine-readable:** https://exe-staging.dev/deploy/librechat/manifest.json

## What you get

- LibreChat at your VM's private URL, with you as its admin.
- GPT, Claude, Grok, and open models from exe.dev's LLM gateway in one model menu. No API keys.
- Switch models in the middle of a chat, and search every chat you've had.
- Agents, file uploads, and document search, all stored on the VM.
- Starts again after a reboot; nightly backups, with one checked.

Running on the VM:

- **LibreChat 0.8.8**: The official image and Compose file, pinned to the release, port 8000, data in `~/librechat`
- **MongoDB and Meilisearch**: Accounts, chats, and chat search, in the same Compose stack, data in `~/librechat/data-node`
- **RAG API and pgvector**: Document search for agents, with embeddings from the gateway
- **exe.dev LLM gateway**: GPT, Claude, Grok, GLM, Kimi, DeepSeek, and more, without API keys
- **exe.dev login**: Only people you share the VM with reach LibreChat at all

How it is reached:

- https://my-librechat.exe.xyz/ (private): Your chats, behind exe.dev login and your LibreChat password
- https://my-librechat.exe.xyz/ (shared): Teammates you share the VM with, each with their own account
- https://my-librechat.exe.xyz:3000/ (private): LibreChat's admin panel (a preview), for admins

## Deploy with Shelley

Open https://exe-staging.dev/new?prompt=Set%20up%20LibreChat%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fexe-staging.dev%2Fdeploy%2Flibrechat.md%20from%20top%20to%20bottom.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-librechat.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-librechat.%20Skip%20the%20step%20that%20creates%20the%20VM%3B%20you%20are%20on%20it.%0A%0AYou%20are%20done%20when%20all%20of%20these%20are%20true.%20Check%20each%20one%20yourself%3A%0A-%20LibreChat%20at%20your%20VM%27s%20private%20URL%2C%20with%20you%20as%20its%20admin.%0A-%20GPT%2C%20Claude%2C%20Grok%2C%20and%20open%20models%20from%20exe.dev%27s%20LLM%20gateway%20in%20one%20model%20menu.%20No%20API%20keys.%0A-%20Switch%20models%20in%20the%20middle%20of%20a%20chat%2C%20and%20search%20every%20chat%20you%27ve%20had.%0A-%20Agents%2C%20file%20uploads%2C%20and%20document%20search%2C%20all%20stored%20on%20the%20VM.%0A-%20Starts%20again%20after%20a%20reboot%3B%20nightly%20backups%2C%20with%20one%20checked.%0A%0ARead%20the%20whole%20recipe%2C%20including%20the%20closed%20details.%20For%20initial%20setup%2C%0Afollow%20%22Install%20by%20hand%22%20first%2C%20skipping%20VM%20creation%20and%20SSH%3A%20Docker%2C%0ALibreChat%27s%20files%20and%20settings%2C%20the%20model%20list%2C%20the%20Compose%20stack%2C%20the%0Aowner%27s%20admin%20account%2C%20the%20two-model%20chat%20check%2C%20the%20backup%20timer%2C%20and%0Athe%20backup%20check.%20Those%20checks%20are%20enough%3B%20don%27t%20install%20extra%20tools%20to%0Atest%20further.%20The%20walkthrough%20at%20the%20top%20is%20for%20the%20owner%20afterwards.%20Do%0Anot%20run%20Restore%20or%20Update.%0AWork%20as%20exedev%20in%20~%2Flibrechat.%20Never%20overwrite%20an%20existing%20.env%2C%0Alibrechat.yaml%2C%20or%20admin-password.%0AMake%20the%20VM%27s%20owner%20the%20admin%2C%20using%20the%20email%20from%20the%20reflection%0Aintegration%3B%20if%20it%20prints%20nothing%2C%20ask%20the%20user%20for%20their%20exe.dev%20email.%0ADon%27t%20print%20the%20password%3B%20tell%20the%20owner%20the%20command%20that%20shows%20it.%0AThe%20VM%20is%20private%20until%20it%27s%20shared%2C%20so%20start%20LibreChat%20as%20written.%0ADon%27t%20share%20the%20VM%20or%20make%20it%20public.%20Keep%20test%20chats%20to%20a%20word%20or%20two.%0AVerify%20docker.service%20is%20enabled%3B%20do%20not%20reboot.%0A%0AFinish%20with%20the%20URLs%20I%20should%20open.%0A to create a VM whose agent, Shelley, follows this recipe. From a terminal:

```sh
curl -fsSL https://exe-staging.dev/deploy/librechat/prompt.txt | ssh exe.dev new --prompt=/dev/stdin
```

Or follow the steps below by hand.

LibreChat is an open-source chat app in the style of ChatGPT, built around
one idea: every model in one place. Here it runs on your own exe.dev VM, and
exe.dev's [LLM gateway](/docs/integrations-llm) supplies GPT, Claude, Grok,
and open models like GLM, Kimi, and DeepSeek, with no API keys anywhere.
Start a chat with one model and finish it with another.

The VM is private, so only people you share it with get as far as the
sign-in page, and each of them gets their own LibreChat account and
history. Chats, uploads, and agents live on the VM's disk, backed up every
night.

## Start chatting

Open the URL Shelley gives you. It'll look like
`https://my-librechat.exe.xyz/`. Sign in to exe.dev if you're asked, then
sign in to LibreChat with your exe.dev email and the password Shelley made
for you. On your computer, this shows it:

```bash
ssh my-librechat.exe.xyz cat librechat/admin-password
```

You're LibreChat's admin. To choose your own password, run this on the VM
and answer the questions; LibreChat has no change-password page:

```bash
cd ~/librechat && docker compose exec api npm run reset-password
```

Pick a model at the top of the chat and say hello. The menu groups the
models by maker: **OpenAI**, **Claude**, **xAI**, and **Fireworks** for open
models. Pick another one at any point in a chat, and the next reply comes
from it, with the whole conversation as context.

<figure>
<img src="https://exe-staging.dev/deploy/librechat/chat.png" alt="A LibreChat conversation where Claude drafts a welcome note and GPT then shortens it" width="1280" height="800" loading="lazy">
<figcaption>Claude wrote the first reply; switching the menu to GPT wrote the second.</figcaption>
</figure>

**Search messages**, top left, finds words in any of your chats.

## Bring your team

On your computer, share the VM with a teammate:

```bash
ssh exe.dev share add my-librechat teammate@example.com
```

They get an email invitation. Once they've signed in to exe.dev, they open
the same URL, click **Sign up**, and create their own LibreChat account.
Their chats are separate from yours. `ssh exe.dev share add my-librechat team`
shares with everyone in your exe.dev team.

People you haven't shared with see exe.dev's login screen and never reach
LibreChat. `ssh exe.dev share remove my-librechat teammate@example.com`
locks someone out again; their account and chats stay on the VM.

Once everyone has an account, you can turn sign-up off. On the VM:

```bash
cd ~/librechat
sed -i 's/^ALLOW_REGISTRATION=.*/ALLOW_REGISTRATION=false/' .env
docker compose restart api
```

Then add people yourself, with a password you send them:
`docker compose exec api npm run create-user -- teammate@example.com Name username`.
The same `npm run` works with `list-users`, `delete-user`, and
`ban-user`.

> [!WARNING]
> Don't make the VM public with `share set-public`. Anyone could then sign up
> while sign-up is on, and every chat counts against your LLM allocation.

## Models, files, and agents

The model list comes from `~/librechat/librechat.yaml`, written once from
the gateway's catalog. When the gateway adds a model, add its ID to the
matching `models: default:` list there (the IDs are in
`https://llm.int.exe.xyz/models.json`) and restart:
`docker compose restart api`. Remove models you don't want people to use
the same way.

<figure>
<img src="https://exe-staging.dev/deploy/librechat/models.png" alt="LibreChat's model menu with OpenAI, Claude, xAI, and Fireworks endpoints, showing the Claude models" width="1280" height="800" loading="lazy">
<figcaption>Each endpoint in librechat.yaml is a group in the model menu.</figcaption>
</figure>

- **Files:** attach a document with the paperclip and ask about it. Uploads
  are stored in `~/librechat/uploads`.
- **Agents:** **Agent Builder**, in the icon bar on the left, makes an
  assistant with its own model, instructions, and files to search. Agents
  can use any model in the menu, and you can share them with your team.
- **Temporary chats, presets, bookmarks, and shared links** are all there,
  as in [LibreChat's docs](https://www.librechat.ai/docs).

### Agents, MCP, and more

These need more than the gateway, so they are off for now:

- **MCP servers** give agents tools. Add them under `mcpServers` in
  `librechat.yaml`, or under **MCP Settings** in the app; see
  [LibreChat's MCP guide](https://www.librechat.ai/docs/features/mcp). To
  write your own server, see [Remote MCP server](/deploy/mcp-server).
- **Code Interpreter** runs code for agents in a sandbox. It's a separate
  open-source service you'd host next to LibreChat; see
  [Code Interpreter](https://www.librechat.ai/docs/features/code_interpreter).
- **Web search** needs keys for a search API, a scraper, and a reranker;
  see [Web search](https://www.librechat.ai/docs/features/web_search). For
  keys that shouldn't sit on the VM, see
  [the HTTP proxy integration](/docs/integrations-http-proxy).

Ask Shelley on the VM to set any of these up; it can read this page and
LibreChat's docs.

## Keep your chats

Backups run nightly into `~/librechat-backups`. Each one includes accounts,
chats, agents, uploads, the search index, document vectors, and `.env`,
which holds the keys that encrypt saved credentials. Keep a copy
**off the VM**. On your computer:

```bash
scp -r my-librechat.exe.xyz:librechat-backups .
```

Keep these files private. To restore one, or to update LibreChat, see the
sections below, or ask Shelley to help. Something stuck? On the VM, try
`cd ~/librechat && docker compose logs --tail=100 api`.

## The nuts and bolts

Happy clicking Deploy? You can stop here. These are the same setup steps
Shelley follows, plus the maintenance commands for later.

<details id="create-the-vm" data-manual-setup class="dp-details">
<summary>Install by hand</summary>

### Create a VM

On your computer (pick another name if `my-librechat` is taken):

```bash
ssh exe.dev new --name=my-librechat
ssh my-librechat.exe.xyz
```

All remaining installation commands run **on the VM**, as `exedev`.
Commands use `hostname`, so your VM can have any name.

### Get Docker ready

LibreChat's recommended install is Docker Compose: the app, MongoDB,
Meilisearch, the RAG API, and pgvector. Enable Docker at boot, or
exe.dev's on-demand Docker won't restart LibreChat after a reboot. Install
`jq` if needed:

```bash
sudo systemctl enable --now docker.service
systemctl is-enabled docker.service
command -v jq >/dev/null || sudo apt-get install -y jq
```

The check should print `enabled`.

### Get LibreChat

Clone the v0.8.8 release. The repository holds the Compose file and the
example settings; the app itself comes as a Docker image.

```bash
git clone --quiet --depth 1 --branch v0.8.8 -c advice.detachedHead=false \
  https://github.com/LibreChat-AI/LibreChat.git ~/librechat
grep -m1 '"version"' ~/librechat/package.json
```

Expect `"version": "v0.8.8"`.

### Write the settings

This writes `.env` **once**, from LibreChat's example: the site's
address, fresh secret keys, chat search, the gateway for document
embeddings, and only the custom endpoints and agents in the menu. The
gateway needs no key, so LibreChat gets a placeholder.

```bash
cd ~/librechat
if [ ! -e .env ]; then
  cp .env.example .env
  chmod 600 .env
  # set_env KEY VALUE: replace the KEY= line, or its commented-out form.
  set_env() {
    if grep -qE "^#? ?$1=" .env; then
      sed -i -E "0,/^#? ?$1=.*/s||$1=$2|" .env
    else
      echo "$1=$2" >> .env
    fi
  }
  url="https://$(hostname).exe.xyz"
  set_env HOST 0.0.0.0
  set_env PORT 8000
  set_env DOMAIN_CLIENT "$url"
  set_env DOMAIN_SERVER "$url"
  set_env UID "$(id -u)"
  set_env GID "$(id -g)"
  set_env CREDS_KEY "$(openssl rand -hex 32)"
  set_env CREDS_IV "$(openssl rand -hex 16)"
  set_env JWT_SECRET "$(openssl rand -hex 32)"
  set_env JWT_REFRESH_SECRET "$(openssl rand -hex 32)"
  set_env MEILI_MASTER_KEY "$(openssl rand -hex 32)"
  set_env SEARCH true
  set_env ADMIN_PANEL_SESSION_SECRET "$(openssl rand -hex 32)"
  set_env ADMIN_PANEL_URL "$url:3000"
  set_env ADMIN_PANEL_SESSION_COOKIE_SECURE true
  set_env ENDPOINTS custom,agents
  set_env OPENAI_API_KEY ""
  set_env ANTHROPIC_API_KEY ""
  set_env GOOGLE_KEY ""
  set_env ASSISTANTS_API_KEY ""
  set_env RAG_OPENAI_BASEURL https://llm.int.exe.xyz/v1
  set_env RAG_OPENAI_API_KEY exe-llm-gateway
  set_env EMBEDDINGS_PROVIDER openai
  set_env EMBEDDINGS_MODEL text-embedding-3-small
  # One LibreChat process without Redis, which scheduled chats need to know.
  set_env SCHEDULES_SINGLE_PROCESS true
fi
grep -E '^(DOMAIN_CLIENT|PORT|ENDPOINTS|SEARCH|ALLOW_REGISTRATION)=' .env
grep -cE '^(CREDS_KEY|CREDS_IV|JWT_SECRET|JWT_REFRESH_SECRET|MEILI_MASTER_KEY|ADMIN_PANEL_SESSION_SECRET)=.' .env
```

Expect your VM's URL, port 8000, `custom,agents`, `true`, sign-up on
(`ALLOW_REGISTRATION=true`), and `6` secrets. Losing `CREDS_KEY` and
`CREDS_IV` makes saved credentials unreadable, so `.env` goes into every
backup.

### Choose the models

The gateway lists its models at `https://llm.int.exe.xyz/models.json`.
This writes `librechat.yaml` **once**, with four endpoints: OpenAI and
Claude through the gateway's native OpenAI and Anthropic routes, and xAI
and Fireworks through its OpenAI-compatible one. It leaves out very
expensive `-pro` models and the `-codex` coding models. Small models write
the chat titles.

```bash
cd ~/librechat
if [ ! -e librechat.yaml ]; then
  catalog=$(curl -fsS https://llm.int.exe.xyz/models.json)
  # models PROVIDER [keep]: its chat models as a list; "keep" keeps the
  # "provider/" prefix, which the gateway's shared route needs for Fireworks.
  models() {
    jq -c --arg p "$1" --arg keep "${2:-}" '[.models[]
      | select(.provider == $p)
      | select((.apis // []) | (index("openai_chat") or index("anthropic_messages")))
      | .id | if $keep == "" then sub("^[a-z]+/"; "") else . end
      | select(test("-pro$|-codex$") | not)]' <<<"$catalog"
  }
  cat > librechat.yaml <<EOF
# LibreChat on exe.dev: every model comes through exe.dev's LLM gateway,
# so there are no API keys on this VM. "exe-llm-gateway" is a placeholder.
# Reference: https://www.librechat.ai/docs/configuration/librechat_yaml
version: 1.3.17
cache: true

registration:
  socialLogins: []

endpoints:
  custom:
    - name: OpenAI
      iconURL: openAI
      apiKey: exe-llm-gateway
      baseURL: https://llm.int.exe.xyz/openai/v1
      models:
        default: $(models openai)
        fetch: false
      titleConvo: true
      titleModel: gpt-5.4-nano
      modelDisplayLabel: ChatGPT

    - name: Claude
      provider: anthropic
      iconURL: anthropic
      apiKey: exe-llm-gateway
      baseURL: https://llm.int.exe.xyz/anthropic
      models:
        default: $(models anthropic)
        fetch: false
      titleConvo: true
      titleModel: claude-haiku-4-5
      modelDisplayLabel: Claude

    - name: xAI
      iconURL: xai
      apiKey: exe-llm-gateway
      baseURL: https://llm.int.exe.xyz/v1
      models:
        default: $(models xai)
        fetch: false
      titleConvo: true
      titleModel: current_model
      modelDisplayLabel: Grok

    - name: Fireworks
      apiKey: exe-llm-gateway
      baseURL: https://llm.int.exe.xyz/v1
      models:
        default: $(models fireworks keep)
        fetch: false
      titleConvo: true
      titleModel: current_model
      modelDisplayLabel: Open models
EOF
fi
grep -cE '^ +default: \["' librechat.yaml
grep -E '^ +default:' librechat.yaml | grep -oE '"[^"]+"' | wc -l
```

Expect `4` endpoints and a few dozen models. If an endpoint's list is
`[]`, the gateway doesn't offer that provider right now; delete that
endpoint's block.

### Pin the versions

LibreChat's Compose file follows its development builds. A
`docker-compose.override.yml` beside it pins the release images and puts
`librechat.yaml` into the app. Create the data directories too, so they
belong to you rather than to root:

```bash
cd ~/librechat
cat > docker-compose.override.yml <<'EOF'
# exe.dev's changes to LibreChat's docker-compose.yml:
# pinned releases, and librechat.yaml mounted into the app.
services:
  api:
    image: registry.librechat.ai/librechat-ai/librechat:v0.8.8
    volumes:
      - type: bind
        source: ./librechat.yaml
        target: /app/librechat.yaml
  admin-panel:
    image: registry.librechat.ai/clickhouse/librechat-admin-panel:1.0.0
  rag_api:
    image: registry.librechat.ai/librechat-ai/librechat-rag-api-dev-lite:v0.9.0
EOF
mkdir -p data-node meili_data_v1.35.1 uploads images logs
docker compose config --images
```

Expect six images, each with a version: `librechat:v0.8.8`,
`librechat-admin-panel:1.0.0`, `librechat-rag-api-dev-lite:v0.9.0`,
`mongo:8.0.20`, `meilisearch:v1.35.1`, and `pgvector:0.8.0-pg15-trixie`.
Every service has `restart: always`, so they come back after a reboot.

### Start LibreChat

The first start downloads about 6 GB of images, which takes a few
minutes:

```bash
cd ~/librechat
docker compose up -d
until curl -fs http://localhost:8000/health; do sleep 5; done; echo
docker compose ps --format '{{.Service}}: {{.Status}}'
```

Expect `OK` and six services `Up`. If the loop runs for more than ten
minutes, stop it with Ctrl-C and [check the logs](#troubleshooting).

### Make yourself the admin

The first LibreChat account becomes its admin. The VM is private until you
share it, so nobody else can get there first, but create your account now.
Find your exe.dev email:

```bash
owner=$(curl -fsS https://reflection.int.exe.xyz/email | jq -r '.email // empty')
echo "$owner"
```

If that prints nothing, set it yourself: `owner=you@example.com`, using the
email you sign in to exe.dev with. Then create the account with a random
password, kept in a file only you can read:

```bash
cd ~/librechat
[ -e admin-password ] || (umask 077; openssl rand -base64 18 > admin-password)
name=$(printf %s "${owner%@*}" | tr -cd 'A-Za-z0-9_.')
docker compose exec -T api npm run create-user -- \
  "$owner" "$name" "$name" --email-verified=true < admin-password \
  | grep -E 'created|Error'
```

Expect `User created successfully!`. `cat ~/librechat/admin-password`
shows the password.

### Check two models

Sign in as you and ask GPT and Claude for one word each, through LibreChat
and the gateway. LibreChat refuses chat requests that don't come from a
browser, so `curl` says it is one. The test chats are deleted at the end.

```bash
cd ~/librechat
owner=${owner:-$(curl -fsS https://reflection.int.exe.xyz/email | jq -r '.email // empty')}
ua='Mozilla/5.0 (X11; Linux x86_64) Chrome/130.0 Safari/537.36'
api() { curl -fsS -A "$ua" -H "Authorization: Bearer ${token:-}" \
  -H 'Content-Type: application/json' "$@"; }
token=$(api http://localhost:8000/api/auth/login -d "$(jq -n --arg email "$owner" \
  --rawfile pw admin-password '{email: $email, password: ($pw | rtrimstr("\n"))}')" \
  | jq -r .token)
ask() {  # ask ENDPOINT MODEL
  stream=$(api "http://localhost:8000/api/agents/chat/$1" -d "$(jq -n \
    --arg endpoint "$1" --arg model "$2" --arg id "$(cat /proc/sys/kernel/random/uuid)" \
    '{text: "Reply with one word: pong", sender: "User", isCreatedByUser: true,
      messageId: $id, conversationId: null,
      parentMessageId: "00000000-0000-0000-0000-000000000000",
      endpoint: $endpoint, endpointType: "custom", model: $model}')" | jq -r .streamId)
  api -N --max-time 120 "http://localhost:8000/api/agents/chat/stream/$stream" \
    | sed -n 's/^data: //p' | jq -r 'select(.final) | .responseMessage
      | "\(.model): \([.content[]? | select(.type == "text") | .text] | join(""))"'
}
ask OpenAI gpt-5.4-nano
ask Claude claude-haiku-4-5
api -X DELETE http://localhost:8000/api/convos/all | jq .deletedCount
```

Expect `gpt-5.4-nano: pong`, `claude-haiku-4-5: Pong` (or similar), and
`2`. If a model isn't in your `librechat.yaml`, use another from the same
endpoint.

### Set up nightly backups

The backup stops LibreChat for a few seconds, so MongoDB and the vector
database are copied in a consistent state. It runs as root because the
document vectors live in a Docker volume, and skips the logs.

```bash
cat > ~/librechat/backup.sh <<'EOF'
#!/usr/bin/env bash
# Back up LibreChat: this directory (.env with its keys, librechat.yaml,
# MongoDB, the search index, uploads) and its Docker volumes (document
# vectors, app data). Run with sudo.
set -euo pipefail
umask 077
cd "$(dirname "$(readlink -f "$0")")"
name=$(basename "$PWD")
owner=$(stat -c %U:%G .)
dest="$(dirname "$PWD")/librechat-backups"
volumes="$(docker info -f '{{.DockerRootDir}}')/volumes"
mkdir -p "$dest"
out="$dest/librechat-$(date -u +%Y%m%d-%H%M%S).tar.gz"

# A short stop keeps MongoDB and the vector database consistent.
docker compose stop
trap 'docker compose start' EXIT
tar -czf "$out.part" --exclude="$name/logs" -C .. "$name" \
  -C "$volumes" "${name}_pgdata2" "${name}_librechat-data"
docker compose start
trap - EXIT
mv "$out.part" "$out"
chown -R "$owner" "$dest"

# Keep the 14 newest backups.
ls -1t "$dest"/librechat-*.tar.gz | tail -n +15 | xargs -r rm --
echo "$out"
EOF
chmod +x ~/librechat/backup.sh
```

Schedule it for 03:30 UTC (or so), then take a first backup:

```bash
sudo tee /etc/systemd/system/librechat-backup.service >/dev/null <<EOF
[Unit]
Description=Back up LibreChat to ~/librechat-backups
Requires=docker.service
After=docker.service

[Service]
Type=oneshot
ExecStart=$HOME/librechat/backup.sh
EOF
sudo tee /etc/systemd/system/librechat-backup.timer >/dev/null <<'EOF'
[Unit]
Description=Back up LibreChat every night

[Timer]
OnCalendar=*-*-* 03:30:00
RandomizedDelaySec=30m
Persistent=true

[Install]
WantedBy=timers.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now librechat-backup.timer
sudo systemctl start librechat-backup.service
systemctl list-timers librechat-backup.timer
ls -lh ~/librechat-backups
until curl -fs http://localhost:8000/health; do sleep 5; done; echo
```

Check that the timer has a next run, the directory has a tarball, and
LibreChat is back (`OK`). For failures:
`journalctl -u librechat-backup.service`.

### Test a backup

List the newest backup's key files, without unpacking it:

```bash
latest=$(ls -1t ~/librechat-backups/librechat-*.tar.gz | head -n 1)
tar -tzf "$latest" | grep -E '^librechat/(\.env|librechat\.yaml|admin-password|data-node/WiredTiger)$|^librechat_pgdata2/_data/PG_VERSION$'
```

Expect five lines: `.env`, `librechat.yaml`, `admin-password`, MongoDB's
`WiredTiger` file, and the vector database's `PG_VERSION`.

Installation done. Leave sharing to the owner; continue with
[Start chatting](#start-chatting).

</details>

<details id="back-up-and-restore" class="dp-details">
<summary>Back up and restore</summary>

On the VM, `sudo ~/librechat/backup.sh` makes an extra backup and prints
its path. Copy backups off the VM as shown in
[Keep your chats](#keep-your-chats).

### Restore

On a new VM, get Docker ready as in [Install](#get-docker-ready). Create
`~/librechat-backups` there, then copy your backup over from your computer:

```bash
scp librechat-20261116-033012.tar.gz my-librechat.exe.xyz:librechat-backups/
```

Use your backup's actual filename in this and the commands below. All
remaining commands run **on the VM**. If LibreChat already runs there, back
it up, stop it, remove its volumes (they are in that backup), and keep its
directory aside first:

```bash
sudo ~/librechat/backup.sh
cd ~/librechat && docker compose down -v
sudo mv ~/librechat ~/librechat.before-restore
```

Unpack the backup, point it at this VM's address, recreate the volumes, and
start it:

```bash
sudo mkdir /tmp/librechat-restore
sudo tar -xzf ~/librechat-backups/librechat-20261116-033012.tar.gz -C /tmp/librechat-restore
sudo mv /tmp/librechat-restore/librechat ~/librechat
cd ~/librechat
mkdir -p logs
url="https://$(hostname).exe.xyz"
sed -i -E "s#^(DOMAIN_CLIENT|DOMAIN_SERVER)=.*#\1=$url#; s#^ADMIN_PANEL_URL=.*#ADMIN_PANEL_URL=$url:3000#" .env
docker compose up --no-start
volumes="$(docker info -f '{{.DockerRootDir}}')/volumes"
for v in pgdata2 librechat-data; do
  sudo cp -a "/tmp/librechat-restore/librechat_$v/_data/." "$volumes/librechat_$v/_data/"
done
sudo rm -rf /tmp/librechat-restore
docker compose up -d
until curl -fs http://localhost:8000/health; do sleep 5; done; echo
```

Open the site and sign in; your chats should be there. On a new VM,
recreate the backup timer from [Install](#set-up-nightly-backups). Keep
`~/librechat.before-restore` until you're happy everything is back.

</details>

<details id="update" class="dp-details">
<summary>Update LibreChat</summary>

LibreChat publishes releases on
[GitHub](https://github.com/LibreChat-AI/LibreChat/releases); skip the
`-rc` ones. Read the release notes and the new `UPGRADING.md` first: some
releases need a database migration. On the VM, back up, then fetch the new
release's files (here v0.8.9; use the real tag):

```bash
cd ~/librechat
sudo ./backup.sh
git fetch --quiet --depth 1 origin tag v0.8.9
git -c advice.detachedHead=false checkout --quiet v0.8.9
grep -m1 '"version"' package.json
less UPGRADING.md
grep -n 'image:' docker-compose.yml
```

In `docker-compose.override.yml`, change `librechat:v0.8.8` to the new
version. If `docker-compose.yml` names a different admin panel or RAG API
image, pin those to their newest release too. Then pull and restart:

```bash
docker compose pull
docker compose up -d
until curl -fs http://localhost:8000/health; do sleep 5; done; echo
docker compose ps --format '{{.Service}}: {{.Image}}'
docker image prune -f
```

Reload the site with Ctrl+Shift+R (Cmd+Shift+R on a Mac) so your browser
picks up the new pages. The last command frees the old images' disk space.
To roll back, [restore the backup](#restore): going back to the old tag
alone won't undo database migrations.

If a new release changes the Meilisearch version, its data directory gets
a new name and LibreChat rebuilds the chat search index on its own.

</details>

<details id="troubleshooting" class="dp-details">
<summary>Something not working?</summary>

On the VM:

```bash
cd ~/librechat
docker compose ps
docker compose logs --tail=100 api
```

- **502 right after starting or updating:** LibreChat takes up to a minute
  to start. Wait for `curl -fsS http://localhost:8000/health`.
- **MongoDB or Meilisearch keeps restarting with "Permission denied":**
  Docker created their data directories as root. Run
  `docker compose down`, then
  `sudo chown -R $(id -u):$(id -g) data-node meili_data_v1.35.1 uploads images logs`,
  then `docker compose up -d`.
- **"Your account has been temporarily banned":** LibreChat bans an
  address for a while after suspicious requests, such as scripts that don't
  look like a browser. Wait two hours, or restart with `docker compose
  restart api` after deleting the ban:
  `docker compose exec mongodb mongosh LibreChat --quiet --eval 'db.logs.deleteMany({key: /^(ban|BANS):/})'`.
- **I changed `librechat.yaml` or `.env` and nothing happened:** run
  `docker compose restart api`, then look for config errors in its log.
- **A model replies with an error:** check its ID is still in
  `https://llm.int.exe.xyz/models.json`. Fireworks models keep their
  `fireworks/` prefix; OpenAI, Claude, and xAI models don't.
- **Down after a reboot:** run `sudo systemctl enable --now docker.service`.
- **Disk full:** check `df -h /` and run `docker image prune -f`.

</details>

## Frequently asked questions

### How much does it cost?

LibreChat is free. You pay for your [VM plan](https://exe.dev/pricing), and chats use your exe.dev [LLM allocation](/docs/integrations-llm), including your teammates' chats. Bigger models use it up faster.

### Should I pick LibreChat or Open WebUI?

Both are private team chats on a VM. Pick LibreChat for Claude next to GPT and Grok, agents that call MCP servers, and per-endpoint settings. Pick [Open WebUI](/deploy/open-webui) for a lighter setup (one container), your exe.dev login as the only sign-in, and built-in web search and voice.

### Why do I need a LibreChat password on top of exe.dev login?

LibreChat can't take the signed-in email from exe.dev's proxy; it signs people in with its own accounts (or OpenID, LDAP, or SAML). exe.dev login decides who reaches the site at all, and the LibreChat account decides whose chats you see.

### Can I use my own API key or ChatGPT subscription?

Yes, without touching LibreChat. Point your [LLM integration](/docs/integrations-llm) at your own provider key or ChatGPT account, and the same gateway address serves your models.

### Who can read my chats?

Each account sees only its own chats, unless someone shares a link. Anyone with a shell on the VM can read the database and uploads, and prompts and replies go to the model provider through exe.dev's gateway.

### Does it do web search and code execution?

Not out of the box. LibreChat's web search needs keys for a search service and a page scraper, and its Code Interpreter is a separate service you'd host next to it. See [Agents, MCP, and more](#agents-mcp-and-more).

### Is it free for my company?

Yes. LibreChat is MIT-licensed, so you can use and change it commercially.


## Related

- [Self-host Open WebUI](https://exe-staging.dev/deploy/open-webui.md): A private ChatGPT for you and your team. No API keys.
- [Self-host Dify](https://exe-staging.dev/deploy/dify.md): Build and publish AI apps and workflows. Models without API keys.
- [Host a remote MCP server](https://exe-staging.dev/deploy/mcp-server.md): Tools for all your agents, on a computer of their own. Private until you say.
- [Self-host n8n](https://exe-staging.dev/deploy/n8n-2.md): Connect your apps. Let the boring bits run themselves.
- [Self-host VoiceStudio](https://exe-staging.dev/deploy/voicestudio.md): Your own text-to-speech and voice studio, on CPU, behind exe.dev login.
- [Run Claude Code on a remote server](https://exe-staging.dev/deploy/claude-code.md): A computer for Claude. A breather for your laptop.
