Installation with Docker
Deploy Enclava using Docker Compose for a complete, production-ready setup.
Quick Start
1. Clone Repository
git clone https://github.com/enclava-ai/enclava.git
cd enclava
2. Configure Environment
# Copy example environment file
cp .env.example .env
# Edit with your settings
vim .env
3. Start Services
# Start all services (builds containers first time)
docker compose up --build
# Or run in background
docker compose up --build -d
4. Access Enclava
After containers start, access:
- Main Application: http://localhost
- API Documentation: http://localhost/api/v1/docs
- Qdrant Dashboard: http://localhost:56333/dashboard
5. Default Login
- Username:
admin - Password:
admin123
Important: Change default credentials immediately in production!
Required Environment Variables
Edit .env with these required values:
# Security (REQUIRED)
JWT_SECRET=your-super-secret-jwt-key-here-change-in-production
PRIVATEMODE_API_KEY=your-privatemode-api-key
# Base URL (REQUIRED)
BASE_URL=localhost
# Database (REQUIRED)
DATABASE_URL=postgresql://enclava_user:enclava_pass@enclava-postgres:5432/enclava_db
REDIS_URL=redis://enclava-redis:6379
# Admin User (created on first startup)
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=admin123
Optional Configuration
These variables have secure defaults but can be customized:
# Application Settings
APP_NAME=Enclava
APP_DEBUG=false
APP_HOST=0.0.0.0
APP_PORT=8000
# Qdrant (Vector DB for RAG)
QDRANT_HOST=enclava-qdrant
QDRANT_PORT=6333
# RAG Embedding Settings
RAG_EMBEDDING_MAX_REQUESTS_PER_MINUTE=12
RAG_EMBEDDING_BATCH_SIZE=3
# Web Search (Brave)
BRAVE_SEARCH_API_KEY=your_brave_api_key
# MCP Servers
MCP_ORDER_API_URL=https://order-api.example.com
MCP_ORDER_API_KEY=optional_key
Production Deployment
SSL/TLS Setup
For production, use HTTPS:
# In .env
BASE_URL=your-domain.com
Enclava automatically detects HTTPS and configures CORS and URLs accordingly.
Resource Allocation
Edit docker-compose.yml to allocate resources:
services:
enclava-backend:
deploy:
resources:
limits:
cpus: '4'
memory: 4G
reservations:
cpus: '2'
memory: 2G
Health Checks
# Check container status
docker compose ps
# View logs
docker compose logs -f enclava-backend
Backup Strategy
# Backup PostgreSQL
docker compose exec enclava-postgres pg_dump -U enclava_user enclava_db > backup.sql
# Backup Qdrant
docker compose exec enclava-qdrant cp /qdrant/storage ./qdrant_backup
Troubleshooting Installation
Containers won't start
# Check port conflicts
netstat -tulpn | grep -E ':(5432|6379|6333|8000|3000)'
# Check Docker logs
docker compose logs
Database connection errors
# Verify database is running
docker compose exec enclava-postgres psql -U enclava_user -d enclava_db -c "SELECT 1"
# Check database URL in .env
grep DATABASE_URL .env
Permission errors
# Check file permissions
ls -la .env
chmod 600 .env # Ensure only owner has read/write
Next Steps
After successful installation:
- First Steps - Configure and test your instance
- Authentication - Create API keys
- OpenAI API - Make your first API call