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¶
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¶
Let's Encrypt (Recommended)¶
# 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¶
Verify:
Expected:
Step 5: Initialize Database¶
Step 6: Verify Deployment¶
Expected:
Step 7: Configure Vapi¶
- Go to dashboard.vapi.ai
- Create assistant using system prompt
- Add all 14 tools with webhook URLs
- 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¶
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