{"slug": "self-hosting-librechat-one-chatgpt-ui-for-your-whole-team-billed-per-token-of", "title": "Self-hosting LibreChat: one ChatGPT UI for your whole team, billed per token instead of per seat", "summary": "A developer detailed how to self-host LibreChat, an open-source ChatGPT-style interface, to replace per-seat subscriptions with per-token API billing for teams. The guide covers setup, security fixes, and common failures, noting that a five-person team could save from $100/month on seats to about $20-40 in hosting and API costs. The developer also disclosed co-founding livemy.app, which offers a one-click LibreChat template.", "body_md": "ChatGPT Plus is $20 per person per month. A team of five is $100/month, forever, whether anyone used it much or not.\n\nLibreChat is the open-source ChatGPT-style interface that turns that per-seat subscription into a per-token API bill. One instance, one login page, and whichever models you plug in behind it: OpenAI, Anthropic, Google, Azure OpenAI, Groq, DeepSeek, or a local model through Ollama.\n\nThis is the setup, the security pass most quick-starts skip, and the five failures that show up once real people use it.\n\nCurrent LibreChat (v0.8.x) is well past \"a chat window.\" It ships agents, MCP support, a code interpreter, artifacts, file chat and proper multi-user authentication. The feature list reads like a paid product because it is chasing several of them at once.\n\nThe part that matters architecturally: **MongoDB holds accounts and conversation history**. That is where your team's accumulated context lives, and it is the thing you can lose.\n\n```\ngit clone https://github.com/danny-avila/LibreChat.git\ncd LibreChat\ncp .env.example .env\ndocker compose up -d\n```\n\nOpen port 3080. Register. **The first account created becomes the admin** — do this yourself before anyone else has the URL.\n\nThat is the honest quick-start. What it hides is everything around it: a reverse proxy and TLS so it is not served over plain HTTP, keeping the MongoDB volume persistent, updates (LibreChat ships often), and backups. Budget 1–2 hours for a proper first deploy, not fifteen minutes.\n\nDisclosure so you can weigh the rest: I co-founded [livemy.app](https://livemy.app), which has a one-click LibreChat template. Coolify and Dokploy also ship LibreChat templates and are the obvious picks if you already run your own VPS, and plain Compose on a $5 box is the cheapest path if you enjoy servers.\n\nA flat subscription and a token bill charge for different things.\n\n$20/month flat is a bargain if you use it constantly, and mostly a round number if you use it a few times a week. API pricing bills for exactly the tokens the model read and wrote, at rates the providers set directly.\n\nFor light-to-moderate users, which is most of a team, API usage lands at a fraction of a flat seat. Running costs:\n\nFive-person team: ~$100/month on seats versus roughly $10 hosting plus $10–30 of actual API usage. The gap grows with every seat you do not buy.\n\nThe honest counter-case: one heavy solo user, all day, every day. Flat $20 can beat token pricing there. LibreChat is a team play.\n\nLibreChat without keys is a beautiful empty shell. The app runs, the model list is blank or every message errors. It does not come with AI, it comes with sockets for AI.\n\n**Fix.** Create keys with at least one provider, set them in your environment, restart, send one test message before inviting anyone.\n\n`.env`\n\nThe example config ships placeholder JWT secrets. Leave them and you share session-signing keys with every other instance that also skipped this step, which defeats the point of having authentication at all.\n\n**Fix.** Generate long random values before first launch:\n\n```\nopenssl rand -hex 32\n```\n\nBy default, anyone who finds your instance can create an account, and every message they send spends *your* API budget. A public LibreChat with open signup is free ChatGPT for strangers, billed to your card.\n\n**Fix.** Disable open registration once your team is in. Set provider-side spending caps as the backstop, because config is a policy and a cap is a wall.\n\nAll history, accounts and settings live in MongoDB. If the volume is not persistent, the next container rebuild wipes everyone's conversations. For a tool whose entire value is accumulated context, this is the most demoralising possible failure.\n\n**Fix.** Verify persistence *before* real use: restart the whole stack, confirm chats survive. Then schedule backups.\n\nCore LibreChat is light. Enable search indexing and file-chat (RAG) and memory climbs. On a small instance that shows up as random slowness and OOM-killed containers, not a clear error message.\n\n**Fix.** 2 GB for chat-only. Enabling search and file chat for a team means more, or turn features on one at a time and watch memory.\n\nBefore you hand out the URL:\n\nFive minutes. Skipping step 3 or 4 is how people end up funding a stranger's model usage.\n\nLibreChat is the rare self-hosted app where the economics argue as loudly as the ideology. The per-seat model does not survive contact with a shared instance and API keys.\n\nIf you are one person using AI all day, keep your subscription. If you are a team of three or more where usage is uneven, this pays for itself the first month.\n\n*What did you hit first when self-hosting it? I am betting on either the empty model list or the wiped Mongo volume, and I would like to know which one wins.*", "url": "https://wpnews.pro/news/self-hosting-librechat-one-chatgpt-ui-for-your-whole-team-billed-per-token-of", "canonical_source": "https://dev.to/dmytro_chervonyi/self-hosting-librechat-one-chatgpt-ui-for-your-whole-team-billed-per-token-instead-of-per-seat-162a", "published_at": "2026-09-03 08:35:21+00:00", "updated_at": "2026-09-03 08:54:17.608809+00:00", "lang": "en", "topics": ["developer-tools", "ai-products", "ai-tools", "ai-infrastructure"], "entities": ["LibreChat", "OpenAI", "Anthropic", "Google", "Azure OpenAI", "Groq", "DeepSeek", "Ollama"], "alternates": {"html": "https://wpnews.pro/news/self-hosting-librechat-one-chatgpt-ui-for-your-whole-team-billed-per-token-of", "markdown": "https://wpnews.pro/news/self-hosting-librechat-one-chatgpt-ui-for-your-whole-team-billed-per-token-of.md", "text": "https://wpnews.pro/news/self-hosting-librechat-one-chatgpt-ui-for-your-whole-team-billed-per-token-of.txt", "jsonld": "https://wpnews.pro/news/self-hosting-librechat-one-chatgpt-ui-for-your-whole-team-billed-per-token-of.jsonld"}}