# SOLUCIΓ“N: LIVEKIT EN VPS SEPARADO + EASYPANEL ## πŸ—οΈ ARQUITECTURA HÍBRIDA ``` β”Œβ”€ EasyPanel ────────────────┐ β”Œβ”€ VPS Separado ─────────┐ β”‚ β”‚ β”‚ β”‚ β”‚ OpenVidu Meet Backend ──────────→ LiveKit Server β”‚ β”‚ (HTTP/HTTPS only) β”‚ β”‚ (UDP 50000-60000) β”‚ β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ↑ ↑ Traefik/SSL Firewall/UDP abierto ``` ## πŸ“‹ CONFIGURACIΓ“N PASO A PASO ### 1. EasyPanel (Solo OpenVidu Meet Backend) ```yaml # docker-compose.yml para EasyPanel version: '3.8' services: openvidu-meet: build: . environment: # LiveKit en VPS externo LIVEKIT_URL: wss://livekit.tu-vps.com:7880 LIVEKIT_API_KEY: devkey LIVEKIT_API_SECRET: tu-secret-32-chars ports: - "80:6080" # Solo HTTP - EasyPanel maneja SSL ``` ### 2. VPS Separado (Solo LiveKit + Redis) ```yaml # docker-compose.yml en VPS version: '3.8' services: livekit: image: livekit/livekit-server:latest ports: - "7880:7880" # API/WebSocket - "50000-60000:50000-60000/udp" # WebRTC volumes: - ./livekit.yaml:/livekit.yaml command: --config /livekit.yaml redis: image: redis:7-alpine ports: - "6379:6379" command: redis-server --requirepass redispassword ``` ### 3. ConfiguraciΓ³n LiveKit en VPS ```yaml # livekit.yaml en VPS port: 7880 bind_addresses: ["0.0.0.0"] keys: devkey: tu-secret-de-32-caracteres-minimo redis: address: "localhost:6379" password: "redispassword" rtc: port_range_start: 50000 port_range_end: 60000 use_external_ip: true external_ip: "IP_PUBLICA_DEL_VPS" ice_servers: - urls: ["stun:stun.l.google.com:19302"] ``` ### 4. Firewall en VPS ```bash # Configurar firewall en VPS ufw allow 7880/tcp # LiveKit API ufw allow 50000:60000/udp # WebRTC UDP ufw allow 6379/tcp # Redis (si acceso externo) ufw enable ``` ### 5. SSL para LiveKit (Nginx en VPS) ```nginx # /etc/nginx/sites-available/livekit server { listen 443 ssl; server_name livekit.tu-vps.com; ssl_certificate /path/to/cert.pem; ssl_certificate_key /path/to/key.pem; location / { proxy_pass http://localhost:7880; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; } } ``` ## πŸ’° COSTOS ESTIMADOS ### VPS para LiveKit: - **BΓ‘sico**: $5-10/mes (2GB RAM, 1 CPU) - **Medio**: $15-25/mes (4GB RAM, 2 CPU) - **Alto**: $30-50/mes (8GB RAM, 4 CPU) ### Proveedores recomendados: - DigitalOcean - Linode - Hetzner - Vultr ## βœ… VENTAJAS - βœ… EasyPanel para web app (fΓ‘cil) - βœ… VPS dedicado para WebRTC (potencia) - βœ… Escalabilidad independiente - βœ… Control total sobre LiveKit ## ❌ DESVENTAJAS - ❌ Costo adicional VPS - ❌ MΓ‘s complejidad de setup - ❌ Mantenimiento de dos servicios