App template
LibreChat
An AI chat app with sign-in, MongoDB, PostgreSQL for document search and Meilisearch.
- Memory when idle
- about 760 MiB
- CI measures it once the app is ready and before any traffic. Leave room for more.
- Tested on
- x86 servers
Introduction
LibreChat is a chat app for AI models. People sign in, talk to models, and search their conversations.
This template runs LibreChat behind your domain, with MongoDB for data, Meilisearch for search, and PostgreSQL with pgvector for document search. Chat and document embeddings use the OpenAI API key you chose in the install form.
Values you provide
Administrator emailRequired
Initial administrator email; password is generated in app-secrets/admin-password. Public registration is disabled. Changing the Secret later does not reset an existing password.
OpenAI API key secretRequired
Existing Secret with real OPENAI_API_KEY used by chat and RAG embeddings.
Made for you
These values are generated at deploy and kept in a Kubernetes Secret, shown as Secret/key.
- app-secrets/admin-password
- app-secrets/mongo-password
- app-secrets/jwt-secret
- app-secrets/jwt-refresh-secret
- app-secrets/creds-key
- app-secrets/creds-iv
- app-secrets/meili-key
Getting started
-
In Zeabur OSS, open the
librechatservice. When Overview shows its replica as ready, the service is up. Its domain is on the Networking tab under Public domains, for examplechat.example.com. -
The template creates the administrator account at deploy time, from the administrator email you entered in the install form. Get its password. Open Variables, click
app-secretsunder From config files and secrets, and click the eye icon next toadmin-password. Without Zeabur OSS, read Secretapp-secrets, keyadmin-password, with kubectl:kubectl -n <namespace> get secret app-secrets -o jsonpath='{.data.admin-password}' | base64 -d -
Sign in with the administrator email and that password. Public registration is off, so nobody else can sign up. Changing the Secret later does not reset the password of an existing account.
The other keys in app-secrets (mongo-password, jwt-secret, jwt-refresh-secret, creds-key, creds-iv and meili-key) are for LibreChat’s own services. Keep them for the life of the data.
Configuration
Change the OpenAI API key
The key is in the Secret you chose in the install form, key OPENAI_API_KEY. On the librechat service’s Variables tab, click that Secret under From config files and secrets, enter a new value, then review and apply. Running replicas keep the old key, so click Restart at the top of the librechat service page and of the rag-api service page.
See OpenAI.
Back up the data
LibreChat keeps users and chats in the mongodb database, and the document embeddings in the rag-db database. In the project, open each of them. Under Backups, set up S3 backups. To get a file instead, click More → Export. Files that people upload are on the volume librechat-data, mounted at /app/uploads. Copy it with the Files tab of the librechat service. For a large folder, use kubectl. kubectl -n <namespace> get pods lists the replica names:
kubectl -n <namespace> cp <replica>:/app/uploads ./librechat-uploads
Keep the Secret app-secrets with the backup, as Getting started says. See Create, back up, and restore databases and Download a database dump in the Zeabur OSS docs.
Troubleshooting
The page shows 502 or does not load
Open the librechat service in Zeabur OSS. Check that Overview shows its replica as ready, then read the Logs tab. If the replica is not ready, open Deployments and switch to Events. If Events show OOMKilled, the service ran out of memory. Raise Maximum memory under Settings → Compute. If the service is slow or keeps reconnecting, open the Usage tab. Near memory max means the memory is close to the limit. Raise Maximum memory the same way. If chats work but file search fails, check the rag-api service the same way. If the domain or the certificate stays pending, see Troubleshooting on the domains page.
Without Zeabur OSS, read the logs with kubectl -n <namespace> logs deployment/librechat and the events with kubectl -n <namespace> get events --sort-by=.lastTimestamp.
See Adjust replicas, resources, and health checks and View logs, events, and usage, and open a terminal in the Zeabur OSS docs.
A chat or a file search fails with a model provider error
Chat and document embeddings use the key OPENAI_API_KEY from the Secret you chose in the install form. When a request fails, read the Logs tab of the librechat service. For a file search, read the rag-api service as well. Then check three things. The key must be valid. The model you picked must be available to that key. And your account must not be over its rate limit or quota at OpenAI. See OpenAI in the LibreChat docs.
Resources
Each service is guaranteed the first amount and can use up to the second.
librechat
Ports
3080
CPU
0.5 cores to 2 cores
Memory
1 GiB to 3 GiB
rag-api
Ports
8000
CPU
0.25 cores to 2 cores
Memory
512 MiB to 2 GiB
meilisearch
Ports
7700
CPU
0.2 cores to 1 core
Memory
512 MiB to 2 GiB
rag-db
Ports
5432
CPU
0.25 cores to 2 cores
Memory
512 MiB to 2 GiB
mongodb
Ports
27017
CPU
0.25 cores to 2 cores
Memory
512 MiB to 2 GiB
Technical details
This release
- Version
- latest
- Licence
- MIT AND SSPL-1.0 AND PostgreSQL AND Apache-2.0
- Homepage
- github.com
- Source file
- templates/librechat/template.yaml @ v0.6.3
Tested in CI
CI installs these exact files on a new cluster, waits until they are ready, then records the idle memory.
| Distribution | Platform | Kubernetes | Passed | Idle memory |
|---|---|---|---|---|
| kind | linux/amd64 | v1.37.0 | 761 MiB |
Security
The app pods run as non-root with read-only images and no API token. The Percona MongoDB pods use TLS and authentication and stay restricted, with one exception: a writable root filesystem for TLS files that are hardcoded to /tmp. CloudNativePG uses limited tokens that the operator manages. MongoDB requires client certificates. LibreChat presents a 90-day client certificate from the cluster CA, cert-manager renews it, and LibreChat restarts when it changes.
Known risks
Risk
The Percona v1.23.1 entry scripts write TLS files to the hardcoded paths /tmp/tls.pem and /tmp/tls-internal.pem. The custom resource has no way to mount /tmp separately in the main container.
How it is handled
Only the operator-managed pods get this explicit exception, readOnlyRootFilesystem=false. They still require TLS, run as UID 1001, drop all capabilities, allow no escalation and use RuntimeDefault. All ordinary application images stay read-only. Nothing is changed after reconcile, and TLS is never turned off.
Risk
The MongoDB server uses the SSPL-1.0 license, which sets duties for anyone who offers MongoDB as a service. SSPL is not OSI-approved.
How it is handled
You must acknowledge the exact license when you deploy. The Mongo service is private and reachable only by the app. The Apache-2.0 license of the operator covers only the operator. Meilisearch uses the MIT community image, and the BUSL enterprise modules are not included.
Risk
The CloudNativePG instance manager needs Kubernetes API credentials.
How it is handled
The catalog operator creates a service account and RBAC permissions for each cluster. The ordinary app pods and the Percona pods have their tokens turned off.
Risk
Meilisearch has no operator in the catalog. The local files and the databases are also restored from separate points in time.
How it is handled
Meilisearch runs as a hardened single-replica StatefulSet. Back up the files, MongoDB, pgvector, Meilisearch dumps and the generated Secrets together. Stop the writers so the file backup is consistent. Test a full restore in an isolated namespace, and check login, saved credentials, search and document retrieval.
Risk
The app shows the upstream LibreChat privacy policy and terms links.
How it is handled
Set your own privacy policy and terms of service before you open the site to the public.
Risk
MongoDB 8.0.32 does not start on Linux kernel 6.19 or newer (SERVER-121912). The template sets GLIBC_TUNABLES as a workaround, and this has not been verified on a real cluster.
How it is handled
If MongoDB crashes at start on a new kernel, check that the Percona pods carry GLIBC_TUNABLES=glibc.pthread.rseq=1.
What the cluster needs
Zeabur OSS suggests the components a cluster is missing. Without it, install them first.