LibreChat — a feature-rich, open-source ChatGPT-style UI for many AI providers (OpenAI, Anthropic, Google, Ollama and more) with assistants, agents, presets and multi-user auth. Deployed as an all-in-one host-networked Nomad job (MongoDB + app).
Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.
Source ↗ Project ↗ ★ 45k ⚑ Report an issue
Save as values.hcl, edit, then run:
# The name of the Nomad job.
job_name = "librechat"
# The Nomad namespace to deploy into.
namespace = "default"
# The datacenters to deploy to.
datacenters = ["*"]
# The LibreChat container image. Pin a tag in production.
image = "ghcr.io/danny-avila/librechat:latest"
# The MongoDB image for the bundled database (needs a CPU with AVX for 5.0+).
mongo_image = "mongo:7.0"
# Host port for the LibreChat web UI.
port = 3080
# Host port for the bundled MongoDB.
mongo_port = 27017
# 32-byte (64 hex chars) key for encrypting stored credentials. CHANGE THIS.
creds_key = "0000000000000000000000000000000000000000000000000000000000000000"
# 16-byte (32 hex chars) IV for encrypting stored credentials. CHANGE THIS.
creds_iv = "00000000000000000000000000000000"
# Secret for signing JWT access tokens. CHANGE THIS.
jwt_secret = "change_me_jwt_secret_to_a_long_random_value_0000"
# Secret for signing JWT refresh tokens. CHANGE THIS.
jwt_refresh_secret = "change_me_jwt_refresh_secret_to_a_long_random_value_0000"
# Allow new users to register (true/false).
allow_registration = "true"
# Named volume for LibreChat app data (/app/data).
data_volume = "librechat_data"
# Named volume for uploaded files (/app/uploads).
uploads_volume = "librechat_uploads"
# Named volume for generated images (/app/client/public/images).
images_volume = "librechat_images"
# Named volume for API logs (/app/api/logs).
logs_volume = "librechat_logs"
# Named volume for MongoDB data.
mongo_data_volume = "librechat_mongo_data"
# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []
# Resources for the LibreChat app task.
resources = {
cpu = 1000
memory = 2048
}
# Resources for the bundled MongoDB task.
mongo_resources = {
cpu = 500
memory = 1024
}
| Name | Type | Default | Description |
|---|---|---|---|
| job_name | string | "librechat" | The name of the Nomad job. |
| namespace | string | "default" | The Nomad namespace to deploy into. |
| datacenters | list | ["*"] | The datacenters to deploy to. |
| image | string | "ghcr.io/danny-avila/librechat:latest" | The LibreChat container image. Pin a tag in production. |
| mongo_image | string | "mongo:7.0" | The MongoDB image for the bundled database (needs a CPU with AVX for 5.0+). |
| port | number | 3080 | Host port for the LibreChat web UI. |
| mongo_port | number | 27017 | Host port for the bundled MongoDB. |
| creds_key key | string | "0000000000000000000000000000000000000000000000000000000000000000" | 32-byte (64 hex chars) key for encrypting stored credentials. CHANGE THIS. |
| creds_iv | string | "00000000000000000000000000000000" | 16-byte (32 hex chars) IV for encrypting stored credentials. CHANGE THIS. |
| jwt_secret set me | string | "change_me_jwt_secret_to_a_long_random_value_0000" | Secret for signing JWT access tokens. CHANGE THIS. |
| jwt_refresh_secret set me | string | "change_me_jwt_refresh_secret_to_a_long_random_value_0000" | Secret for signing JWT refresh tokens. CHANGE THIS. |
| allow_registration | string | "true" | Allow new users to register (true/false). |
| data_volume | string | "librechat_data" | Named volume for LibreChat app data (/app/data). |
| uploads_volume | string | "librechat_uploads" | Named volume for uploaded files (/app/uploads). |
| images_volume | string | "librechat_images" | Named volume for generated images (/app/client/public/images). |
| logs_volume | string | "librechat_logs" | Named volume for API logs (/app/api/logs). |
| mongo_data_volume | string | "librechat_mongo_data" | Named volume for MongoDB data. |
| constraints | list | [] | Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true". |
| resources | object | {
cpu = 1000
memory = 2048
} | Resources for the LibreChat app task. |
| mongo_resources | object | {
cpu = 500
memory = 1024
} | Resources for the bundled MongoDB task. |
No variables match.
This pack stores data in 5 Docker named volumes:
librechat_mongo_datalibrechat_datalibrechat_uploadslibrechat_imageslibrechat_logs
⚠ This pack bundles a database. A cold copy of the volume can be inconsistent — for a reliable backup, dump the DB (pg_dump / mysqldump) or stop the job while backing up.
restic
# Run on the node hosting this pack. Point restic at your repo first: # export RESTIC_REPOSITORY="s3:https://<account>.r2.cloudflarestorage.com/<bucket>" # export RESTIC_PASSWORD="<repo-password>" # export AWS_ACCESS_KEY_ID=<key> AWS_SECRET_ACCESS_KEY=<secret> restic backup \ /var/lib/docker/volumes/librechat_mongo_data/_data \ /var/lib/docker/volumes/librechat_data/_data \ /var/lib/docker/volumes/librechat_uploads/_data \ /var/lib/docker/volumes/librechat_images/_data \ /var/lib/docker/volumes/librechat_logs/_data
rclone (sync to S3/R2)
rclone sync /var/lib/docker/volumes/librechat_mongo_data/_data backup:<bucket>/librechat_mongo_data rclone sync /var/lib/docker/volumes/librechat_data/_data backup:<bucket>/librechat_data rclone sync /var/lib/docker/volumes/librechat_uploads/_data backup:<bucket>/librechat_uploads rclone sync /var/lib/docker/volumes/librechat_images/_data backup:<bucket>/librechat_images rclone sync /var/lib/docker/volumes/librechat_logs/_data backup:<bucket>/librechat_logs
Paths assume the default Docker volume location (/var/lib/docker/volumes). Restore by stopping the job, restoring files into the same volume, and re-running the pack.
LibreChat is a feature-rich, open-source AI chat platform — a self-hosted, multi-user ChatGPT alternative. One UI talks to many providers (OpenAI, Anthropic, Google, Azure, AWS Bedrock, Ollama and any OpenAI-compatible endpoint), with conversation branching, presets, assistants and agents, code interpreter, file uploads, prompt libraries and full user authentication.
This pack deploys LibreChat all-in-one as a single host-networked Nomad job: MongoDB (bundled as a prestart sidecar) plus the LibreChat app. Message search (Meilisearch) is disabled by default to keep the footprint small.
nomad-pack run librechat --registry=nomploy \
--var creds_key=$(openssl rand -hex 32) \
--var creds_iv=$(openssl rand -hex 16) \
--var jwt_secret=$(openssl rand -hex 32) \
--var jwt_refresh_secret=$(openssl rand -hex 32)
Open http://<node-ip>:3080, register the first account, then add your provider
API keys in each endpoint (they default to user_provided, so users supply
their own).
| Variable | Default | Description |
|---|---|---|
image |
ghcr.io/danny-avila/librechat:latest |
App image (pin a tag in production). |
mongo_image |
mongo:7.0 |
Bundled MongoDB (needs AVX for 5.0+). |
port |
3080 |
Host port for the web UI. |
mongo_port |
27017 |
Host port for MongoDB. |
creds_key |
placeholder (64 hex) | Credential-encryption key — change this. |
creds_iv |
placeholder (32 hex) | Credential-encryption IV — change this. |
jwt_secret |
placeholder | JWT access-token secret — change this. |
jwt_refresh_secret |
placeholder | JWT refresh-token secret — change this. |
allow_registration |
true |
Allow new users to sign up. |
resources |
1000 MHz / 2048 MB | App task resources. |
Data persists in separate volumes for MongoDB, app data, uploads, images and
logs. To enable message search, run Meilisearch and set SEARCH=true with the
appropriate MEILI_* env vars.