Overview
Tambo can be self-hosted on your infrastructure using Docker. You get the same features as Tambo Cloud but with complete control over deployment, data, and scaling. The self-hosted stack includes:- Web Dashboard (Next.js) - User interface for managing projects and API keys
- API Service (NestJS) - Backend handling agent execution and conversation state
- PostgreSQL - Database for threads, messages, and configuration
- MinIO (optional) - S3-compatible storage for file uploads
Architecture
Tambo consists of three main services:| Service | Technology | Port | Description |
|---|---|---|---|
| web | Next.js | 8260 | Dashboard and UI |
| api | NestJS | 8261 | REST API and agent execution |
| postgres | PostgreSQL 17 | 5433 | Data persistence |
Prerequisites
- Docker and Docker Compose installed
- OpenAI API key (or compatible provider)
- 2GB+ RAM available
- Ports 8260, 8261, and 5433 available
# Database (required)
POSTGRES_PASSWORD=your-secure-password-here
POSTGRES_USER=postgres
POSTGRES_DB=tambo
# Security secrets (required - use 32+ character random strings)
API_KEY_SECRET=your-32-character-api-key-secret
PROVIDER_KEY_SECRET=your-32-character-provider-secret
NEXTAUTH_SECRET=your-nextauth-secret
# LLM Provider (required)
FALLBACK_OPENAI_API_KEY=your-openai-api-key
# URLs (required for production)
NEXTAUTH_URL=http://localhost:8260
NEXT_PUBLIC_TAMBO_API_URL=http://localhost:8261
Environment Variables
Required Variables
These must be set for Tambo to function:Optional Variables
Docker Compose Services
Web Service
API Service
PostgreSQL
Management Scripts
Tambo includes helper scripts inscripts/cloud/:
Start/Stop Services
Database Operations
Logs
Rebuilding
Production Deployment
Security Checklist
Use strong secrets
Use strong secrets
Generate secure random values for all secrets:
Enable HTTPS
Enable HTTPS
Use a reverse proxy (nginx, Caddy, Traefik) with SSL certificates:
Restrict network access
Restrict network access
Use Docker networks to isolate services:
Set up authentication
Set up authentication
Configure OAuth providers or email login:
Scaling
For production load:- Horizontal scaling: Run multiple API instances behind a load balancer
- Database: Use managed PostgreSQL (AWS RDS, Cloud SQL, etc.)
- Caching: Add Redis for session storage
- File storage: Use S3 or compatible object storage
Monitoring
Backup and Restore
Backup Database
Restore Database
Automated Backups
Troubleshooting
Services won't start
Services won't start
Check logs for errors:Common issues:
- Port conflicts (8260, 8261, 5433 in use)
- Missing environment variables
- Database connection failed
Database connection errors
Database connection errors
Verify PostgreSQL is running:Check connection string:
API returns 500 errors
API returns 500 errors
Check API logs:Common causes:
- Missing migrations (run
init-database.sh) - Invalid API key secrets
- LLM provider key not set
Web dashboard won't load
Web dashboard won't load
Verify web service is running:Check environment:
Updating
Update to Latest Version
Version Pinning
For production, pin to specific versions:Next Steps
Environment Variables
Complete environment variable reference
Kubernetes Deployment
Deploy to Kubernetes
Operations Guide
Backup, monitoring, and maintenance
Troubleshooting
Common issues and solutions