Setting up Jitsi-Meet on your server

Zarrar Shaikh
The Startup
Published in
7 min readJun 7, 2020

What a year, isn’t it? It’s been more or less 3–4 months that we all have been away from our offices (unless you work remotely); work from home has become the new normal. And in these challenging times, we have all resorted to video-conferencing to handle office meetings more than ever.

You all must have used a couple of video conferencing services already. Still, if you are reading this, then you are one of those who has come to the realization that you want to have your own setup for video-conferencing and Jitsi has come to your rescue. You could be an individual setting it up for personal use, or an organization looking for an interoffice installation or probably a service provider who wants to grab the opportunity and provide a video conferencing medium to a user base.

Shout out to the creators, maintainers, and the community of Jitsi to keep an amazing open-source project up and running. If you are someone who has just accidentally stumbled upon here, you have to check out Jitsi to know more about it, and if you feel like “Yes, this is it.”, then this blog is going to get your Jitsi server up and running in no time.

The following steps have been tested on AWS EC2 instance as well as on Azure VM, so it’s safe to say that it’ll work on others as well.

Prerequisites

  • Clean ubuntu 18.04 installed server (haven’t tested it on other versions).
  • Root access to the server you want to set it up on.
  • Open UDP and TCP ports in your firewall settings to allow traffic to your jitsi-meet server.
  • Patience

If you have an AWS EC2 instance, create a security group that looks like the image below and assign it to your instance before proceeding ahead.

If you are using a server from some other provider that provides a similar security group settings, make sure you match it with the above. In any case, you can also configure the ports to be open in your firewall using the below terminal commands.

sudo ufw allow sshsudo ufw allow httpsudo ufw allow httpssudo ufw allow 10000/udpsudo ufw enable

Step 1. Initial dependencies - Locales, Python and Nodejs

Make sure your server is a fresh one else there are chances of something conflicting with the process. SSH into your server as a root user.

ssh -i {path-to-your-ssh-key} user@server-ipsudo su

We will use /var/www/ as our working path.

sudo mkdir /var/www && cd /var/wwwsudo apt-get update && sudo apt-get upgrade

Once that’s done, let’s set up some initial dependencies as Node and Python installed onto the server.

Setting up locales

sudo apt-get -y install localessudo sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && locale-gensudo apt-get install -y language-pack-en-basesudo dpkg-reconfigure localesexport LANG=”en_US.UTF-8"export LANGUAGE=”en_US:en”export LC_ALL=”en_US.UTF-8"

Setting up Python 3.7

sudo add-apt-repository ppa:deadsnakes/ppasudo apt-get updatesudo apt-get install -y python3.7sudo apt-get install -y python3.7-devsudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2sudo apt-get install -y python3-pip

Check if python3 has been successfully switched to v3.7 by typing python3 in a terminal; proceed further once you have validated it.

Setting up Nodejs v10.x

Why 10.x? Because I find it the least worrisome when setting up node packages. But you’re free to install a version of your choice, and it should most likely work out just fine. If it doesn’t, you can always fallback to 10.x.

sudo apt-get remove -y python3-aptsudo apt-get install -y python3-aptcurl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -sudo apt-get install -y nodejs

Step 2. Jitsi dependencies - Lua, LuaRocks & Prosody

Now that you have completed the initial setup, we can move on to set up jitsi-meet based dependencies. You can skip this step and move on to the next, too, as mentioned in the official guide of Jitsi-Meet installation. Their quick setup is a one-liner that can set your server in no time.

However, you should follow the steps in this sequence only because soon you’d want to implement an authentication based flow in your setup; it could be jwt-token or secure-domain setup, and to set those up, you’ll need the following base configuration.

Setting up Lua and LuaRocks

sudo apt-get install -y lua5.2sudo apt-get install -y liblua5.2sudo apt-get install -y liblua5.2-devsudo apt-get install -y luarocksluarocks install basexxsudo apt-get install -y libssl1.0-devluarocks install luacrypto

Further, we also need to install some LuaRocks packages that require manual alteration, so hang in there and keep following the steps for a seamless functioning jitsi-meet server at the end.

mkdir srccd srcluarocks download lua-cjsonluarocks unpack lua-cjson-2.1.0.6-1.src.rockcd lua-cjson-2.1.0.6-1/lua-cjson/

Open lua_cjson.c file with vim or nano - vim lua_cjson.c

Edit line no. 743 and change it to read, len = lua_rawlen(l, -1);

Next, open Makefile with vim or nano - vim Makefile

Change to, LUA_INCLUDE_DIR = /usr/include/lua5.2 and save it.

Continuing the process,

luarocks makeluarocks install luajwtjitsiluarocks install inspect

Setting up Prosody

wget https://prosody.im/files/prosody-debian-packages.key -O- | sudo apt-key add -echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.listsudo apt-get update && sudo apt-get upgradesudo apt-get install -y prosody

Fixing permission on localhost key,

chown root:prosody /etc/prosody/certs/localhost.keychmod 644 /etc/prosody/certs/localhost.keyreboot

Wait for the instance to reboot. Your ssh connection might get terminated at this point. Simply ssh back into the server in root mode and navigate to the working path that we decided at the beginning of the process.

Step 3. Jitsi installation

Now that all dependencies have been taken care of, we can finally get on with installing jitsi-meet on our server.

Setting up the hostname for the server instance

sudo hostnamectl set-hostname {your domain name — “example.abc.xyz”}sudo vim /etc/hosts
Add the domain name below the localhost line

If you already have SSL key and crt files for your domain, you can move those files to a predefined location on the server which can then be used during the installation of jitsi-meet . If you don’t have the certificates yet, no need to worry, as jitsi-meet installation allows you to create them on the go.

Follow the steps to move your SSL files from local machine to server.

sudo mkdir /home/{your user}/ssl

Open a new tab in the terminal to access your local machine.

scp -i {path to your ssh key} {path to .key ssl file} user@server-ip:/home/{your user}/ssl/scp -i {path to your ssh key} {path to .crt ssl file} user@server-ip:/home/{your user}/ssl/

Setting up jitsi-meet

Switch back to the server tab at this point and carry on with the installation.

Follow the on-screen process. When asked for the domain name, provide the same name that you provided earlier. When asked for using existing or generating new SSL certificates, choose accordingly. If you’re using existing files that you moved onto the server, make sure you give the right file path when prompted for it.

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

If you opted to generate SSL certificate for your setup, just run the following in the terminal and follow the on-screen prompts to complete the setup.

/usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh

Bonus

What if you have your fork of the jitsi-meet repository, and you are keen on using it? No worries, it’s just a few steps to get your fork up and running.

SSH into the server and navigate to the working directory where you can clone your fork and build it up.

ssh -i {path to your ssh key} user@server-ip && sudo su && cd /var/wwwgit clone https://github.com/{your-github-username}/jitsi-meet.gitcd jitsi-meet && git fetch origingit checkout {your-branch-with-changed-code}npm installmake

That’s it, your version of code has been built. All you need now is to tell the server to look for the current jitsi-meet repo and the not the one that was installed by the package manager in /usr/share/jitsi-meet

vim /etc/nginx/sites-available/{your domain name config file}sudo systemctl restart nginx
Change /usr/share/jitsi-meet to /var/www/jitsi-meet throughout the file and save it.

That’s it, and you are done. I hope you have set your domain to point it to the server. Open your browser and browse to your domain to see if everything is working as intended.

What my setup looks like,

Landing page customizations
  • I have restricted room creation directly through my jitsi-meet domain.
  • Meetings can only be created from an in-app module. The restriction has been imposed by setting up jitsi-meet-tokens on our server that does a JWT validation and some source code customization to route room entry from internal system only.
Incall customizations
  • Meeting stats such as call start time, end time, total duration, no. of participants, etc. are all captured and sent to internal server to be recorded against the meeting id.
  • Enabled feedback popup to work without the existing dependency. Feedback score (mapped against meeting ID) is sent to the internal server along with the above stats.

I hope you were able to follow the steps without any hassle and got your server ready. If you’re looking for setting up jitsi-meet-tokens for JWT authentication, stay tuned, as my next blog will be about setting that up.

--

--