Local Docker deployment

WARNING

Note: Local deployment can experience all the functions of VoceSpace, but it cannot be accessed on the public network. If you need public network deployment, please refer to:

  1. Docker + Nginx
  2. Docker + Caddy

How to get key and secret?

1. Copy Basic Configuration

The following is the basic configuration of vocespace. You need to copy this configuration and specify it when starting the container

1{
2  "livekit": {
3    "key": "devkey",
4    "secret": "secret",
5    "url": "ws://your.ip:7880"
6  },
7  "codec": "vp9",
8  "resolution": "1080p",
9  "maxBitrate": 3000000,
10  "maxFramerate": 30,
11  "priority": "medium",
12  "redis": { 
13    "enabled": true, 
14    "host": "your.ip", 
15    "port": 6379, 
16    "password": "vocespace", 
17    "db": 0 
18  },
19  "server_url": "localhost"
20}
WARNING

your.ip: User host machine IP address, you can use ifconfig | grep inet to view

1inet 127.0.0.1 netmask 0xff000000
2inet 192.168.31.138 netmask 0xffffff00 broadcast 192.168.31.255

In this example 192.168.31.138 is your host machine IP

2. Install Docker (Docker Engine|Desktop)

INFO

For detailed Docker installation instructions or problems with installation, please refer to:

  1. Docker Engine Install
  2. Docker Desktop Install

If you are a freshman and unfamiliar with the command line, we recommend that you install Docker Desktop.

In the following installation, if you are using MacOS or Windows, we will guide you to install Docker Desktop.

2. Get VoceSpace image

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, see: help-View your own Linux architecture

1# amd
2docker pull privoce/vocespace:latest
3# arm
4docker pull privoce/vocespace:latest_arm

3. Run Container

1docker run -d \
2-p 3000:3000 \
3-v ${PWD}/vocespace.conf.json:/app/vocespace.conf.json \
4--name vocespace \
5privoce/vocespace:latest
NOTE
  • -p 3000:3000: Map the container's port 3000 to the host's port 3000.
  • -v ${PWD}/vocespace.conf.json:/app/vocespace.conf.json: Map the configuration
  • After the container is started, the required dependencies will be automatically downloaded. You need to wait for a while. After the dependencies are downloaded, the environment will be configured and the service will be started.

Output

  1. Docker ce: If on Linux, you can use docker ps to view the process, then visit your_ip:3000 in the browser to view the started application, and then use docker logs <container_id> to view the log

  2. Docker desktop: Observe the output after the container is started. When the output is Ready on http://ip:3000, it means that the local deployment has been completed

12025-05-29 02:44:09 ✅ Socket.IO 安装完成
22025-05-29 02:44:15 环境变量配置:
32025-05-29 02:44:15 LIVEKIT_API_KEY=devkey
42025-05-29 02:44:15 LIVEKIT_API_SECRET=secret
52025-05-29 02:44:15 LIVEKIT_URL=ws://localhost:7880
62025-05-29 02:44:15 NEXT_PUBLIC_BASE_PATH=
72025-05-29 02:44:15 PORT=3000
82025-05-29 02:44:15 HOST=0.0.0.0
92025-05-29 02:44:15 TURN_CREDENTIAL=
102025-05-29 02:44:15 TURN_URL=
112025-05-29 02:44:15 TURN_USERNAME=
122025-05-29 02:44:15 WEBHOOK=
132025-05-29 02:44:15 === 启动应用 ===
142025-05-29 02:44:16 > Ready on http://0.0.0.0:3000

4. Start livekit-server

VoceSpace needs to rely on livekit-server to build webrtc and other related services

Download livekit-server

Macos
Windows
Linux
1brew update && brew install livekit

Start livekit-server

livekit-server --dev --bind 0.0.0.0

5. Download and start Redis

Macos
Windows
Linux
1brew install redis
2brew services start redis -- --requirepass "vocespace" --bind 0.0.0.0 --protected-mode no

Cloud server description

Configure security groups/firewalls

When using cloud servers, such as Alibaba Cloud, Tencent Cloud, Google Cloud, etc., you need to configure security groups/firewalls for the server, etc.

port type ingress/egress allow ip
3000 tcp ingress 0.0.0.0/0 Ipv4
3000 tcp egress 0.0.0.0/0 Ipv4
7880 tcp ingress 0.0.0.0/0 Ipv4
7881 tcp ingress 0.0.0.0/0 Ipv4
80 tcp ingress 0.0.0.0/0 Ipv4