Skip to main content

TgoRTC Deployment

This document describes how to deploy the TgoRTC master server with one click.

Architecture Overview

The TgoRTC master server includes a complete service stack:

┌─────────────────────────────────────────────────────────────┐
│ Master Server │
│ TgoRTC Server + MySQL + Redis + LiveKit + Nginx │
└─────────────────────────────────────────────────────────────┘

System Requirements

  • Operating System: Linux (Ubuntu 20.04+ recommended)
  • Docker 20.10+
  • Docker Compose 2.0+
  • Server Configuration: Minimum 2 cores, 4GB RAM

One-Click Deployment

# China servers (recommended, uses mirror acceleration)
curl -fsSL https://gitee.com/No8blackball/tgo-rtcserver/raw/main/scripts/deploy.sh | sudo bash -s -- --cn

# Overseas servers
curl -fsSL https://raw.githubusercontent.com/TgoRTC/TgoRTCServer/main/scripts/deploy.sh | sudo bash

After Deployment

After deployment, the configuration will be automatically generated and the service will start. Please record the following key information (needed for LiveKit node configuration):

# View generated configuration
cat ~/tgortc/.env

Information to record:

  • REDIS_PASSWORD - Redis password
  • LIVEKIT_API_KEY - LiveKit API Key
  • LIVEKIT_API_SECRET - LiveKit API Secret

Service Management

cd ~/tgortc

# Check service status
sudo docker compose ps

# View logs
sudo docker compose logs -f

# Configure firewall
./deploy.sh firewall

# Update service
./deploy.sh update

# View version info
./deploy.sh version

Access URLs

ServiceURL
TgoRTC APIhttp://<SERVER_IP>:8080
API Docshttp://<SERVER_IP>:8080/swagger/index.html
LiveKitws://<SERVER_IP>:80
Database Adminhttp://<SERVER_IP>:8081

Port Reference

PortProtocolPurposeAccess Scope
80TCPNginx load balancer (LiveKit entry)Public
8080TCPTgoRTC APIPublic
8081TCPAdminer database adminInternal only
3307TCPMySQLInternal only
6380TCPRedisLiveKit nodes
7880TCPLiveKit HTTPPublic
7881TCPLiveKit RTC TCPPublic
3478UDPTURN UDPPublic
5349TCPTURN TLSPublic
50000-50100UDPWebRTC mediaPublic

Common Commands

cd ~/tgortc

# Check status
./deploy.sh status

# View logs
sudo docker compose logs -f

# Update services (interactive menu: quick update / full update / specific version)
./deploy.sh update

# Rollback to previous version
./deploy.sh rollback

# Configure firewall
./deploy.sh firewall

# Reload Nginx (after adding nodes)
./deploy.sh reload-nginx

# Restart services
sudo docker compose restart

# Stop services
sudo docker compose down

# Clean all data (dangerous!)
./deploy.sh clean

Configuration Files

.env File

# MySQL configuration
DB_USER=root
DB_PASSWORD=<auto-generated>
DB_NAME=tgo_rtc

# Redis configuration
REDIS_PASSWORD=<auto-generated>

# LiveKit configuration
LIVEKIT_API_KEY=<auto-generated>
LIVEKIT_API_SECRET=<auto-generated>

# Docker image (modify for custom development)
DOCKER_IMAGE=your-registry.com/your-namespace/tgortc:latest

# LiveKit cluster nodes (configure after adding nodes)
LIVEKIT_NODES=192.168.1.101:7880,192.168.1.102:7880

# Business Webhook (optional)
BUSINESS_WEBHOOK_ENDPOINTS='[{"url":"https://your-api.com/webhook","secret":"xxx"}]'

FAQ

Q1: Docker image pull failed?

# Use --cn parameter to enable China mirror acceleration
curl -fsSL ... | sudo bash -s -- --cn

Q2: Port already in use?

# Check port usage
lsof -i :80
lsof -i :8080

# Stop the process or modify the port

Q3: Database connection failed?

# May be residual old data, clean and redeploy
./deploy.sh clean
./deploy.sh

Q4: How to view generated passwords?

cat ~/tgortc/.env | grep PASSWORD
cat ~/tgortc/.env | grep SECRET