Guide to Deploy LibreChat on Cloud VPS: Optimized AI Chatbot Platform with DeepSeek, GPT-4o, and Claude Sonnet
Detailed guide to deploy LibreChat on Cloud VPS for building an optimized enterprise AI chatbot platform integrating DeepSeek, GPT-4o, and Claude Sonnet.
LibreChat is an open-source, self-hosted AI chatbot platform that enables businesses to deploy and customize AI chatbot systems using leading language models such as DeepSeek, GPT-4o, and Claude Sonnet on private infrastructure. This guide walks you through deploying LibreChat on a High-RAM Cloud VPS with optimized configurations to build a powerful, secure, and automated enterprise AI chatbot platform.
System Requirements and Preparation
To deploy LibreChat effectively, ensure the following:
- Cloud VPS with at least 16GB RAM and 4 CPU cores (recommended 32GB RAM for multiple models)
- Operating system: Ubuntu 22.04 LTS or Debian 11/12
- Stable internet connection (minimum 100Mbps)
- Docker and Docker Compose installed
- SSL/TLS certificate (recommended: Let's Encrypt)
Prepare your environment before deployment:
- Create a VPS account at Cloud VPS
- Connect via SSH to your VPS
- Update the system:
sudo apt update && sudo apt upgrade -y - Install Docker:
sudo apt install docker.io docker-compose -y
Deploying LibreChat on VPS
LibreChat uses Docker Compose for deployment. You’ll need to create a docker-compose.yml file with configurations for integrated AI models.
1. Create Directory and Configuration
Create a directory and generate the configuration file:
mkdir librechat && cd librechat
nano docker-compose.yml
2. Configure docker-compose.yml
Below is an optimized configuration for LibreChat with DeepSeek, GPT-4o, and Claude Sonnet integration:
version: '3.8'
services:
librechat:
image: librechat/librechat:latest
container_name: librechat
ports:
- "3000:3000"
volumes:
- ./data:/app/data
environment:
- VITE_APP_NAME=MyAIChatbot
- VITE_API_URL=http://localhost:3001
- VITE_DEFAULT_MODEL=deepseek
- VITE_ENABLE_OPENAI=true
- VITE_ENABLE_CLAUDE=true
- VITE_ENABLE_DEEPSEEK=true
- VITE_ENABLE_GPT4O=true
- VITE_DEFAULT_TEMPERATURE=0.7
restart: unless-stopped
openai-proxy:
image: ghcr.io/librechat/openai-proxy:latest
container_name: openai-proxy
ports:
- "3001:3001"
environment:
- OPENAI_API_KEY=your_openai_key
- OPENAI_API_BASE=https://api.openai.com/v1
restart: unless-stopped
deepseek-proxy:
image: ghcr.io/librechat/deepseek-proxy:latest
container_name: deepseek-proxy
ports:
- "3002:3002"
environment:
- DEEPSEEK_API_KEY=your_deepseek_key
- DEEPSEEK_API_BASE=https://api.deepseek.com/v1
restart: unless-stopped
claude-proxy:
image: ghcr.io/librechat/claude-proxy:latest
container_name: claude-proxy
ports:
- "3003:3003"
environment:
- CLAUDE_API_KEY=your_claude_key
- CLAUDE_API_BASE=https://api.anthropic.com/v1
restart: unless-stopped
Replace your_openai_key, your_deepseek_key, and your_claude_key with actual API keys from the providers.
Integrating and Optimizing AI Models
LibreChat supports integration with multiple AI models via proxies. Optimize each model as follows:
DeepSeek
- Register at deepseek.com to obtain an API key
- Ensure models like
deepseek-coderordeepseek-aiare enabled - Test the API:
curl -X POST https://api.deepseek.com/v1/completions -H "Authorization: Bearer YOUR_KEY" -d '{"model": "deepseek-coder", "prompt": "Hello"}'
GPT-4o
- Request an API key from OpenAI
- Set
temperature=0.3for accurate responses - Set
max_tokens=2048to avoid truncation
Claude Sonnet
- Register at Anthropic
- Select the
claude-3-sonnetmodel - Set
max_tokens_to_sample=1000for optimal performance
Verification and Testing
After starting the services, access http://your-vps-ip:3000 to verify:
- Log in with the default credentials (if not already set)
- Select AI models from the list:
DeepSeek,GPT-4o,Claude Sonnet - Send a test query: "Explain self-hosted AI?"
- Check responses from each model
Troubleshooting
- Model connection failed: Verify API keys and access permissions
- LibreChat won't start: Check logs with
docker logs librechat - Slow performance: Increase VPS RAM or reduce concurrent models
- 403 Forbidden: Validate proxy configuration and API endpoints
References
- LibreChat GitHub – Official documentation
- Deploy Uptime Kuma – Monitor system status
- Deploy Glitchtip – Track application errors
Assumptions: Users have a VPS account, SSH access, and Docker knowledge. No prior AI or API expertise is assumed. The guide focuses on practical deployment, not model performance comparisons or response quality evaluation.
High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache
Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.
VPS-4E
10% VAT included
- CPU: 4 vCPU
- RAM: 8 GB
- SSD: 50 GB NVMe
