Deploy LibreChat on Ubuntu with Docker — the open-source ChatGPT-like interface supporting OpenAI, Anthropic Claude, Google Gemini, Ollama local models, and 20+ AI providers in one unified self-hosted platform.
Grab the automated bash script from GitHub to follow along with the video.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/ai/librechat/librechat-ubuntu.sh
chmod +x librechat-ubuntu.sh
sudo bash librechat-ubuntu.sh
The script installs Docker and starts LibreChat with MongoDB and Meilisearch. LibreChat will be available on port 3080. First startup takes 2-3 minutes as containers initialize and the search index is built.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/ai/librechat/librechat-ubuntu.sh
chmod +x librechat-ubuntu.sh
sudo bash librechat-ubuntu.sh
Open your browser and navigate to LibreChat. Register the first account — it automatically becomes the admin. You'll see the chat interface ready to use. No AI providers are connected yet until you add API keys:
http://<your-server-ip>:3080
Edit the .env file in the LibreChat directory and add your API keys. Restart LibreChat after saving. For local models, point to your Ollama instance instead:
# Edit .env file
OPENAI_API_KEY=sk-...your-openai-key...
ANTHROPIC_API_KEY=sk-ant-...your-anthropic-key...
GOOGLE_KEY=...your-google-key...
# For local Ollama models (no API key needed)
OLLAMA_BASE_URL=http://localhost:11434
# Restart to apply changes
docker compose down && docker compose up -d
Select your AI provider from the model dropdown in the chat interface and start a conversation. Explore features: upload images for vision analysis, use the Agents tab to create custom AI personas with specific system prompts, organize conversations in folders, and enable plugins like web search or image generation from the plugin store.
| Port | Purpose |
|---|---|
| 3080 | LibreChat Web UI |
| 27017 | MongoDB database (internal) |
| 7700 | Meilisearch search engine (internal) |
LibreChat is a free, open-source self-hosted AI chat platform that provides a ChatGPT-like experience while supporting 20+ AI providers from a single interface. Unlike ChatGPT, you own and operate the platform — conversations are stored in your MongoDB database, API keys are managed server-side, and users never need to create OpenAI accounts. LibreChat supports OpenAI, Anthropic Claude, Google Gemini, Mistral, Groq, Azure OpenAI, AWS Bedrock, Ollama (local models), and any OpenAI-compatible API. Multi-user support with individual conversation histories makes it suitable for teams or organizations sharing AI access.
LibreChat solves several problems with commercial AI chat platforms: cost control (share one API key among many users with usage tracking), privacy (conversations stay on your server, not in OpenAI's training data), flexibility (switch between Claude and GPT-4 mid-conversation), and customization (create AI agents with custom system prompts for specific workflows). For teams who want to provide ChatGPT-like access internally without everyone needing separate subscriptions, LibreChat is the ideal solution.
Port 3080 (TCP) is the LibreChat web UI — expose this via a reverse proxy on port 443 with HTTPS. Port 27017 (MongoDB) and 7700 (Meilisearch) are internal and should never be exposed. If running Ollama on the same server, Ollama listens on port 11434 which should also remain internal.
Open WebUI is another self-hosted AI chat frontend, primarily focused on Ollama local models. Anything LLM is simpler to set up with fewer features. LobeChat is a polished alternative with a focus on agent customization. Chatbot UI (by McKay Wrigley) is minimalist and Vercel-deployable. LibreChat stands out for the broadest multi-provider support and the most complete multi-user feature set among self-hosted AI chat platforms.
Avoid LibreChat if you only need AI access for one person — the official ChatGPT Plus or Claude.ai subscription is simpler. Don't use it if you're not prepared to manage API keys and billing — you're responsible for API costs across all users. For teams that need advanced AI features like code execution sandboxes or enterprise SSO, consider building on top of the official APIs directly.
PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.
LibreChat is a free, open-source self-hosted chat interface that works with 20+ AI providers: OpenAI (GPT-4o, GPT-4), Anthropic (Claude 3.5 Sonnet, Claude Opus), Google (Gemini), Mistral, Groq, Ollama (local models), Azure OpenAI, AWS Bedrock, and any OpenAI-compatible API. All providers are available from the same chat interface — users can switch models mid-conversation or compare responses across providers.
Yes. LibreChat integrates directly with Ollama, which runs local models like Llama 3, Mistral, Gemma, Phi-3, and more on your own hardware (CPU or GPU). Set OLLAMA_BASE_URL in LibreChat's config to point to your Ollama instance. You can then chat with local models without sending data to any external API — ideal for privacy-sensitive use cases or air-gapped environments.
Yes. LibreChat has a full user authentication system with email/password registration, Google OAuth, GitHub OAuth, and OpenID Connect. Admins can manage users, set API usage limits per user, enable or disable specific AI providers for specific users, and view usage statistics. Multi-user mode lets teams share one LibreChat instance with individual conversation histories and settings.
LibreChat includes: file and image uploads (for vision models), code syntax highlighting, LaTeX math rendering, conversation search and folders, custom system prompts (Agents), prompt templates, speech-to-text input, text-to-speech output, MCP tool support, and plugin-style tools (web search, image generation via DALL-E, code execution). The UI closely matches ChatGPT's experience with additional multi-model switching.
LibreChat itself is secure — it stores conversations in MongoDB on your server and passes API keys server-side (users never see your API keys). For team use with sensitive data, the main consideration is which AI provider you use: if you use OpenAI or Anthropic APIs, your messages still leave your server and go to those providers. For fully private AI, use Ollama with local models — no data leaves your infrastructure.
API keys are configured in LibreChat's .env file. Set OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_KEY, etc. in the environment variables before starting the container. Restart LibreChat after adding keys: docker compose down && docker compose up -d. Users can also optionally provide their own API keys via the UI if you enable USER_PROVIDED_KEY in config.
Yes. LibreChat supports image generation via DALL-E 3 (using your OpenAI API key), Stable Diffusion (via local or remote endpoints), and other image generation APIs. Enable the image generation plugin in the UI and configure the provider in .env. Generated images are stored on your server and displayed inline in the chat conversation.
LibreChat releases frequent updates. To update, pull the latest Docker image: docker pull ghcr.io/danny-avila/librechat:latest, then recreate the container: docker compose down && docker compose up -d. Your conversations and configuration are preserved in the MongoDB volume. Check the LibreChat GitHub releases page for changelogs before updating — some releases require config file migrations.