# Scalable setup Jitsi Docker

Link: [https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable)

A single server Jitsi installation is good for a limited size of concurrent conferences. The first limiting factor is the videobridge component, that handles the actual video and audio traffic. It is easy to scale the video bridges horizontally by adding as many as needed. In a cloud based environment, additionally the bridges can be scaled up or down as needed.  
  
**DANGER**

The [Youtube Tutorial on Scaling](https://www.youtube.com/watch?v=LyGV4uW8km8) is outdated and describes an old configuration method. The current default Jitsi Meet install is already configured for horizontal scalability.  
  
**NOTE**

Building a scalable infrastructure is not a task for beginning Jitsi Administrators. The instructions assume that you have installed a single node version successfully, and that you are comfortable installing, configuring and debugging Linux software. This is not a step-by-step guide, but will show you, which packages to install and which configurations to change. It is highly recommended to use configuration management tools like Ansible or Puppet to manage the installation and configuration.

## Architecture (Single Jitsi-Meet, multiple videobridges)[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#architecture-single-jitsi-meet-multiple-videobridges "Direct link to Architecture (Single Jitsi-Meet, multiple videobridges)")

A first step is to split the functions of the central jitsi-meet instance (with nginx, prosody and jicofo) and videobridges.

A simplified diagram (with open network ports) of an installation with one Jitsi-Meet instance and three videobridges that are load balanced looks as follows. Each box is a server/VM.

```
               +                                       +
               |                                       |
               |                                       |
               v                                       v
          80, 443 TCP                          443 TCP, 10000 UDP
       +--------------+                     +---------------------+
       |  nginx       |  5222 TCP           |                     |
       |  Jitsi Meet  |<-------------------+|  jitsi-videobridge  |
       |  prosody     |         |           |                     |
       |  jicofo      |         |           +---------------------+
       +--------------+         |
                                |           +---------------------+
                                |           |                     |
                                +----------+|  jitsi-videobridge  |
                                |           |                     |
                                |           +---------------------+
                                |
                                |           +---------------------+
                                |           |                     |
                                +----------+|  jitsi-videobridge  |
                                            |                     |
                                            +---------------------+

```

<div class="codeBlockContainer_Ckt0 theme-code-block" id="bkmrk-" style="text-align: justify;"><div class="codeBlockContent_biex"><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div>## Machine Sizing[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#machine-sizing "Direct link to Machine Sizing")

The Jitsi-Meet server will generally not have that much load (unless you have many) conferences going at the same time. A 4 CPU, 8 GB machine will probably be fine.

The videobridges will have more load. 4 or 8 CPU with 8 GB RAM seems to be a good configuration.

### Installation of Jitsi-Meet[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#installation-of-jitsi-meet "Direct link to Installation of Jitsi-Meet")

Assuming that the installation will run under the following FQDN: `meet.example.com` and you have SSL cert and key in `/etc/ssl/meet.example.com.{crt,key}`

Set the following DebConf variables prior to installing the packages. (We are not installing the `jitsi-meet` package which would handle that for us)

Install the `debconf-utils` package

```text
$ cat << EOF | sudo debconf-set-selections
jitsi-videobridge   jitsi-videobridge/jvb-hostname  string  meet.example.com
jitsi-meet  jitsi-meet/jvb-serve    boolean false
jitsi-meet-prosody  jitsi-videobridge/jvb-hostname  string  meet.example.com
jitsi-meet-web-config   jitsi-meet/cert-choice  select  I want to use my own certificate
jitsi-meet-web-config   jitsi-meet/cert-path-crt    string  /etc/ssl/meet.example.com.crt
jitsi-meet-web-config   jitsi-meet/cert-path-key    string  /etc/ssl/meet.example.com.key
jitsi-meet-web-config   jitsi-meet/jaas-choice  boolean false
EOF
```

<div class="codeBlockContainer_Ckt0 theme-code-block" id="bkmrk--1" style="text-align: justify;"><div class="codeBlockContent_biex"><div class="buttonGroup__atx"><button aria-label="Copy code to clipboard" class="clean-btn" title="Copy" type="button"><span aria-hidden="true" class="copyButtonIcons_eSgA"><svg class="copyButtonIcon_y97N" viewbox="0 0 24 24"><path d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z" fill="currentColor"></path></svg><svg class="copyButtonSuccessIcon_LjdS" viewbox="0 0 24 24"><path d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" fill="currentColor"></path></svg></span></button></div></div></div>To enable integration with [Jitsi Meet Components](https://jaas.8x8.vc/#/components) for telephony support, set the `jitsi-meet/jaas-choice` option above to `true`.

On the jitsi-meet server, install the following packages:

- `nginx`
- `prosody`
- `jicofo`
- `jitsi-meet-web`
- `jitsi-meet-prosody`
- `jitsi-meet-web-config`

### Installation of Videobridge(s)[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#installation-of-videobridges "Direct link to Installation of Videobridge(s)")

For simplicities sake, set the same `debconf` variables as above and install

- `jitsi-videobridge2`

### Configuration of jitsi-meet[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#configuration-of-jitsi-meet "Direct link to Configuration of jitsi-meet")

#### Firewall[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#firewall "Direct link to Firewall")

Open the following ports:

Open to world:

- 80 TCP
- 443 TCP

Open to the videobridges only

- 5222 TCP (for Prosody)

#### NGINX[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#nginx "Direct link to NGINX")

Create the `/etc/nginx/sites-available/meet.example.com.conf` as usual

#### Jitsi-Meet[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#jitsi-meet "Direct link to Jitsi-Meet")

Adapt `/usr/share/jitsi-meet/config.js` and `/usr/share/jitsi-meet/interface-config.js` to your specific needs

#### Jicofo[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#jicofo "Direct link to Jicofo")

No changes necessary from the default install.

### Configuration of the Videobridge[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#configuration-of-the-videobridge "Direct link to Configuration of the Videobridge")

#### Firewall[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#firewall-1 "Direct link to Firewall")

Open the following ports:

Open to world:

- 10000 UDP (for media)

#### jitsi-videobridge2[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#jitsi-videobridge2 "Direct link to jitsi-videobridge2")

No changes necessary from the default setup.

## Testing[​](https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-scalable#testing "Direct link to Testing")

After restarting all services (`prosody`, `jicofo` and all the `jitsi-videobridge2`) you can see in `/var/log/prosody/prosody.log` and `/var/log/jitsi/jicofo.log` that the videobridges connect to Prososy and that Jicofo picks them up.

When a new conference starts, Jicofo picks a videobridge and schedules the conference on it.