# Self-host LibreChat

> A self-hosted ChatGPT-style interface for many model providers, with agents, search, and multi-user login.

- Page: https://levelrail.com/templates/librechat/
- JSON: https://levelrail.com/templates/librechat.json
- Category: AI
- Licence: MIT (Permissive license)
- Source: https://github.com/LibreChat-AI/LibreChat
- Upstream docs: https://www.librechat.ai/docs

## Requirements
- Memory: about 2 GiB
- amd64: published, arm64: published
- Needs configuration before start: no
- Pinned image tag: v0.8.7

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| librechat | ghcr.io/danny-avila/librechat | v0.8.7 | 3080 | librechat_images -> /app/client/public/images |
| meilisearch | getmeili/meilisearch | v1.54.0 | none | librechat_meili_data -> /meili_data |
| mongo | mongo | 7 | none | librechat_mongo_data -> /data/db |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| librechat | ALLOW_REGISTRATION | preset |
| librechat | CREDS_IV | generated |
| librechat | CREDS_KEY | generated |
| librechat | DOMAIN_CLIENT | preset |
| librechat | DOMAIN_SERVER | preset |
| librechat | HOST | preset |
| librechat | JWT_REFRESH_SECRET | generated |
| librechat | JWT_SECRET | generated |
| librechat | MEILI_HOST | preset |
| librechat | MEILI_MASTER_KEY | generated |
| librechat | MONGO_URI | preset |
| librechat | PORT | preset |
| meilisearch | MEILI_MASTER_KEY | generated |
| meilisearch | MEILI_NO_ANALYTICS | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy librechat --name my-librechat
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/librechat/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy LibreChat on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id librechat for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image ghcr.io/danny-avila/librechat:v0.8.7, getmeili/meilisearch:v1.54.0, mongo:7 is what you deploy there.

Self-host LibreChat, LibreChat docker compose file, deploy LibreChat on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
