|
|
|
@ -1,26 +1,30 @@
|
|
|
|
|
# Openvidu CE deployment with docker-compose
|
|
|
|
|
# Openvidu Platform deployment
|
|
|
|
|
|
|
|
|
|
> **IMPORTANT NOTE:** This procedure is in development an can change in any moment. Please use it with care and visit the page with frecuency.
|
|
|
|
|
|
|
|
|
|
This document describes how to deploy OpenVidu CE alongside OpenVidu Call (a basic videoconference application) using docker-compose.
|
|
|
|
|
This document describes how to deploy OpenVidu Platform. It allows also to deploy OpenVidu Call videoconference application.
|
|
|
|
|
|
|
|
|
|
Services installed following these instructions are:
|
|
|
|
|
OpenVidu Platform is deployed as a set of docker containers managed with a docker-compose (Kubernetes Helm chart is in the works). Docker basic knowledge is not required, but recommended.
|
|
|
|
|
|
|
|
|
|
This procedure installs the following services:
|
|
|
|
|
- **OpenVidu Server (openvidu-server)**: This is the brain of OpenVidu platform. The signaling plane.
|
|
|
|
|
- **Kurento Media Server (kms)**: This is the hearth of the OpenVidu platform. In charge of media plane.
|
|
|
|
|
- **Coturn (coturn)**: Service used to allow media communications with browsers in certain special networks.
|
|
|
|
|
- **Redis (redis)**: Database to manage users in Coturn server.
|
|
|
|
|
- **Nginx (nginx)**: A reverse proxy used to configure SSL certificate and to allow both Openvidu Server and the Application in the standard https port (443).
|
|
|
|
|
- **Videoconference Application (app)**: A videoconference application deployed for demo porpouses. This application can be easily unistalled or changed by other application.
|
|
|
|
|
- **Videoconference Application (app)**: OpenVidu Call application or any other application. Can be disabled.
|
|
|
|
|
|
|
|
|
|
## 1. Prerequisites
|
|
|
|
|
|
|
|
|
|
You will need docker and docker-compose installed in your linux distribution. In theory, you can use any modern linux distribution, but we have tested with Ubuntu 18.04.
|
|
|
|
|
OpenVidu Platform can only be installed in Linux. Mac and Windows is not supported for production use. If you want to develop in Mac or Windows, please follow the [tutorials](https://docs.openvidu.io/en/2.12.0/tutorials/) to see how to execute OpenVidu in a single docker container.
|
|
|
|
|
|
|
|
|
|
You can use any modern Linux distribution supported by docker. We have tested with Ubuntu 18.04.
|
|
|
|
|
|
|
|
|
|
You will need docker and docker-compose installed in your linux distribution.
|
|
|
|
|
|
|
|
|
|
- [Install Docker](https://docs.docker.com/install/linux/docker-ce/ubuntu/)
|
|
|
|
|
- [Install Docker Compose](https://docs.docker.com/compose/install/)
|
|
|
|
|
|
|
|
|
|
It is recommended to know basic concepts about docker and docker-compose to deploy and operate OpenVidu CE platform.
|
|
|
|
|
|
|
|
|
|
Open ports:
|
|
|
|
|
|
|
|
|
|
- 80 TCP: If you select Let's Encrypt to generate an SSL certificate this port is used by the generation process.
|
|
|
|
@ -29,54 +33,60 @@ Open ports:
|
|
|
|
|
- 3478 UDP: Used by TURN Server to stablish media connections.
|
|
|
|
|
- 40000 - 57000 UDP: Ports used by Kurento Media Server to stablish media connections.
|
|
|
|
|
- 57001 - 65535 UDP: Used by TURN Server to stablish media connections.
|
|
|
|
|
- 57001 - 65535 TCP: Used by TURN Server to stablish media connections.
|
|
|
|
|
|
|
|
|
|
It is important to have a **domain name** pointing to the machine where you are are going to deploy OpenVidu. The platform is deployed using https because is mandatory to use WebRTC. Then, if you do not have a domain name, an ugly warning will appear to your users when enter to your site. And, of course, you can suffer a man in the middle attack. You don't need a valid SSL certificate as one can be created by Let's Encrypt in the installation process.
|
|
|
|
|
|
|
|
|
|
## 2. Deployment Instructions
|
|
|
|
|
## 2. Deployment
|
|
|
|
|
|
|
|
|
|
For download the necessaries files your choose between options: Clone all repository or install with a bash command.
|
|
|
|
|
Execute the following command to download and execute the installation script:
|
|
|
|
|
|
|
|
|
|
### Clone Repository
|
|
|
|
|
`curl https://raw.githubusercontent.com/OpenVidu/openvidu/master/openvidu-server/docker/openvidu-docker-compose/install_openvidu.sh | bash`
|
|
|
|
|
|
|
|
|
|
First clone this repository and move to openvidu-docker-compose folder:
|
|
|
|
|
It will donwload all required files into `openvidu` folder and will show this message with basic instructions:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ git clone https://github.com/OpenVidu/openvidu.git
|
|
|
|
|
$ cd openvidu/openvidu-server/docker/openvidu-docker-compose
|
|
|
|
|
|
|
|
|
|
Openvidu Platform successfully installed.
|
|
|
|
|
|
|
|
|
|
1. Go to openvidu folder:
|
|
|
|
|
$ cd openvidu
|
|
|
|
|
|
|
|
|
|
2. Configure OPENVIDU_DOMAIN_OR_PUBLIC_IP and OPENVIDU_SECRET in .env file:
|
|
|
|
|
$ nano .env
|
|
|
|
|
|
|
|
|
|
3. Start OpenVidu
|
|
|
|
|
$ ./openvidu start
|
|
|
|
|
|
|
|
|
|
For more information, check readme.md
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Install with bash command
|
|
|
|
|
|
|
|
|
|
Exec the following command:
|
|
|
|
|
## 3. Configuration
|
|
|
|
|
|
|
|
|
|
`curl https://raw.githubusercontent.com/OpenVidu/openvidu/master/openvidu-server/docker/openvidu-docker-compose/install_ov_ce.sh | bash`
|
|
|
|
|
OpenVidu Platform configuration is specified in the `.env` file with environment variables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### OpenVidu configuration
|
|
|
|
|
|
|
|
|
|
OpenVidu configuration is specified in the `.env` file with environment variables.
|
|
|
|
|
|
|
|
|
|
**YOU MUST** specify the **DOMAIN_OR_PUBLIC_IP** of the machine and the **OPENVIDU_SECRET**.
|
|
|
|
|
**YOU MUST** specify the **OPENVIDU_DOMAIN_OR_PUBLIC_IP** of the machine and the **OPENVIDU_SECRET**. They are empty and execution will fail if you do not specify them.
|
|
|
|
|
|
|
|
|
|
If you have a domain name, generate a certificate with Let's Encrypt or put your own certificate.
|
|
|
|
|
|
|
|
|
|
All other config properties have sane defaults.
|
|
|
|
|
All other configuration properties comes with sane defaults.
|
|
|
|
|
|
|
|
|
|
The `.env` file looks like this:
|
|
|
|
|
```
|
|
|
|
|
# OpenVidu configuration
|
|
|
|
|
# ----------------------
|
|
|
|
|
# Documentation: https://openvidu.io/docs/reference-docs/openvidu-server-params/
|
|
|
|
|
|
|
|
|
|
# OpenVidu SECRET used for apps and to access to the inspector. Change it.
|
|
|
|
|
OPENVIDU_SECRET=
|
|
|
|
|
# NOTE: This file doesn't need to quote assignment values, like most shells do.
|
|
|
|
|
# All values are stored as-is, even if they contain spaces, so don't quote them.
|
|
|
|
|
|
|
|
|
|
# Domain name. If you do not have one, the public IP of the machine.
|
|
|
|
|
# For example: 198.51.100.1, or openvidu.example.com
|
|
|
|
|
OPENVIDU_DOMAIN_OR_PUBLIC_IP=
|
|
|
|
|
|
|
|
|
|
# Openvidu Folder Record used for save the openvidu recording videos. Change it
|
|
|
|
|
# with the folder you want to use from your host.
|
|
|
|
|
OPENVIDU_RECORDING_FOLDER=/opt/recordings
|
|
|
|
|
# OpenVidu SECRET used for apps to connect to OpenVidu server and users to access to OpenVidu Dashboard
|
|
|
|
|
OPENVIDU_SECRET=
|
|
|
|
|
|
|
|
|
|
# Certificate type:
|
|
|
|
|
# - selfsigned: Self signed certificate. Not recommended for production use.
|
|
|
|
@ -92,49 +102,42 @@ CERTIFICATE_TYPE=selfsigned
|
|
|
|
|
# If CERTIFICATE_TYPE=letsencrypt, you need to configure a valid email for
|
|
|
|
|
# notifications
|
|
|
|
|
LETSENCRYPT_EMAIL=user@example.com
|
|
|
|
|
|
|
|
|
|
...
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
> **NOTE:** If you want to try OpenVidu in local, take into account the following aspects:
|
|
|
|
|
* If you set `OPENVIDU_DOMAIN_OR_PUBLIC_IP=localhost` then in your browser you have to use `https://localhost/`. If you use `127.0.0.1` instead, you will have some issues.
|
|
|
|
|
* OpenVidu is dockerized, but it uses network_mode=host due to WebRTC needs. That is important to know because OpenVidu services will use some host ports that have to be available: 8888, 5443, 3478, 5442, 80 and 6379.
|
|
|
|
|
> **NOTE:** If you want to try OpenVidu in your linux development machine:
|
|
|
|
|
> * If you set `OPENVIDU_DOMAIN_OR_PUBLIC_IP=localhost` then in your browser you have to use `https://localhost/`. If you use `https://127.0.0.1/` instead, you will have some issues.
|
|
|
|
|
> * OpenVidu services will use some host ports that have to be available: 80, 3478, 5442, 5443, 8888 and 6379.
|
|
|
|
|
|
|
|
|
|
### Videoconference application
|
|
|
|
|
|
|
|
|
|
By default, the [OpenVidu Call application](https://openvidu.io/docs/demos/openvidu-call/) is deployed alongside OpenVide CE platform. This application is defined in the file `docker-compose.override.yml`.
|
|
|
|
|
By default, the [OpenVidu Call application](https://openvidu.io/docs/demos/openvidu-call/) is deployed alongside OpenVide Platform. It is accesible in the URL:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
version: '3.1'
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
# Change this if your want use your own application.
|
|
|
|
|
# It's very important expose your application in port 5443
|
|
|
|
|
# and use the http protocol.
|
|
|
|
|
app:
|
|
|
|
|
image: openvidu/openvidu-call:2.13.0-beta1
|
|
|
|
|
restart: on-failure
|
|
|
|
|
ports:
|
|
|
|
|
- "5442:80"
|
|
|
|
|
environment:
|
|
|
|
|
- OPENVIDU_URL=https://${OPENVIDU_DOMAIN_OR_PUBLIC_IP}
|
|
|
|
|
- OPENVIDU_SECRET=${OPENVIDU_SECRET}
|
|
|
|
|
https://openvidu_domain_or_public_ip/
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
You can disable OpenVidu Call application deleting the file `docker-compose.override.yml` (or renaming it in case you want to enable again in the future).
|
|
|
|
|
This application is defined in the file `docker-compose.override.yml`.
|
|
|
|
|
|
|
|
|
|
You can configure other dockerized application if you want updating the content of `docker-compose.override.yml` with the following requirements:
|
|
|
|
|
* You have to bind your application port to 5442 in the host, as this port is used by NGINX to publish your app in port 443.
|
|
|
|
|
To disable OpenVidu Call application, you can delete the file `docker-compose.override.yml` (or renaming it in case you want to enable again in the future).
|
|
|
|
|
|
|
|
|
|
You can configure any other application updating the content of `docker-compose.override.yml` with the following requirements:
|
|
|
|
|
* Application server port must to be binded to 5442 in the host, as this port is used by NGINX to publish your app in port default https port (443).
|
|
|
|
|
* The application must be served in plain http as NGINX is the responsible of managing SSL certificate.
|
|
|
|
|
* Remember that application needs to know how to connect to OpenVidu, for that, you can use the variables ${DOMAIN_OR_PUBLIC_IP} and ${OPENVIDU_SECRET} as shown in the sample file.
|
|
|
|
|
* Application has to know OpenVidu Server URL. You can use the variables ${DOMAIN_OR_PUBLIC_IP} and ${OPENVIDU_SECRET} in `docker-compose.override.yml` file.
|
|
|
|
|
|
|
|
|
|
### Start services
|
|
|
|
|
## 4. Execution
|
|
|
|
|
|
|
|
|
|
To download and start the services (OpenVidu platform and the application) you can execute this command:
|
|
|
|
|
To start OpenVidu Platform (and the application if enabled) you can execute this command:
|
|
|
|
|
|
|
|
|
|
`$ docker-compose up -d`
|
|
|
|
|
```
|
|
|
|
|
$ ./openvidu start
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Then, all services will be downloaded (only the first time) and executed.
|
|
|
|
|
Then, all docker images for services will be downloaded (only the first time) and executed.
|
|
|
|
|
|
|
|
|
|
The services will start its execution when you see this output in the shell:
|
|
|
|
|
The first part of the log shows how to docker-compose command execute all services:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
Creating openvidu-docker-compose_coturn_1 ... done
|
|
|
|
@ -145,17 +148,7 @@ Creating openvidu-docker-compose_redis_1 ... done
|
|
|
|
|
Creating openvidu-docker-compose_openvidu-server_1 ... done
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Then, you should check openvidu-server logs to verify if all is configured and working as expected. Use the following command:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ docker-compose logs -f openvidu-server
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
For your convenience, you can execute the following script to perform these two commands (and stop previously started OpenVidu platform, just in case)
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ ./openvidu-restart.sh
|
|
|
|
|
```
|
|
|
|
|
Then, `openvidu-server` service logs are shown.
|
|
|
|
|
|
|
|
|
|
When OpenVidu Platform is ready you will see this message:
|
|
|
|
|
```
|
|
|
|
@ -173,11 +166,41 @@ When OpenVidu Platform is ready you will see this message:
|
|
|
|
|
|
|
|
|
|
You can press `Ctrl+C` to come back to the shell and OpenVidu will be executed in the background.
|
|
|
|
|
|
|
|
|
|
If all is ok, you can open OpenVidu Dashboard to verify if videoconference is working as expected. The user is `OPENVIDUAPP` and the password what you have configured in `.env` file.
|
|
|
|
|
If the application is enabled, it is available in `https://server/`.
|
|
|
|
|
|
|
|
|
|
If video conference application is started, it is available in https://server/
|
|
|
|
|
You can open OpenVidu Dashboard to verify if the platform is working as expected go to `https://server/dashboard/` with credentials:
|
|
|
|
|
* user: OPENVIDUAPP
|
|
|
|
|
* password: the value of OPENVIDU_SECRET in `.env` file.
|
|
|
|
|
|
|
|
|
|
In case OpenVidu server founds any problem with the configuration, it will show a report instead of this message. For example, if you try to use the provided .env file without configuring OPENVIDU_SECRET and OPENVIDU_DOMAIN_OR_PUBLIC_IP you will see the following report
|
|
|
|
|
## 6. Stop execution
|
|
|
|
|
|
|
|
|
|
To stop the platform execute:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ ./openvidu stop
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 6. Changing configuration
|
|
|
|
|
|
|
|
|
|
To change the configuration:
|
|
|
|
|
* Change configuration in `.env` file
|
|
|
|
|
* Restart the service with command:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ ./openvidu restart
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Or using the provided script:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ ./openvidu-restart.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 5. Problems
|
|
|
|
|
|
|
|
|
|
### Configuration errors
|
|
|
|
|
|
|
|
|
|
If you have any problem with the configuration, when you start OpenVidu the following report will be shown:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
@ -195,45 +218,36 @@ In case OpenVidu server founds any problem with the configuration, it will show
|
|
|
|
|
2) Set correct values in '.env' configuration file
|
|
|
|
|
3) Restart OpenVidu with:
|
|
|
|
|
|
|
|
|
|
$ ./openvidu-restart.sh
|
|
|
|
|
$ ./openvidu restart
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Docker compose
|
|
|
|
|
|
|
|
|
|
### Stop services
|
|
|
|
|
To solve any other issue, it is important to understand how openvidu is executed.
|
|
|
|
|
|
|
|
|
|
To stop the application exec this command:
|
|
|
|
|
OpenVidu is executed as a docker-compose file. The commands executed by the script are the standard docker-compose commands:
|
|
|
|
|
|
|
|
|
|
`docker-compose stop`
|
|
|
|
|
* start
|
|
|
|
|
* `$ docker-compose up -d`
|
|
|
|
|
* `$ docker-compose logs -f openvidu-server`
|
|
|
|
|
* stop
|
|
|
|
|
* `$ docker-compose down`
|
|
|
|
|
* restart
|
|
|
|
|
* `$ docker-compose down`
|
|
|
|
|
* `$ docker-compose up -d`
|
|
|
|
|
* `$ docker-compose logs -f openvidu-server`
|
|
|
|
|
* logs
|
|
|
|
|
* `$ docker-compose logs -f openvidu-server`
|
|
|
|
|
|
|
|
|
|
### Change configuration
|
|
|
|
|
|
|
|
|
|
To change the configuration follow this steps:
|
|
|
|
|
* Change configuration in `.env` file
|
|
|
|
|
* Restart the service
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ docker-compose down
|
|
|
|
|
$ docker-compose up -d
|
|
|
|
|
$ docker-compose logs -f openvidu-server
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Or using the provided script:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ ./openvidu-restart.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
* Start the services: `$ docker-compose up -d`
|
|
|
|
|
|
|
|
|
|
## 3. What to do if OpenVidu is not working
|
|
|
|
|
As you can see, logs of `openvidu-server` service are shown when platform is started or restarted. This log contains the most important information for the OpenVidu execution.
|
|
|
|
|
|
|
|
|
|
### Show service logs
|
|
|
|
|
|
|
|
|
|
Take a look to service logs to see what happen. First, see openvidu-server logs:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ docker-compose logs -f openvidu-server
|
|
|
|
|
$ ./openvidu logs
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Then, you can see all service logs togheter:
|
|
|
|
@ -251,7 +265,7 @@ $ docker-compose logs -f app
|
|
|
|
|
```
|
|
|
|
|
### Review the configuration
|
|
|
|
|
|
|
|
|
|
Sometimes, we can have a typo when writing a property name. For this reason, openvidu-server print in the log all the configuration properties you are configured in the file and the default values for all other config properties. In that way, you can double check what openvidu-server *see*.
|
|
|
|
|
Sometimes, we can have a typo when writing a property name. For this reason, openvidu-server print in the log all the configuration properties you are configured in `.env` file and the default values for all other config properties. In that way, you can double check what openvidu-server *see*.
|
|
|
|
|
|
|
|
|
|
If `openvidu-server` detects some error, it will show it in the log.
|
|
|
|
|
|
|
|
|
@ -271,12 +285,8 @@ If `openvidu-server` detects some error, it will show it in the log.
|
|
|
|
|
|
|
|
|
|
### Change log level of the services
|
|
|
|
|
|
|
|
|
|
#### Openvidu Server Level logs
|
|
|
|
|
|
|
|
|
|
To change the level of `openvidu-server` logs change the property `OV_CE_DEBUG_LEVEL`.
|
|
|
|
|
|
|
|
|
|
#### Kurento Media Server Level logs
|
|
|
|
|
|
|
|
|
|
To change the level of Kurento Media Server `kms` logs change the property `KMS_DEBUG_LEVEL`. For more information about possible values visit https://doc-kurento.readthedocs.io/en/stable/features/logging.html
|
|
|
|
|
|
|
|
|
|
### Change Kurento Media Server docker image
|
|
|
|
|