Install Jitsi with recording/streaming on Ubuntu 20.04 AWS instance.

To install jitsi with jibri(recording & streaming module) on aws it takes quite a list of things to be done in sequence and more often than not results in some silly mistake somewhere which makes it a pain to get it working completely as expected. Since i have been setting up around 15-20 servers in the last month or so – I had become quite aware of the sequence of installation steps on ubuntu 16.04. Wanted to try the sequence in 20.04 latest LTS version of ubuntu. Surprisingly, the following sequence of steps makes it work in 20.04 without any problem. I was able to achieve installation to a working solution in under 20 mins 🙂 Not bad!

The sequence of things to do is: (all commands are run as root and server hostname shoudl replace test.nutcrackerz.in which was where I installed.)

Entire video of the 20 minutes of installation is here:

  • The ports to be opened on the server instance is shown below:
  • Since AWS comes with aws kernel image and jibri needs generic image to record sounds thru sound module. we have to install the generic kernel image and boot to it. its just few commands to get it working :
$apt -y install linux-image-extra-virtual
$vim /boot/grub/grub.cfg
## Find out the new kernel from above and make it as default 
## so the first line on below file looks something like
## GRUB_DEFAULT='gnulinux-advanced-ce780dbf-6f70-412d-87dd-61654730a231>gnulinux-5.4.0-42-generic-advanced-ce780dbf-6f70-412d-87dd-61654730a231'

$vim /etc/default/grub 
## add above modification as per your generic kernel version you installed. Checkout the youtube video link if you have any doubts. 

$update-grub

  • Install latest google chrome and web driver.
curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
apt-get -y update
apt-get -y install google-chrome-stable

CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
wget -N http://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip -P ~/
unzip ~/chromedriver_linux64.zip -d ~/
rm ~/chromedriver_linux64.zip
sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
sudo chown root:root /usr/local/bin/chromedriver
sudo chmod 0755 /usr/local/bin/chromedriver

Install jibri

wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | sudo apt-key add - 
sudo sh -c "echo 'deb https://download.jitsi.org stable/' > /etc/apt/sources.list.d/jitsi-stable.list"
sudo apt-get update 
sudo apt-get install jibri    

Configure Jibri

echo "snd-aloop" >> /etc/modules 
mkdir /srv/recordings
chown jibri:jitsi /srv/recordings
vim /etc/jitsi/jibri/config.json 
## Modify the domain and all string that is xmpp.domain to your server hostname . I was installing on test.nutcrackerz.in so it will look like the following:

Restart jibri

systemctl restart jibri   
systemctl status jibri 

Install jitsi-meet and remove TLSv1.3 from nginx config.

apt install jitsi-meet
vim /etc/nginx/sites-enabled/test.nutcrackerz.in.conf ## in line 25 make change so it is [ ssl_protocols TLSv1.2 ] ; remove TLSv1.3
systemctl restart nginx

certbot-auto has problems with ubuntu 20.04 so do following

apt install certbot
vim /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh 
## under condition if [ -f /etc/nginx/sites-enabled/$DOMAIN.conf ] ; then 
## replace ./certbot-auto to certbot (without ./) so it looks like:

Update prosody config with recorder domain

vim /etc/prosody/conf.d/test.nutcrackerz.in.cfg.lua 
#add
VirtualHost "recorder.test.nutcrackerz.in"
  modules_enabled = {
    "ping";
  }
  authentication = "internal_plain"
so it looks like:
prosodyctl register username auth.test.nutcrackerz.in password
prosodyctl register username recorder.test.nutcrackerz.in password
##username and password are default strings set in jibri config if you need to change you can set your custom names/passwords in initial jibri/config.json file

edit sip properties file as below:

vim /etc/jitsi/jicofo/sip-communicator.properties
## add below lines:
org.jitsi.jicofo.jibri.BREWERY=JibriBrewery@internal.auth.test.nutcrackerz.in
org.jitsi.jicofo.jibri.PENDING_TIMEOUT=90

Enable services so they autostart on server bootup (if required) and add user mod for jibri user


systemctl enable nginx.service
systemctl enable jitsi-videobridge2.service
systemctl enable jicofo.service
systemctl enable prosody.service
systemctl enable jibri.service
sudo usermod -aG adm,audio,video,plugdev jibri

Add hiddenDomain to jitsi meet config so it does not show recorder joinee as another conference user:

vim /etc/jitsi/meet/test.nutcrackerz.in-config.js 
# add
hiddenDomain: 'recorder.test.nutcrackerz.in',

Reboot and you are done. You should have the server working with recordings stored in /srv/recordings and live streaming should work as expected as well.

Leave a Reply