LibreChat is one of the better self-hosted ChatGPT alternatives — multi-provider chat UI, agents, file uploads, the works. But if you've actually tried to self-host it past a weekend demo, two things bite you:
-
Uploaded files vanish on redeploy. LibreChat writes user uploads to
/app/uploadsand agent-generated images to/app/client/public/images— both inside the container's own filesystem. Redeploy (or just a container restart on most PaaS platforms) and the files are gone, but MongoDB still has message rows pointing at URLs that now 404. -
File chat / RAG wants an OpenAI key by default. The RAG API LibreChat ships (
librechat-rag-api-dev-lite) does the embeddings via OpenAI unless you configure a local model yourself. A lot of self-host guides just tell you to drop inRAG_OPENAI_API_KEYand move on — fine if you're already paying OpenAI for everything else, less fine if the whole point was to run something you don't have to meter.
Neither is a LibreChat bug exactly — it's what happens when a docker-compose stack built for a VM with a persistent disk gets deployed somewhere that treats the container filesystem as disposable.
The fix, if you want to do it yourself
- Mount a real volume at
/app/uploads, and symlink/app/client/public/imagesinto it so both survive a restart. - Swap the RAG API's embeddings provider to something that runs locally —
sentence-transformers/all-MiniLM-L6-v2on CPU works fine for document chat and costs nothing per query. SetEMBEDDINGS_PROVIDERaccordingly and skip the OpenAI key entirely for the RAG path (you'll still want a provider key for the actual chat models, obviously). - Pin your image tags. LibreChat, Mongo, Meilisearch and pgvector all move fast enough that
lateston a stack with a live data volume is asking for a migration you didn't plan for.
All of that is upstream LibreChat config — nothing here is proprietary, and the official repo has the docker-compose to build it from scratch.
Or the one-click version
I maintain a Railway template that does the above out of the box — file RAG runs on the local MiniLM model with no API key needed, uploads persist across redeploys, and every image tag is pinned (LibreChat v0.8.7, Mongo 8.3.7, Meilisearch v1.51.0, pgvector 0.8.6-pg17). Full disclosure: I get a kickback if you deploy through it.
Rough edges worth knowing before you deploy either way: the local embedding model is CPU-only, so it's fine for personal/small-team document volumes but won't keep up with heavy concurrent RAG traffic — if that's your use case you probably do want a real embeddings API. And LibreChat's librechat.yaml config controls which providers/endpoints show up in the UI, so budget a few minutes to edit that for whichever models you actually want exposed.
Happy to answer questions on the RAG setup specifically — that was the part that took the most trial and error to get working without a key.
Top comments (0)