Skip to content

Deployment Guide

Step-by-step production deployment


Prerequisites

Server Requirements

Component Minimum Recommended
CPU 2 cores 4 cores
Memory 4 GB 8 GB
Storage 20 GB SSD 50 GB SSD
OS Ubuntu 22.04 Ubuntu 24.04

Software

  • Docker 24.0+
  • Docker Compose 2.20+
  • Git
  • Certbot

Step 1: Clone Repository

git clone https://github.com/vitaravox/vitara-platform.git /opt/vitara-platform
cd /opt/vitara-platform

Step 2: Configure Environment

cp voice-agent/.env.example voice-agent/.env
nano voice-agent/.env

Required variables:

POSTGRES_PASSWORD=<generate-secure-password>
NODE_ENV=production
OSCAR_API_URL=https://your-oscar.com:8443/oscar
OSCAR_API_KEY=<your-api-key>
VAPI_WEBHOOK_SECRET=<from-vapi-dashboard>
TRANSFER_NUMBER=+1-604-555-0100
ADMIN_JWT_SECRET=<generate-64-char-secret>
ENCRYPTION_KEY=<generate-32-char-key>

Generate secrets:

# Database password
openssl rand -base64 24

# JWT secret
openssl rand -base64 64

# Encryption key
openssl rand -hex 16

Step 3: SSL Certificate

# Install certbot
apt install certbot

# Get certificate
certbot certonly --standalone -d api.yourdomain.com

# Copy to project
mkdir -p nginx/ssl
cp /etc/letsencrypt/live/api.yourdomain.com/fullchain.pem nginx/ssl/
cp /etc/letsencrypt/live/api.yourdomain.com/privkey.pem nginx/ssl/

Self-Signed (Development Only)

openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
  -keyout nginx/ssl/privkey.pem \
  -out nginx/ssl/fullchain.pem

Step 4: Start Services

docker compose up -d

Verify:

docker compose ps

Expected:

NAME                 STATUS
vitara-db           Up (healthy)
vitara-voice-agent  Up (healthy)
vitara-nginx        Up


Step 5: Initialize Database

docker exec vitara-db psql -U vitara -d vitara \
  -f /migrations/001_initial_schema.sql

Step 6: Verify Deployment

curl https://your-server:9443/health

Expected:

{
  "status": "healthy",
  "version": "1.1.0"
}


Step 7: Configure Vapi

  1. Go to dashboard.vapi.ai
  2. Create assistant using system prompt
  3. Add all 14 tools with webhook URLs
  4. Assign phone number

Deploy New Version

cd /opt/vitara-platform

# Pull latest
git pull origin main

# Rebuild and restart
docker compose build --no-cache
docker compose up -d

# Verify
curl https://api.vitaravox.ca:9443/health

Rollback

# List recent commits
git log --oneline -5

# Checkout previous version
git checkout HEAD~1

# Redeploy
docker compose build
docker compose up -d

Backup Schedule

# Add to crontab
crontab -e

# Daily database backup at 2 AM
0 2 * * * docker exec vitara-db pg_dump -U vitara vitara | gzip > /backups/vitara_$(date +\%Y\%m\%d).sql.gz

# SSL renewal check weekly
0 3 * * 0 certbot renew --quiet --post-hook "docker restart vitara-nginx"

Firewall Configuration

# Allow SSH
ufw allow 22/tcp

# Allow HTTPS (API)
ufw allow 9443/tcp

# Enable firewall
ufw enable

DNS Configuration

Record Type Value
api.yourdomain.com A server-ip
vitdocs.yourdomain.com CNAME pages-host

Production Checklist

  • [ ] Environment variables configured
  • [ ] SSL certificate valid
  • [ ] Database initialized
  • [ ] Health check passing
  • [ ] Vapi webhook configured
  • [ ] Firewall enabled
  • [ ] Backups scheduled
  • [ ] Monitoring configured