OpenVidu Single Node: On-premises configuration and administration#
The OpenVidu installer offers an easy way to deploy OpenVidu Single Node on-premises. However, once the deployment is complete, you may need to perform administrative tasks based on your specific requirements, such as changing passwords, specifying custom configurations, and starting or stopping services.
This section provides details on configuration parameters and common administrative tasks for on-premises OpenVidu Single Node deployments.
OpenVidu configuration#
Directory structure#
OpenVidu is installed at /opt/openvidu/
and has a systemd service located at /etc/systemd/system/openvidu.service
.
The directory structure of OpenVidu is as follows:
|-- /opt/openvidu
|-- config/
|-- custom-layout/
|-- data/
|-- deployment-info.yaml
|-- docker-compose.override.yml
|-- docker-compose.yml
|-- .env
`-- owncert/
config/
: Contains the configuration files for the services deployed with OpenVidu.custom-layout/
: An empty directory where you can place Custom Recording Templates for the Egress service.data/
: Contains the data generated by the services deployed with OpenVidu.deployment-info.yaml
: Contains the deployment information of OpenVidu.docker-compose.override.yml
: Contains the service with the Default App (OpenVidu Call).docker-compose.yml
: Contains the main services deployed with OpenVidu..env
: Contains parameters managed by multiple services.owncert/
: Contains the custom certificates for the Caddy server if you are using your own certificates.
Services Configuration#
Some services deployed with OpenVidu have their own configuration files located in the /opt/openvidu/config/
directory, while others are configured in the .env
file. Below are the services and their respective configuration files and parameters:
Info
The installer provides default configurations that work out of the box. However, you can modify these configurations to suit your specific requirements.
Configuration Files#
Service | Description | Configuration File Location |
Reference documentation |
---|---|---|---|
OpenVidu Server | Manages video rooms. It is compatible with LiveKit configuration and includes its own OpenVidu configuration parameters | /opt/openvidu/config/livekit.yaml |
LiveKit Config |
Ingress Service | Imports video from other sources into OpenVidu rooms. | /opt/openvidu/config/ingress.yaml |
LiveKit Ingress Config |
Egress Service | Exports video from OpenVidu rooms for recording or streaming. | /opt/openvidu/config/egress.yaml |
LiveKit Egress Config |
Caddy Server | Serves OpenVidu services and handles HTTPS. | /opt/openvidu/config/caddy.yaml |
Caddy JSON Structure |
Prometheus Service | Used for monitoring. | /opt/openvidu/config/prometheus.yaml |
Prometheus Config |
Loki Service | Used for log aggregation. | /opt/openvidu/config/loki.yaml |
Loki Config |
Promtail Service | Collects logs and sends them to Loki. | /opt/openvidu/config/promtail.yaml |
Promtail Config |
Grafana Service | Used for visualizing monitoring data. | /opt/openvidu/config/grafana_config/ |
Grafana Config |
Environment Variables#
Service | Description | Environment Variables |
---|---|---|
OpenVidu Server | Manages video rooms. |
|
Grafana Service | Used for visualizing monitoring data. |
|
OpenVidu Dashboard | Used to visualize OpenVidu Server Rooms, Ingress, and Egress services. |
|
Default App (OpenVidu Call) | Default ready-to-use video conferencing app. |
|
Redis Service | Used as a shared memory database for OpenVidu and Ingress/Egress services. |
|
MinIO Service | Used for storing recordings. |
|
MongoDB Service | Used for storing analytics and monitoring data. |
|
OpenVidu Configuration Parameters#
OpenVidu Server is built on top of LiveKit and offers extra configuration options. You can find the configuration file at /opt/openvidu/config/livekit.yaml
. The additional parameters for configuring the OpenVidu Server are:
openvidu:
analytics: # (1)
enabled: true # (2)
mongo_url: mongodb://<MONGO_ADMIN_USERNAME>:<MONGO_ADMIN_PASSWORD>@localhost:20000/ # (3)
interval: 10s # (4)
expiration: 768h # (5)
- The
analytics
configuration should be defined at theopenvidu
level in thelivekit.yaml
file. - This must be set to
true
to send analytics data to MongoDB. If set tofalse
, no analytics data will be sent. - MongoDB connection string. In OpenVidu Single Node, the MongoDB service is running on the same machine, so you can use
localhost
as the hostname. The default port in OpenVidu for MongoDB is20000
.MONGO_ADMIN_USERNAME
andMONGO_ADMIN_PASSWORD
are the credentials to access the MongoDB database. - Time interval to send analytics data to MongoDB.
- Time to keep the analytics data in MongoDB. In this example, it is set to 32 days.
Starting, stopping, and restarting OpenVidu#
You can start, stop, and restart the OpenVidu services using the following commands:
Start OpenVidu
Stop OpenVidu
Restart OpenVidu
Checking the status of services#
You can check the status of the OpenVidu services using the following command:
The services are operating correctly if you see an output similar to the following and there are no restarts from any of the services:
NAME IMAGE COMMAND SERVICE CREATED STATUS
app docker.io/openvidu/openvidu-call "docker-entrypoint.s…" app 19 seconds ago Up 16 seconds
caddy docker.io/openvidu/openvidu-caddy "/bin/caddy run --co…" caddy 19 seconds ago Up 16 seconds
dashboard docker.io/openvidu/openvidu-dashboard "./openvidu-dashboard" dashboard 19 seconds ago Up 16 seconds
egress docker.io/livekit/egress "/entrypoint.sh" egress 18 seconds ago Up 14 seconds
grafana docker.io/grafana/grafana "/run.sh" grafana 18 seconds ago Up 13 seconds
ingress docker.io/livekit/ingress "ingress" ingress 19 seconds ago Up 14 seconds
loki docker.io/grafana/loki "/usr/bin/loki -conf…" loki 18 seconds ago Up 14 seconds
minio docker.io/bitnami/minio "/opt/bitnami/script…" minio 18 seconds ago Up 14 seconds
mongo docker.io/mongo "docker-entrypoint.s…" mongo 18 seconds ago Up 15 seconds
openvidu docker.io/openvidu/openvidu-server "/livekit-server --c…" openvidu 19 seconds ago Up 14 seconds
prometheus docker.io/prom/prometheus "/bin/prometheus --c…" prometheus 18 seconds ago Up 14 seconds
promtail docker.io/grafana/promtail "/usr/bin/promtail -…" promtail 18 seconds ago Up 14 seconds
redis docker.io/redis "docker-entrypoint.s…" redis 19 seconds ago Up 15 seconds
Checking logs#
If any of the services are not working as expected, you can check the logs of the services using the following command:
Replace <service-name>
with the name of the service you want to check. For example, to check the logs of the OpenVidu Server, use the following command:
To check the logs of all services, use the following command:
You can also review your logs using the Grafana dashboard provided with OpenVidu. To access it, go to https://<your-domain.com>/grafana and use the credentials located in /opt/openvidu/.env
to log in. Once inside, navigate to the "Home" section, select "Dashboard", and then click on "OpenVidu > OpenVidu Logs". All the logs will be displayed there.
Advanced Configuration#
This section addresses advanced configuration scenarios for customizing your OpenVidu Single Node deployment. It includes automating the installation with personalized settings, enabling or disabling OpenVidu modules, and modifying global parameters such as the domain name, passwords, and API keys.
Automatic installation and configuration#
For environments like the cloud, where instances are frequently spun up and down, automating the application of custom configurations to OpenVidu may be useful for you.
If you need to automate these configuration changes, you can use the following script template as an example:
# 1. First install OpenVidu (1)
sh <(curl -fsSL http://get.openvidu.io/community/singlenode/latest/install.sh) \
--domain-name-or-ip='openvidu.example.io' \
... # Add the rest of the arguments
# 2. Add custom configurations (2)
######### APPLY CUSTOM CONFIGURATIONS #########
# If you want to apply any modification to the configuration files
# of the OpenVidu services at /opt/openvidu, you can do it in this section.
# Example 1: Change public IP address announced by OpenVidu for WebRTC connections
yq eval '.rtc.node_ip = 1.2.3.4' \
-i /opt/openvidu/config/livekit.yaml
# Example 2: Add a webhook to LiveKit
yq eval '.webhook.urls += ["http://new-endpoint.example.com/webhook"]' \
-i /opt/openvidu/config/livekit.yaml
######### END CUSTOM CONFIGURATIONS #########
# 3. Start OpenVidu # (3)
systemctl start openvidu
- First, install OpenVidu using the OpenVidu installer. Check the installation guide for more information.
- Add the custom configurations you need to apply to the OpenVidu services. You can use
yq
or other tools to modify the configuration files. You can find more information aboutyq
here. - Start OpenVidu to apply the changes.
Note
In case you want to deploy a specific version, just replace latest
with the desired version. For example: 3.0.0
.
Just install OpenVidu first with the installer and then run some extra commands to apply the custom configurations. This way, you can automate the process of installing OpenVidu and applying custom configurations.
Enabling and disabling OpenVidu modules#
The COMPOSE_PROFILES
parameter in the .env
file allows you to enable or disable specific modules in OpenVidu. The following modules can be enabled or disabled:
Enabling the observability
module
In case you have installed OpenVidu with the observability
module, you just need to enable the observability
module in the .env
file.
Otherwise, you can follow these steps to enable the observability
module:
-
Stop OpenVidu and backup the deployment
-
Update the
.env
fileAdd to the
COMPOSE_PROFILES
theobservability
module. Also make sure to set up theGRAFANA_ADMIN_USERNAME
andGRAFANA_ADMIN_PASSWORD
parameters.If you have only the observability module enabled, your
.env
file should have the following environment variables: -
Enable Prometheus port in LiveKit
Just add the following parameter in the
config/livekit.yaml
file:
Disabling the observability
module
If you have the observability
module enabled, and you want to disable it, just remove the observability
module from the COMPOSE_PROFILES
parameter in the .env
file.
Enabling the app
module
In case you have installed OpenVidu with the app
module, you just need to enable the app
module in the .env
file.
Otherwise, you can follow these steps to enable the app
module:
-
Stop OpenVidu and backup the deployment
-
Update the
.env
fileAdd to the
COMPOSE_PROFILES
theapp
module.If you have only the
app
module enabled, your.env
file should have the following environment variable: -
Enable LiveKit webhooks for the Default App
Just add the following parameter in the
config/livekit.yaml
file:Where
<LIVEKIT_API_KEY>
is theLIVEKIT_API_KEY
parameter in the.env
file.
Disabling the app
module
If you have the app
module enabled, and you want to disable it, just remove the app
module from the COMPOSE_PROFILES
parameter in the .env
file.
Global configuration changes#
Some configuration parameters may require modifying multiple configuration files. Below are some examples of advanced configurations and how to apply them:
Info
Usually, this is not needed because the installer takes care of generating all of this parameters. However, it is necessary if any password, credential, or domain change is needed.
Danger
Advanced configurations should be performed with caution. Incorrect configurations can lead to service failures or unexpected behavior.
Before making any changes, make sure to back up your installation by creating a snapshot of your server or by copying the /opt/openvidu/
directory to a safe location. For example:
To change all occurrences of the domain or public IP address in the configuration files, follow these steps:
-
Stop OpenVidu and back up the deployment
-
Find the current locations of
DOMAIN_OR_PUBLIC_IP
With the following commands, you can find all occurrences of the current domain or public IP address in the configuration files:
sudo su cd /opt/openvidu/ CURRENT_DOMAIN_OR_PUBLIC_IP="$(grep '^DOMAIN_OR_PUBLIC_IP' /opt/openvidu/.env | cut -d '=' -f 2)" grep --exclude-dir=data -IHnr "$CURRENT_DOMAIN_OR_PUBLIC_IP" .
The output should look similar to the following:
./.env:DOMAIN_OR_PUBLIC_IP=<CURRENT_DOMAIN_OR_PUBLIC_IP> ./config/caddy.yaml: - certificate: /owncert/<CURRENT_DOMAIN_OR_PUBLIC_IP>.cert ./config/caddy.yaml: key: /owncert/<CURRENT_DOMAIN_OR_PUBLIC_IP>.key ./config/caddy.yaml: - <CURRENT_DOMAIN_OR_PUBLIC_IP> ./config/caddy.yaml: - <CURRENT_DOMAIN_OR_PUBLIC_IP> ./config/caddy.yaml: - <CURRENT_DOMAIN_OR_PUBLIC_IP> ./config/caddy.yaml: - <CURRENT_DOMAIN_OR_PUBLIC_IP> ./config/caddy.yaml: - <CURRENT_DOMAIN_OR_PUBLIC_IP> ./config/caddy.yaml: - <CURRENT_DOMAIN_OR_PUBLIC_IP> ./config/promtail.yaml: cluster_id: <CURRENT_DOMAIN_OR_PUBLIC_IP> ./config/livekit.yaml: rtmp_base_url: rtmps://<CURRENT_DOMAIN_OR_PUBLIC_IP>:1935/rtmp ./config/livekit.yaml: whip_base_url: https://<CURRENT_DOMAIN_OR_PUBLIC_IP>/whip
Note
Don't worry if some values are different in your output. It may vary depending on the parameters you've used to install OpenVidu.
-
Update the Following Files:
Based on the output from the previous step, update the following files with the new domain or public IP address:
.env
config/caddy.yaml
config/promtail.yaml
config/livekit.yaml
-
Verify the changes
These commands will list all occurrences of the new
DOMAIN_OR_PUBLIC_IP
in the configuration files. The output should match the locations found in the initial search but with the new domain or public IP address. -
Start OpenVidu
Some notes on changing the DOMAIN_OR_PUBLIC_IP
parameter:
- If you are using your own certificates, you need to place the new ones at
/opt/openvidu/owncert/<NEW_DOMAIN_OR_PUBLIC_IP>.cert
and/opt/openvidu/owncert/<NEW_DOMAIN_OR_PUBLIC_IP>.key
. - Make sure your new domain is pointing correctly to the machine where OpenVidu is installed.
To change the REDIS_PASSWORD
parameter, follow these steps:
-
Stop OpenVidu and back up the deployment
-
Find the current locations of
REDIS_PASSWORD
With the following command, you can find all occurrences of the current
REDIS_PASSWORD
in the configuration files: -
Update the Following Files:
Based on the output from the previous step, update the following files with the new value:
.env
config/egress.yaml
config/ingress.yaml
config/livekit.yaml
-
Verify the changes
These commands will list all occurrences of the new
REDIS_PASSWORD
in the configuration files. The output should match the locations found in the initial search but with the new value. -
Start OpenVidu
To change the LIVEKIT_API_KEY
and LIVEKIT_API_SECRET
parameters, follow these steps:
-
Stop OpenVidu and back up the deployment
-
Find the current locations of
LIVEKIT_API_KEY
andLIVEKIT_API_SECRET
With the following commands, you can find all occurrences of the current
LIVEKIT_API_KEY
andLIVEKIT_API_SECRET
in the configuration files:sudo su cd /opt/openvidu/ CURRENT_LIVEKIT_API_KEY="$(grep LIVEKIT_API_KEY /opt/openvidu/.env | cut -d '=' -f 2)" CURRENT_LIVEKIT_API_SECRET="$(grep LIVEKIT_API_SECRET /opt/openvidu/.env | cut -d '=' -f 2)" grep --exclude-dir=data -IHnr "$CURRENT_LIVEKIT_API_KEY" . grep --exclude-dir=data -IHnr "$CURRENT_LIVEKIT_API_SECRET" .
The output should look similar to the following for
LIVEKIT_API_KEY
:./.env:LIVEKIT_API_KEY=<CURRENT_LIVEKIT_API_KEY> ./config/egress.yaml:api_key: <CURRENT_LIVEKIT_API_KEY> ./config/ingress.yaml:api_key:<CURRENT_LIVEKIT_API_KEY> ./config/livekit.yaml: <CURRENT_LIVEKIT_API_KEY>: <CURRENT_LIVEKIT_API_SECRET> ./config/livekit.yaml: api_key: <CURRENT_LIVEKIT_API_KEY>
And for
LIVEKIT_API_SECRET
: -
Update the Following Files:
Based on the output from the previous step, update the following files with the new values:
.env
config/egress.yaml
config/ingress.yaml
config/livekit.yaml
-
Verify the changes
These commands will list all occurrences of the new
LIVEKIT_API_KEY
andLIVEKIT_API_SECRET
in the configuration files. The output should match the locations found in the initial search but with the new values. -
Start OpenVidu
To change the MINIO_ACCESS_KEY
and MINIO_SECRET_KEY
parameters, follow these steps:
-
Stop OpenVidu and back up the deployment
-
Find the current locations of
MINIO_ACCESS_KEY
andMINIO_SECRET_KEY
With the following commands, you can find all occurrences of the current
MINIO_ACCESS_KEY
andMINIO_SECRET_KEY
in the configuration files:sudo su cd /opt/openvidu/ CURRENT_MINIO_ACCESS_KEY="$(grep MINIO_ACCESS_KEY /opt/openvidu/.env | cut -d '=' -f 2)" CURRENT_MINIO_SECRET_KEY="$(grep MINIO_SECRET_KEY /opt/openvidu/.env | cut -d '=' -f 2)" grep --exclude-dir=data -IHnr "$CURRENT_MINIO_ACCESS_KEY" . grep --exclude-dir=data -IHnr "$CURRENT_MINIO_SECRET_KEY" .
-
Update the Following Files:
Based on the output from the previous step, update the following files with the new values:
.env
config/egress.yaml
-
Verify the changes
These commands will list all occurrences of the new
MINIO_ACCESS_KEY
andMINIO_SECRET_KEY
in the configuration files. The output should match the locations found in the initial search but with the new values. -
Start OpenVidu
To change the MONGO_ADMIN_USERNAME
and MONGO_ADMIN_PASSWORD
parameters, follow these steps:
-
Stop OpenVidu and back up the deployment
-
Change the password through the MongoDB shell
With OpenVidu running, change the password with the following commands:
sudo su cd /opt/openvidu/ CURRENT_MONGO_ADMIN_USERNAME="$(grep MONGO_ADMIN_USERNAME /opt/openvidu/.env | cut -d '=' -f 2)" CURRENT_MONGO_ADMIN_PASSWORD="$(grep MONGO_ADMIN_PASSWORD /opt/openvidu/.env | cut -d '=' -f 2)" NEW_MONGO_ADMIN_USERNAME="<NEW_MONGO_ADMIN_USERNAME>" NEW_MONGO_ADMIN_PASSWORD="<NEW_MONGO_ADMIN_PASSWORD>" # Change username docker exec -it mongo \ mongosh admin \ --port 20000 \ --username "$CURRENT_MONGO_ADMIN_USERNAME" \ --password "$CURRENT_MONGO_ADMIN_PASSWORD" \ --eval "db.system.users.updateOne({user: '$CURRENT_MONGO_ADMIN_USERNAME'}, {\$set: {user: '$NEW_MONGO_ADMIN_USERNAME'}})" # Change password docker exec -it mongo \ mongosh admin \ --port 20000 \ --username "$NEW_MONGO_ADMIN_USERNAME" \ --password "$CURRENT_MONGO_ADMIN_PASSWORD" \ --eval "db.changeUserPassword('$NEW_MONGO_ADMIN_USERNAME', '$NEW_MONGO_ADMIN_PASSWORD')"
After running these commands, the new username and password will be updated in the MongoDB database, but you still need to change the configuration files.
-
Stop OpenVidu
-
Find the current locations of
MONGO_ADMIN_USERNAME
andMONGO_ADMIN_PASSWORD
With the following commands, you can find all occurrences of the current
MONGO_ADMIN_USERNAME
andMONGO_ADMIN_PASSWORD
in the configuration files:sudo su cd /opt/openvidu/ CURRENT_MONGO_ADMIN_USERNAME="$(grep MONGO_ADMIN_USERNAME /opt/openvidu/.env | cut -d '=' -f 2)" CURRENT_MONGO_ADMIN_PASSWORD="$(grep MONGO_ADMIN_PASSWORD /opt/openvidu/.env | cut -d '=' -f 2)" grep --exclude-dir=data -IHnr "$CURRENT_MONGO_ADMIN_USERNAME" . grep --exclude-dir=data -IHnr "$CURRENT_MONGO_ADMIN_PASSWORD" .
-
Update the Following Files:
Based on the output from the previous step, update the following files with the new values:
.env
config/livekit.yaml
-
Verify the changes
These commands will list all occurrences of the new
MONGO_ADMIN_USERNAME
andMONGO_ADMIN_PASSWORD
in the configuration files. The output should match the locations found in the initial search but with the new values. -
Start OpenVidu
Uninstalling OpenVidu#
To uninstall OpenVidu, just execute the following commands: