Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Set Up Jitsi Server

Jitsi is an open-source video conferencing software that is an alternative to Microsoft Teams, and Zoom.

Steps

Execute the script below will install jitsi server.

#!/bin/bash

# Set hostname or IP address of your server. This is required
# for meetings to actually work
# You may wish to review/change this to a different path.
HOSTNAME=jitsi.programster.org

# Set config directory. This will be a docker volume.
# You may wish to review/change this to a different path.
CONFIG=$HOME/jitsi-volumes/jitsi-meet-cfg


#####  END OF SETTINGS - DO NOT TOUCH BELOW THIS  #####


# Download and "install" jitsi-meet
wget https://github.com/jitsi/docker-jitsi-meet/archive/stable-5390-3.tar.gz
tar --extract --gzip --file stable-5390-3.tar.gz
rm stable-5390-3.tar.gz
mv -i docker-jitsi-meet-stable-* docker-jitsi-meet
cd docker-jitsi-meet

# Create environment file with random passwords
cp env.example .env
./gen-passwords.sh

# Update config inside .env file to use your specified CONFIG
FILEPATH=".env"
SEARCH="CONFIG=~/.jitsi-meet-cfg"
REPLACE="CONFIG=$CONFIG"
sed -i "s;$SEARCH;$REPLACE;" $FILEPATH

# pre-create the necessary folders within the jits-meet-cfg
mkdir -p $CONFIG/{web/letsencrypt,transcripts,prosody/config,prosody/prosody-plugins-custom,jicofo,jvb,jigasi,jibri}

# Change the ports back to web defaults
SEARCH="HTTP_PORT=8000"
REPLACE="HTTP_PORT=80"
sed -i "s;$SEARCH;$REPLACE;" $FILEPATH

SEARCH="HTTPS_PORT=8443"
REPLACE="HTTPS_PORT=443"
sed -i "s;$SEARCH;$REPLACE;" $FILEPATH


SEARCH="#PUBLIC_URL=https://meet.example.com:8443"
REPLACE="PUBLIC_URL=$HOSTNAME"
sed -i "s;$SEARCH;$REPLACE;" $FILEPATH

The script uses the latest release from the releases page at the time of writing this tutorial. It is a good idea to manually check if it is still the latest release before executing, and adjusting accordingly if not.

If Running On LAN

If you are intending to only run this on a local LAN, then you really need to uncomment and set the following in your .env file.

DOCKER_HOST_ADDRESS=192.168.x.x

Deploy!

Now that you have jitsi server set up, you just need to start it up by running:

docker-compose up

If you don't want to tie-up your terminal and see all the output, then use the -d parameter like so:

docker-compose up -d

Test

You should now be able to go to your server's hostname or IP address in your browser to see Jitsi.

Configuring SSL

It looks like Jitsi has lets encrypt set up, but if you are trying this at home on a server that is not accessible by the internet, you may need to manually add your own SSL certificates.

You can do this by replacing the certificate files within.

  • $CONFIG/jitsi-volumes/jitsi-meet-cfg/cert.key
  • $CONFIG/jitsi-volumes/jitsi-meet-cfg/cert.key

cert.key should be a certificate bundle. E.g. your site certificate and any chain/certificate-authority or "ca" files. The value of $CONFIG is within your .env file

Debugging

If you open the console and see lots of error messages about being unable to connect websockets, then chances are that your running on a local LAN, and need to uncomment and set the DOCKER_HOST_ADDRESS variable in the env file. Alternatively, you can disable XMPP, by adding the following line to your .env file, but it does noticeably hamper the performance/quality of the calls.

XMPP_WEBSOCKET=0

Review

I was pleased that:

  • It was simple to set up.
  • Their default docker-compose was using versioned tags for the images (e.g. not :latest)
  • There are lots of self-explanatory settings in the .env file to turn things on/off.

However I am disappointed that:

  • I initially had to disable XMPP (websockets) for it to work at all.
  • Even though I was testing on my local LAN with two users, one on wifi, I managed to build up a several-second lag on a call somehow (XMPP disabled)
  • Enabling end-to-end-encryption causes terrible audio quality, and for the video to go fuzzy. It's pretty much unusable (both with and without XMPP)
  • It appears to not work in Firefox with some security issue to do with "fingerprinting". You have to get the user to change their about:config settings.
  • Even in chrome, with all the changes above, I still see plenty of error messages fly past in the console. (without XMPP)
  • Even with all the tweaking, I still not get it into what I would consider a good, stable and fast condition (without XMPP)
  • Only after figuring out that I had to uncomment the DOCKER_HOST_ADDRESS and set it to get XMPP working was I finally able to get to a point that the performance was suitable enough to consider using in production.

I get the feeling that I will forever be tweaking the .env file and I really wish I could just configure these settings through the web UI.

References

Last updated: 6th March 2021
First published: 6th March 2021

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch