Help

Check your own Linux architecture

VoceSpace contains two images:

  • amd: privoce/vocespace:latest
  • arm: privoce/vocespace:latest_arm

So you need to know your current server architecture to make a choice

1. Use the uname command

The uname command can display the system's kernel information, including the hardware architecture.

Run the following command:

1uname -m
  • If the output is x86_64, it means the system is based on the AMD64 or Intel64 architecture (commonly known as x86_64).
  • If the output is aarch64 or arm64, it means the system is based on the ARM64 architecture.
  • If the output is armv7l or something similar, it means the system is based on the ARMv7 architecture.

2. Use the arch command

The arch command can also display the system's architecture type.

Run the following command:

1arch
  • If the output is x86_64, it means the system is based on AMD64 or Intel64 architecture.
  • If the output is aarch64 or arm64, it means the system is based on ARM64 architecture.
  • If the output is armv7l or similar, it means the system is based on ARMv7 architecture.

How to get key and secret

1docker pull livekit/generate
2docker run --rm -it -v$PWD:/output livekit/generate

Through livekit/generate you will get a livekit.yaml file, which is the configuration file for your livekit-server, and the key and secret will be generated in it.

How to improve the quality of video/screen sharing

Resolution Pixels Frame rate Encoder Recommended bitrate High quality bitrate Extreme bitrate
540p (qHD) 960Γ—540 30fps H.264 800 Kbps 1 Mbps 1.5 Mbps
VP9 600 Kbps 800 Kbps 1.2 Mbps
AV1 400 Kbps 700 Kbps 1 Mbps
720p (HD) 1280Γ—720 30fps H.264 1.5 Mbps 2 Mbps 2.5 Mbps
60fps H.264 2.5 Mbps 3.5 Mbps 4 Mbps
VP9 1.2 Mbps 1.8 Mbps 2.2 Mbps
AV1 1 Mbps 1.5 Mbps 2 Mbps
1080p (Full HD) 1920Γ—1080 30fps H.264 3 Mbps 4.5 Mbps 6 Mbps
60fps H.264 4.5 Mbps 6 Mbps 8 Mbps
VP9 2.5 Mbps 4 Mbps 5 Mbps
AV1 1.8 Mbps 3 Mbps 4 Mbps
1440p (2K/QHD) 2560Γ—1440 30fps H.264 6 Mbps 8 Mbps 10 Mbps
60fps H.264 8 Mbps 10 Mbps 14 Mbps
VP9 4.5 Mbps 7 Mbps 9 Mbps
AV1 3.5 Mbps 5 Mbps 7 Mbps
2160p (4K/UHD) 3840Γ—2160 30fps H.264 10 Mbps 14 Mbps 20 Mbps
60fps H.264 15 Mbps 20 Mbps 25 Mbps
VP9 8 Mbps 12 Mbps 18 Mbps
AV1 6 Mbps 10 Mbps 14 Mbps

Description

  • Recommended Bitrate: Suitable for daily live broadcasts, conferences, and low-latency streaming.
  • High-quality Bitrate: Suitable for YouTube uploads or recordings, taking into account both quality and file size.
  • Ultimate Bitrate: Used for high-quality preservation or professional scenarios, such as material acquisition and video editing sources.
  • Encoder Description:
    • H.264: Best compatibility and wide hardware support.
    • VP9: Launched by Google and widely adopted by YouTube, with slightly higher efficiency than H.264.
    • AV1: Next-generation high-compression encoding format, with smaller files, but longer encoding time.

Corresponding startup parameters

  • Resolution: NEXT_PUBLIC_RESOLUTION
  • Bitrate: NEXT_PUBLIC_MAXBITRATE
  • Frame rate: NEXT_PUBLIC_MAXFRAMERATE
  • Policy: NEXT_PUBLIC_PRIORITY
    • high
    • medium
    • low
    • very-low

Example

When you need to use 720p + 60 frames + high-precision policy

1bash ./local_deploy.sh \
2-e NEXT_PUBLIC_RESOLUTION=720p \
3-e NEXT_PUBLIC_MAXFRAMERATE=60 \
4-e NEXT_PUBLIC_PRIORITY=high

Local deployment scripts

Linux/macOS
Windows
1#!/bin/bash
2
3# VoceSpace local deployment automation script
4# Applicable to macOS and Linux systems
5
6set -e # Exit when encountering an error
7
8# Default environment variables
9CUSTOM_ENV_VARS=()
10
11# Display usage help
12show_help() {
13    echo "============================================="
14    echo "VoceSpace local deployment automation script"
15    echo "==========================================="
16    echo ""
17    echo "Usage: $0 [options]"
18    echo ""
19    echo "Options:"
20    echo "  -e, --env KEY=VALUE            Set custom environment variables"
21    echo "  -h, --help                     Show this help information"
22    echo ""
23    echo "Examples:"
24    echo "  $0 -e NEXT_PUBLIC_RESOLUTION=4k"
25    echo "  $0 -e NEXT_PUBLIC_RESOLUTION=1080p"
26    echo "  $0 -e NEXT_PUBLIC_RESOLUTION=4k -e CUSTOM_VAR=value"
27    echo "  $0 -e NEXT_PUBLIC_MAXBITRATE=8000 -e NEXT_PUBLIC_RESOLUTION=720p"
28    echo ""
29    echo "Common environment variables:"
30    echo "  - NEXT_PUBLIC_RESOLUTION: Set resolution (4k, 2k, 1080p, 720p, 480p)"
31    echo "  - NEXT_PUBLIC_MAXBITRATE: Set maximum bitrate"
32    echo "  - NEXT_PUBLIC_MAXFRAMERATE: Set maximum frame rate"
33    echo "  - NEXT_PUBLIC_PRIORITY: Set priority"
34    echo ""
35}
36
37# Parsing command line arguments
38parse_args() {
39    while [[ $# -gt 0 ]]; do
40        case $1 in
41            -e|--env)
42                CUSTOM_ENV_VARS+=("$2")
43                shift 2
44                ;;
45            -h|--help)
46                show_help
47                exit 0
48                ;;
49            *)
50                echo "❌ Unknown parameter: $1"
51                echo "Use $0 --help to see usage information"
52                exit 1
53                ;;
54        esac
55    done
56}
57
58echo "=========================================="
59echo "VoceSpace local deployment automation script"
60echo "=========================================="
61
62# Detect operating system
63OS=$(uname -s)
64ARCH=$(uname -m)
65
66echo "Detected OS: $OS"
67echo "Detected Architecture: $ARCH"
68
69# Function: Check if a command exists
70check_command() {
71    if ! command -v "$1" &> /dev/null; then
72        echo "❌ $1 is not installed"
73        return 1
74    else
75        echo "βœ… $1 is installed"
76        return 0
77    fi
78}
79
80# Function: Check if Docker is installed
81check_docker() {
82    if check_command docker; then
83        echo "Docker version: $(docker --version)"
84        return 0
85    else
86        echo "❌ Docker is not installed, please install Docker first"
87        echo "Please visit the following link to install Docker:"
88        case $OS in
89            "Darwin")
90                echo "  macOS: https://docs.docker.com/desktop/install/mac-install/"
91                ;;
92            "Linux")
93                echo "  Linux: https://docs.docker.com/engine/install/"
94                ;;
95            *)
96                echo "  other: https://docs.docker.com/get-docker/"
97                ;;
98        esac
99        return 1
100    fi
101}
102
103# install LiveKit Server
104install_livekit() {
105    echo "=========================================="
106    echo "Install LiveKit Server"
107    echo "=========================================="
108    
109    if check_command livekit-server; then
110        echo "LiveKit Server is installed"
111        return 0
112    fi
113    
114    case $OS in
115        "Darwin")
116            echo "Installing LiveKit Server on macOS..."
117            if check_command brew; then
118                brew update && brew install livekit
119            else
120                echo "❌ Homebrew is not installed, please install Homebrew or manually install LiveKit Server"
121                echo "Homebrew installation: /bin/bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""
122                return 1
123            fi
124            ;;
125        "Linux")
126            echo "Installing LiveKit Server on Linux..."
127            curl -sSL https://get.livekit.io | bash
128            ;;
129        *)
130            echo "❌ Unsupported operating system: $OS"
131            echo "Please manually install LiveKit Server: https://github.com/livekit/livekit/releases"
132            return 1
133            ;;
134    esac
135}
136
137# Function: Get Docker image
138get_docker_image() {
139    case $ARCH in
140        "x86_64"|"amd64")
141            echo "privoce/vocespace:latest"
142            ;;
143        "arm64"|"aarch64")
144            echo "privoce/vocespace:latest_arm"
145            ;;
146        *)
147            echo "❌ Unsupported architecture: $ARCH"
148            echo "Supported architectures: x86_64, amd64, arm64, aarch64"
149            exit 1
150            ;;
151    esac
152}
153
154# Function: Pull VoceSpace image
155pull_vocespace_image() {
156    echo "=========================================="
157    echo "Pulling VoceSpace Docker image"
158    echo "=========================================="
159    
160    IMAGE=$(get_docker_image)
161    echo "Pulling image: $IMAGE"
162
163    docker pull "$IMAGE"
164    echo "βœ… Image pulled successfully"
165}
166
167# Function: Start VoceSpace container
168start_vocespace_container() {
169    echo "=========================================="
170    echo "Starting VoceSpace container"
171    echo "=========================================="
172    
173    IMAGE=$(get_docker_image)
174    CONTAINER_NAME="vocespace"
175
176    # Build environment variable arguments
177    ENV_ARGS=()
178
179    # Add custom environment variables
180    for env_var in "${CUSTOM_ENV_VARS[@]}"; do
181        ENV_ARGS+=("-e" "$env_var")
182        echo "Setting environment variable: $env_var"
183    done
184
185    # Check if the container already exists
186    if docker ps -a --format "table {{.Names}}" | grep -q "^$CONTAINER_NAME$"; then
187        echo "Detected existing container $CONTAINER_NAME"
188        read -p "Do you want to stop and remove the existing container? (y/n): " -n 1 -r
189        echo
190        if [[ $REPLY =~ ^[Yy]$ ]]; then
191            echo "Stopping and removing existing container..."
192            docker stop "$CONTAINER_NAME" 2>/dev/null || true
193            docker rm "$CONTAINER_NAME" 2>/dev/null || true
194        else
195            echo "Operation cancelled"
196            return 1
197        fi
198    fi
199
200    echo "Starting new container..."
201    if [[ ${#ENV_ARGS[@]} -gt 0 ]]; then
202        echo "Using environment variables: ${ENV_ARGS[*]}"
203        docker run -d \
204            -p 3000:3000 \
205            --name "$CONTAINER_NAME" \
206            "${ENV_ARGS[@]}" \
207            "$IMAGE"
208    else
209        docker run -d \
210            -p 3000:3000 \
211            --name "$CONTAINER_NAME" \
212            "$IMAGE"
213    fi
214
215    echo "βœ… VoceSpace container started successfully"
216    echo "Container name: $CONTAINER_NAME"
217    echo "Access URL: http://localhost:3000"
218}
219
220# Function: Start LiveKit Server
221start_livekit_server() {
222    echo "=========================================="
223    echo "Starting LiveKit Server"
224    echo "=========================================="
225
226    echo "Checking if LiveKit Server is running..."
227    if pgrep -f "livekit-server" > /dev/null; then
228        echo "⚠️  LiveKit Server is already running"
229        read -p "Do you want to restart LiveKit Server? (y/n): " -n 1 -r
230        echo
231        if [[ $REPLY =~ ^[Yy]$ ]]; then
232            echo "Stopping existing LiveKit Server..."
233            pkill -f "livekit-server" || true
234            sleep 2
235        else
236            echo "Keeping existing LiveKit Server running"
237            return 0
238        fi
239    fi
240
241    echo "Starting LiveKit Server..."
242    echo "Note: LiveKit Server will run in the background"
243    echo "To stop it, use: pkill -f livekit-server"
244
245    nohup livekit-server --dev --bind 0.0.0.0 > livekit-server.log 2>&1 &
246    
247    sleep 3
248    
249    if pgrep -f "livekit-server" > /dev/null; then
250        echo "βœ… LiveKit Server started successfully"
251        echo "Log file: $(pwd)/livekit-server.log"
252    else
253        echo "❌ LiveKit Server failed to start"
254        echo "Please check the log file: $(pwd)/livekit-server.log"
255        return 1
256    fi
257}
258
259# Function: Show Status
260show_status() {
261    echo "=========================================="
262    echo "Deployment Status Check"
263    echo "=========================================="
264    
265    echo "Docker Container Status:"
266    docker ps --filter "name=vocespace" --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
267    
268    echo ""
269    echo "LiveKit Server Status:"
270    if pgrep -f "livekit-server" > /dev/null; then
271        echo "βœ… LiveKit Server is running"
272    else
273        echo "❌ LiveKit Server is not running"
274    fi
275    
276    echo ""
277    echo "=========================================="
278    echo "Access Information"
279    echo "=========================================="
280    echo "VoceSpace App: http://localhost:3000"
281    echo "LiveKit Server: ws://localhost:7880"
282    echo ""
283    echo "To view container logs: docker logs vocespace"
284    echo "To view LiveKit logs: tail -f livekit-server.log"
285}
286
287# Main function
288main() {
289    # Parse command line arguments
290    parse_args "$@"
291    
292    echo "Starting deployment process..."
293    
294    # Show configuration information
295    if [[ ${#CUSTOM_ENV_VARS[@]} -gt 0 ]]; then
296        echo "=========================================="
297        echo "Configuration Information"
298        echo "=========================================="
299        for env_var in "${CUSTOM_ENV_VARS[@]}"; do
300            echo "Environment Variable: $env_var"
301        done
302        echo ""
303    fi
304
305    # Check Docker
306    if ! check_docker; then
307        exit 1
308    fi
309
310    # Install LiveKit Server
311    if ! install_livekit; then
312        echo "❌ LiveKit Server installation failed"
313        exit 1
314    fi
315
316    # Pull Docker image
317    if ! pull_vocespace_image; then
318        echo "❌ Docker image pull failed"
319        exit 1
320    fi
321
322    # Start container
323    if ! start_vocespace_container; then
324        echo "❌ Container startup failed"
325        exit 1
326    fi
327
328    # Start LiveKit Server
329    if ! start_livekit_server; then
330        echo "❌ LiveKit Server startup failed"
331        exit 1
332    fi
333    
334    echo ""
335    echo "Waiting for services to start..."
336    sleep 5
337
338    # Show status
339    show_status
340    
341    echo ""
342    echo "=========================================="
343    echo "πŸŽ‰ Deploy finish!"
344    echo "=========================================="
345    echo "Please visit http://localhost:3000 in your browser"
346    echo "If you encounter any issues, please check the relevant log files"
347}
348
349# Run main function
350main "$@"

Docker network connection timeout

πŸ‘ Choose to use the Chinese domestic mirror

AMD64

1docker pull crpi-0u8xaje6k9g42uky.cn-hangzhou.personal.cr.aliyuncs.com/vocespace/vocespace:latest

ARM64

1docker pull crpi-0u8xaje6k9g42uky.cn-hangzhou.personal.cr.aliyuncs.com/vocespace/vocespace:latest_arm

Configure Docker

Domestic users may encounter the problem of Docker Hub access connection timeout, please configure it according to the following content.

Create daemon.json

1sudo mkdir -p /etc/docker
2sudo touch /etc/docker/daemon.json

Add repository mirror

  • Tencent: https://mirror.ccs.tencentyun.com
  • HKUST: https://docker.mirrors.ustc.edu.cn
  • Alibaba: See Console -> Search -> ACR -> Image Tool -> Image Acceleration
1sudo tee /etc/docker/daemon.json <<-'EOF'
2{
3"registry-mirrors": ["https://mirror.ccs.tencentyun.com", "https://docker.mirrors.ustc.edu.cn"]
4}
5EOF

Restart docker

1sudo systemctl daemon-reload
2sudo systemctl restart docker

Change server

In China, even if the server has a public IP, it may not be able to smoothly access external network services such as Docker Hub and GitHub. This is mainly due to the complexity of the network environment and the restrictions of relevant policies. The following are possible reasons and solutions: Common reasons

  • DNS resolution problem: The default DNS server may not correctly resolve the domain name of Docker Hub or GitHub

  • Network restrictions: Some network environments (such as operator networks, corporate intranets) may restrict or block access to specific external network services

  • Firewall or security policy: The server's firewall or security group rules may block access to specific services

  • GFW impact: In China, some external network services may be restricted by GFW

TIP

Therefore, we recommend that you purchase in the following areas:

  1. Hong Kong, China
  2. Japan
  3. South Korea
  4. Singapore
  5. European and American countries

Common Docker instructions

View images

1docker image ls
2# Or use
3docker images

View all containers

1docker ps -a

View running containers

1docker ps

Shut down the container

1docker stop container_name_or_id

Kill the container (force shutdown)

1docker kill container_name_or_id

Delete the container

1docker rm container_name_or_id
2
3# Delete the stopped container
4docker container prune
5# Delete all, including running ones
6docker rm -f $(docker ps -aq)

Delete the image

1docker rmi image_name_or_id
2
3# Delete all
4docker rmi -f $(docker images -q)