Go back

How to run TrueConf Server in a Docker container

TrueConf Server video conferencing platform can be installed both on Windows OS and on various Linux distros. For even more convenient deployment you can use our Docker container that already contains TrueConf Server. The Docker container is available in a public repository, follow this link to download:

https://hub.docker.com/r/trueconf/trueconf-server

What is Docker?

Docker is software package designed for delivering applications to physical and virtual machines and running these applications in an isolated environment (so-called container). In its turn, the container is created from the image, which contains packaged software and all the necessary dependencies. The machine where you installed the docker engine and the environment where your containers operate is called host (e.g. your computer).

A number of popular images are hosted in public repositories on the Docker Hub official portal.

This way of software deployment is often used thanks to its versatility, lower system resources usage, quick and easy launch, simple maintenance and rich database of publicly available images. Additionally, containers are independent and isolated from each other.

This article shows how to install Docker on Debian 10 and run TrueConf Server container.

If you want to learn how to install Docker on Windows and macOS, check out the official guide.

In order to run the following commands you should have sudo app, while user’s name has to belong to the respective group. If you’d like to check whether you have sudo installed, please run sudo -V command. If you don’t have sudo by default, you can install it by using apt install sudo (it should be run under the root account). To add another user with user login to the sudo group, please run sudo usermod -a -G sudo user. You should also add this user to the docker group as shown in the official guide.

Step 1. Installing Docker

In order to install Docker on Debian from the official repository you should run the following commands in your console:

  1. Install necessary software package to work with the repositories via HTTPS:
  2. Import official Docker GPG key:
  3. Use the following command to set up the stable repository:
  4. Install Docker and all the relevant packages:
  5. Verify that the installation has been successful:

This command downloads a test image, opens the image in an isolated container, displays relevant information in the terminal console and stops the container automatically.

Step 2. Downloading and running TrueConf Server container

In order to create and run TrueConf Server container from an image automatically, the docker run command is used. If you don’t have image file in your system it will be downloaded automatically from the public repository:

where [OPTIONS] are additional parameters. For instance, a command which is run the first time:

downloads TrueConf Server image, then creates and runs the container in the background, and returns control of the terminal to the user. Meanwhile, all the necessary ports for TrueConf Server operation will be open. The control panel access is given to the admin with username tc_admin and password 12345, while TrueConf Server working directory will be mounted to the host directory by the path /home/$USER/trueconf/server.

Below we will review some of the used parameters which we can combine with the standard Docker options described in the official guide. For instance, you can enter key --name in order to give name to the container for more convenient usage.

$USER is an environment variable of the Linux family; when used in commands, it is automatically replaced by the current user’s login name.

Host network connection (–network=host)

In order to establish the container connection with the network run the command --network=host. It allows you to use the host network connection.

If you have specified this parameter, it will not be necessary to configure port forwarding described below. However, you have to make sure that the required ports are opened on the host machine, at least 80, 443, and 4307.

Port forwarding (-p [host_port]:[container_port]/[protocol])

Binding of the host machine port [host_port] to port [container_port] of the container using [protocol] (if not specified, tcp is used by default). Port ranges are specified in the same way, e.g. -p 53000-55000:53000-55000/udp.

It is required to forward ports mandatory for TrueConf Server: 80, 443, 4307.

If you need to provide access for TrueConf Server additional ports, (e.g. for WebRTC), you should also specify them:

Setting environment variables (-e [variable]=[value])

Setting environment variables for the container. You can set:

  • -e ADMIN_USER=tc_admin -e ADMIN_PASSWORD=password – creates a TrueConf Server admin account with login tc_admin and password password inside the container. Please note that this user is not related to host OS users, which is why you can use any authorization data.
  • -e INIT_DB=true – creates a database cluster for initial use in the force mode. The database is mounted on the host volume. This option erases all the previous TrueConf Server settings such as registration information, user and group list, conferences profiles, etc. Only video conference recordings will be saved, however they won’t be displayed in the control panel.
  • -e ServerID=xxxx -e Serial=xxxx -e ServerName=xxxx – automatic TrueConf Server registration (if you have already received TrueConf Server registration key), where:
    • ServerID – Server ID
    • Serial – registration key without the first four or five characters, e.g., if your registration key is AAAAA-BBBB-CCCC-DDDD, you should enter BBBB-CCCC-DDDD
    • ServerName – domain name (FQDN) to get the access to the server, e.g., video.company.name.

    Please note that to start registration you should enter all the three parameters at once.

  • -e ServiceAddress – external video conferencing server address to get access outside the corporate network. If it’s not set, it will be ServerName by default.

Mounting directories (-v [host_path]:[container_path])

Mounting [host_path] directory on the host to the [container_path] container directory. You can use a directory mounting to save log files and other generated server data to the [host_path] path. It includes such data as server settings, accounts, conferences list, recordings, SSL certificates and user scripts, etc. After the container stops, the data is saved and is available next time the container is running. If the [host_path] doesn’t exist on the host, it will be created automatically.

We will show available paths for mounting with examples below:

  • -v /home/$USER/trueconf/server/lib:/opt/trueconf/server/var/lib – saving all the files in TrueConf Server working directory except for the log files in the  /home/$USER/trueconf/server host directory.
  • -v /home/$USER/trueconf/server/log:/opt/trueconf/server/var/log – saving log files that generate only when TrueConf Server is running in the /home/$USER/trueconf/server/log host directory.
  • -v /path/to/custom/certs:/ssl – specifies path to the /path/to/custom/certs host directory with SSL certificate files to be used by the server in the container. In order to apply SSL certificates after the mounting, please open the TrueConf Server control panel, go to Web → HTTPS section and select Use custom certificate in the HTTPS Mode drop-down list. Click Test configuration and Apply to save changes.
  • -v /path/to/custom/scripts:/setup.d – command for /path/to/custom/scripts volume mounting with additional sh scripts files to be run at the container startup.
Please take two details into account when mounting the directory with the certificates:

  1. TrueConf Server works only with the .crt format. So, the folder should include two files with the following extensions: .crt for the certificate file and .key for the key file. If your certificate is in a different format, convert into .crt as it is described in our article about HTTPS configuration.
  2. The files should be named in the following way: the certificate — tls.crt, the key — tls.key.

Container name and ID

To use a number of commands, one has to know the name and identifier (ID) of the container. To get this information, run this command:

You will get the list of all containers and their statuses.

To display only running containers, execute this command:

In the Docker documentation, you can find more examples of how the ps command can be used.

Stopping and restarting the container

To stop the container, please run the command:

where vcs_server is the name or identifier of your container.

To restart the container that has been stopped earlier, please run the command:

One-time container running

For testing purposes you may need to run one-time container. This container will be deleted automatically after its stop. You can do it by running --rm.

Here’s how one-time container launch command with an admin’s login and password specified will look like:

Step 3. Registering TrueConf Server

If you didn’t register your TrueConf Server earlier by using -e key , you can register it via the TrueConf Server control panel. Open the control panel in the browser on any of your local network computers and enter the IP address of the server where the container is running.

Step 4. Adding TrueConf Server administrators

Before adding new users with admin access to the TrueConf Server control panel, please make sure that the container has been run, and its directory /opt/trueconf/server/var/lib has already been mounted to the /home/$USER/trueconf/server/lib directory on the host as shown before.

These are the three authorization files which have to be created by executing the following command:

where

  • passwd – a login and an encrypted password
  • tcadmins – a list of server administrator logins with full access
  • tcsecadmins – a list of server administrator logins with Security Admin access level.

After that please follow the next steps:

  1. Install apache2-utils utility package which contains htpasswd to manage secret passwords:
  2. Generate a password for a new login. The password will be saved as passwd file in the directory from which the terminal has been run:

where

  • new_admin – a new admin’s login
  • password – password
  1. Add content from the generated passwd file to the /home/$USER/trueconf/server/docker/passwd file. The file is on the volume which is mounted on the host. For this purpose you can use a text editor such as vim or nano. Please run it under the root account or using sudo. You can also run the command:
  2. Add the admin login you have created either to tcadmins or tcsecadmins file, depending on the level access you want to grant to the admin:
  3. To check if you have added admins successfully, please visit TrueConf Server guest page, click Administrator login and sign in with a new account.

Step 5. Adding container to run automatically

In order to start TrueConf Server container automatically, e.g, after host machine reboot, please use --restart key. You can specify the key by running the update command:

where vcs_server is your container’s name or ID.

You can also do it at the time when the container is running.

You can view information about the container which is running by using sudo docker pscommand.

Updating TrueConf Server in the container

For TrueConf Server 5.2.9 and above

If TrueConf Server 5.2.9 or above is run in the container, you will only need to download a new image to update (e.g., you may use the stable tag to download the release version).

  1. Download an image with this command:

  2. Stop the current container with TrueConf Server as it is described before.

  3. Run the new container from the image downloaded at step 1 ( the example with the stable tag). You will need to specify the paths for mounting directories (they must be identical to the ones used previously):

If everything is installed successfully, you may delete the previous containers and the image as it is described below.

For TrueConf Server 5.2.8 or below

If you run TrueConf Server 5.2.8 or below in the container, you will need to export information from the database to update to version 5.2.9 or above.

  1. Download the image with the new version (e.g., by using the stable tag to download the release version):

  2. Go to the command shell (terminal) of the container where TrueConf Server is deployed:

    where vcs_server is the name or identifier of your container.

  3. Create a backup copy of the TrueConf Server database:

  4. As a result, the backup copy will be saved in the mounted directory at the path

    where is the path specified when the container was started. Here is an example of the path to the backup file:

  5. Exit the container terminal:
  6. Copy the backup copy of the database to any convenient location, for example /home/$USER/backup:

  7. Execute the following command to create and run the container with the new version of TrueConf Server:

    where /home/$USER/backup is the directory with the database backup file.

    In addition to the database backup path, use the -v key to specify the paths for mounting directories (they must be identical to the ones used before).

  8. Go to the guest page of the server by using the IP address of the machine where the container is running. Make sure that all the settings have been imported. If everything works as it should, the previous container and image can be deleted as it is described below.

Deleting the container and image

If you no longer need the container, you can delete it with the rm command:

where vcs_server is the name or identifier of your container. The corresponding image will remain even if all containers are deleted. Besides, the directory which was used for mounting will also remain in the OS.

To delete a running container, add the key --force:

To delete an image (e.g., if you have downloaded a new image and the old one is no longer needed):

  1. Check the list of all images together with their tags and identifiers:

  2. To delete the selected image, run the rmi command, for example:

    In this case, you will delete the image with the repository and tag trueconf/trueconf-server:5.2.8.10213. If this image no longer has any tags, it will also be deleted. To learn more about the use of this command, read the official Docker documentation.

  3. Since the rmi command does not free up space on the OS storage, you will need to execute system prune command to delete unnecessary images and containers:


Still have questions? Please contact our support team directly via online chat.

Sign up for newsletter