This guide is for deploying and self-hosting Tambo in production or staging environments.
Looking to contribute? See CONTRIBUTING.md for local development setup.
Tambo consists of three services:
| Service | Technology | Default Port | Description |
|---|---|---|---|
| Web | Next.js | 3210 | Dashboard and user interface |
| API | NestJS | 3211 | REST API for client requests |
| PostgreSQL | PostgreSQL 17 | 5433 | Database |
- Docker and Docker Compose installed
- OpenAI API key (or compatible provider)
git clone https://github.com/tambo-ai/tambo.git
cd tambo./scripts/cloud/tambo-setup.shThis creates docker.env from docker.env.example.
Edit docker.env with your values. At minimum, you must set:
# Required
POSTGRES_PASSWORD=your-secure-password-here
API_KEY_SECRET=your-32-character-api-key-secret
PROVIDER_KEY_SECRET=your-32-character-provider-secret
NEXTAUTH_SECRET=your-nextauth-secret
FALLBACK_OPENAI_API_KEY=your-openai-api-keydocker.env.example includes placeholder values; replace them with strong secrets before starting the stack.
See Environment Variables Reference for all options.
./scripts/cloud/tambo-start.sh./scripts/cloud/init-database.sh- Web Dashboard: http://localhost:3210
- API: http://localhost:3211
| Variable | Required | Description |
|---|---|---|
POSTGRES_PASSWORD |
Yes | PostgreSQL password |
POSTGRES_DB |
No | Database name (default: tambo) |
POSTGRES_USER |
No | Database user (default: postgres) |
API_KEY_SECRET |
Yes | 32+ character secret for API key encryption |
PROVIDER_KEY_SECRET |
Yes | 32+ character secret for provider key encryption |
NEXTAUTH_SECRET |
Yes | Secret for NextAuth.js sessions |
NEXTAUTH_URL |
Yes | Base URL for auth callbacks (e.g., http://localhost:3210 or https://your-domain.com) |
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY |
No | Primary OpenAI key for generation |
FALLBACK_OPENAI_API_KEY |
Yes | Default OpenAI key when projects don't have custom keys |
To sign in to the dashboard, you must configure either at least one OAuth provider (Google or GitHub) or email login (Resend). If you configure neither, users will not be able to sign in.
Note: If any OAuth provider is configured, the deployment uses OAuth login only (even if email settings are present). Email login is only enabled when no OAuth providers are configured.
Configure at least one of the following providers to enable OAuth login.
| Variable | Description |
|---|---|
GOOGLE_CLIENT_ID |
Google OAuth client ID |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret |
GITHUB_CLIENT_ID |
GitHub OAuth client ID |
GITHUB_CLIENT_SECRET |
GitHub OAuth client secret |
Email login requires at minimum RESEND_API_KEY and EMAIL_FROM_DEFAULT.
| Variable | Description |
|---|---|
RESEND_API_KEY |
Resend API key for sending emails |
RESEND_AUDIENCE_ID |
Resend audience for newsletters |
EMAIL_FROM_DEFAULT |
Default sender email address |
EMAIL_FROM_PERSONAL |
Personal/support sender email |
EMAIL_REPLY_TO_SUPPORT |
Support reply-to address |
| Variable | Description |
|---|---|
ALLOWED_LOGIN_DOMAIN |
Restrict logins to a specific email domain |
DISALLOWED_EMAIL_DOMAINS |
Block signups from these domains |
LANGFUSE_PUBLIC_KEY |
Langfuse analytics public key |
LANGFUSE_SECRET_KEY |
Langfuse analytics secret key |
LANGFUSE_HOST |
Langfuse host URL |
NEXT_PUBLIC_POSTHOG_KEY |
PostHog analytics key |
NEXT_PUBLIC_POSTHOG_HOST |
PostHog host URL |
SENTRY_DSN |
Sentry error tracking DSN |
| Variable | Description |
|---|---|
TAMBO_WHITELABEL_ORG_NAME |
Organization name displayed in UI |
TAMBO_WHITELABEL_ORG_LOGO |
URL to organization logo |
- Go to Google Cloud Console
- Create OAuth 2.0 Client ID
- Add authorized redirect URI:
- Local:
http://localhost:3210/api/auth/callback/google - Production:
https://your-domain.com/api/auth/callback/google
- Local:
- Copy Client ID and Secret to
docker.env
- Go to GitHub Developer Settings
- Create a new OAuth App
- Set Authorization callback URL:
- Local:
http://localhost:3210/api/auth/callback/github - Production:
https://your-domain.com/api/auth/callback/github
- Local:
- Copy Client ID and Secret to
docker.env
These npm scripts are convenience aliases for Docker-based commands.
They require bash, so Windows users should run them in WSL or Git Bash.
npm run tambo:setup # Initial setup
npm run tambo:start # Start services
npm run tambo:stop # Stop servicesFor production, update docker.env:
NODE_ENV=production
NEXTAUTH_URL=https://your-domain.comAdd a reverse proxy (nginx, Caddy, Traefik) for HTTPS termination.
The Docker images can be deployed to Kubernetes. Example deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: tambo-web
spec:
replicas: 2
selector:
matchLabels:
app: tambo-web
template:
metadata:
labels:
app: tambo-web
spec:
containers:
- name: web
image: tambo-web:latest
ports:
- containerPort: 3000
envFrom:
- secretRef:
name: tambo-secretsBuild images:
./scripts/cloud/tambo-build.shTag and push to your container registry:
docker tag tambo-web:latest your-registry/tambo-web:latest
docker tag tambo-api:latest your-registry/tambo-api:latest
docker push your-registry/tambo-web:latest
docker push your-registry/tambo-api:latest- Change all default passwords - Use strong, unique values for all secrets
- Use HTTPS - Always use TLS in production
- Restrict database access - Don't expose PostgreSQL port publicly
- Use secrets management - Consider Docker secrets or Kubernetes secrets
- Set
ALLOWED_LOGIN_DOMAIN- Restrict access to your organization's domain
| Script | Description |
|---|---|
./scripts/cloud/tambo-setup.sh |
First-time environment setup |
./scripts/cloud/tambo-start.sh |
Start all services |
./scripts/cloud/tambo-stop.sh |
Stop all services |
./scripts/cloud/tambo-logs.sh |
View logs (all or specific service) |
./scripts/cloud/tambo-build.sh |
Build Docker images |
./scripts/cloud/init-database.sh |
Run database migrations |
./scripts/cloud/tambo-psql.sh |
PostgreSQL CLI access |
# Connect to PostgreSQL
./scripts/cloud/tambo-psql.sh
# Or via docker compose
docker compose --env-file docker.env exec postgres psql -U postgres -d tambo
# Run migrations
./scripts/cloud/init-database.sh
# Backup
docker compose --env-file docker.env exec postgres pg_dump -U postgres tambo > backup.sql
# Restore
docker compose --env-file docker.env exec -T postgres psql -U postgres tambo < backup.sql# All services
./scripts/cloud/tambo-logs.sh
# Specific service
./scripts/cloud/tambo-logs.sh postgres
./scripts/cloud/tambo-logs.sh api
./scripts/cloud/tambo-logs.sh webAll services include Docker health checks. Check status:
docker compose --env-file docker.env ps- Check Docker is running:
docker info - Check
docker.envexists and has required variables - View logs:
./scripts/cloud/tambo-logs.sh
- Verify PostgreSQL is healthy:
docker compose --env-file docker.env ps postgres - Check
DATABASE_URLis correctly set (auto-derived fromPOSTGRES_*variables)
- Verify
NEXTAUTH_URLmatches your deployment URL exactly (no trailing slash) - Check OAuth callback URLs in provider settings match your deployment
- Ensure both
_CLIENT_IDand_CLIENT_SECRETare set
# Stop and remove containers + volumes
docker compose --env-file docker.env down -v
docker volume rm tambo_tambo_postgres_data
# Start fresh
./scripts/cloud/tambo-start.sh
./scripts/cloud/init-database.sh- Pull latest changes:
git pull - Rebuild images:
./scripts/cloud/tambo-build.sh - Restart services:
./scripts/cloud/tambo-stop.sh && ./scripts/cloud/tambo-start.sh - Run migrations:
./scripts/cloud/init-database.sh