Configuring External S3 for OpenVidu Recordings#
By default, OpenVidu uses MinIO for storing recordings. You can configure it to use an external S3 bucket instead. This guide uses AWS S3, but can be adapted for other S3-compatible services.
Global Configuration with openvidu.env
#
The openvidu.env
file defines global parameters used in service configurations. So we can use it to define our S3 configuration details and afterwards use them in the services that need them.
- SSH into one of your Master Nodes (or Single Node).
-
Add these variables to
openvidu.env
:RECORDINGS_S3_BUCKET=openvidu-recordings RECORDINGS_S3_ENDPOINT=https://s3.us-east-2.amazonaws.com RECORDINGS_AWS_ACCESS_KEY=<YOUR_AWS_ACCESS_KEY> RECORDINGS_AWS_SECRET_KEY=<YOUR_AWS_ACCESS_SECRET> RECORDINGS_AWS_REGION=us-east-2 RECORDINGS_S3_FORCE_PATH_STYLE=false
The location of the file depends on the type of deployment:
- Single Node:
/opt/openvidu/config/openvidu.env
- Elastic / High Availability:
/opt/openvidu/config/cluster/openvidu.env
Warning
In AWS it is necessary to specify the region in the endpoint URL as you can see in
RECORDINGS_S3_ENDPOINT
. Check the AWS S3 endpoints documentation for more information.Info
The parameters defined at
openvidu.env
can be used in other configuration files by using the${openvidu.VARIABLE_NAME}
syntax. If you want to know more about the configuration system of OpenVidu, check the Configuration In-depth section. - Single Node:
-
Update
egress.yaml
to use these variables:The location of the file depends on the type of deployment:s3: access_key: ${openvidu.RECORDINGS_AWS_ACCESS_KEY} secret: ${openvidu.RECORDINGS_AWS_SECRET_KEY} region: ${openvidu.RECORDINGS_AWS_REGION} endpoint: ${openvidu.RECORDINGS_S3_ENDPOINT} bucket: ${openvidu.RECORDINGS_S3_BUCKET} force_path_style: ${openvidu.RECORDINGS_S3_FORCE_PATH_STYLE}
- Single Node:
/opt/openvidu/config/egress.yaml
- Elastic / High Availability:
/opt/openvidu/config/cluster/media_node/egress.yaml
- Single Node:
-
Restart the Master Node (or Single Node) to apply the changes:
This command will restart the services which changed their configuration files in your entire OpenVidu deployment.
Additional Configuration for Default App and V2 Compatibility#
If using the Default App (OpenVidu Call) or V2 Compatibility, additional configurations are required.
OpenVidu Default App (OpenVidu Call)#
-
Update
app.env
with:CALL_S3_BUCKET=${openvidu.RECORDINGS_S3_BUCKET} CALL_S3_SERVICE_ENDPOINT=${openvidu.RECORDINGS_S3_ENDPOINT} CALL_S3_ACCESS_KEY=${openvidu.RECORDINGS_AWS_ACCESS_KEY} CALL_S3_SECRET_KEY=${openvidu.RECORDINGS_AWS_SECRET_KEY} CALL_AWS_REGION=${openvidu.RECORDINGS_AWS_REGION} CALL_S3_WITH_PATH_STYLE_ACCESS=${openvidu.RECORDINGS_S3_FORCE_PATH_STYLE}
The location of the file depends on the type of deployment:
- Single Node:
/opt/openvidu/config/app.env
- Elastic / High Availability:
/opt/openvidu/config/cluster/master_node/app.env
- Single Node:
PRO V2 Compatibility#
-
Update
v2compatibility.env
with:V2COMPAT_OPENVIDU_PRO_RECORDING_STORAGE=s3 V2COMPAT_OPENVIDU_PRO_AWS_S3_BUCKET=${openvidu.RECORDINGS_S3_BUCKET} V2COMPAT_OPENVIDU_PRO_AWS_S3_SERVICE_ENDPOINT=${openvidu.RECORDINGS_S3_ENDPOINT} V2COMPAT_OPENVIDU_PRO_AWS_ACCESS_KEY=${openvidu.RECORDINGS_AWS_ACCESS_KEY} V2COMPAT_OPENVIDU_PRO_AWS_SECRET_KEY=${openvidu.RECORDINGS_AWS_SECRET_KEY} V2COMPAT_OPENVIDU_PRO_AWS_REGION=${openvidu.RECORDINGS_AWS_REGION} V2COMPAT_OPENVIDU_PRO_AWS_S3_WITH_PATH_STYLE_ACCESS=${openvidu.RECORDINGS_S3_FORCE_PATH_STYLE}
The location of the file depends on the type of deployment:
- Single Node:
/opt/openvidu/config/v2compatibility.env
- Elastic / High Availability:
/opt/openvidu/config/cluster/master_node/v2compatibility.env
- Single Node: