Skip to content

Instantly share code, notes, and snippets.

@krithin
Last active April 4, 2024 22:54
Show Gist options
  • Save krithin/e50a6001c8435e46cb85f5c6c78e2d66 to your computer and use it in GitHub Desktop.
Save krithin/e50a6001c8435e46cb85f5c6c78e2d66 to your computer and use it in GitHub Desktop.
Jitsi Meet Server and Videobridge Installation on Raspberry Pi 4 with Ubuntu Server 21.04

Jitsi Meet install on a Raspberry Pi 4 with Ubuntu Server 21.04

This guide helps you host your own Jitsi server on a Raspberry Pi 4B. It is adapted from Jitsi's quick install guide and the Jitsi on ARM guide written by crouchingtigerhiddenadam. The biggest difference is this is designed to work with a Pi running Ubuntu Server 21.04 instead of Raspbian.

I did this because I'd rather set up Jitsi Meet on a Raspberry Pi I already own than add a dedicated VPS (and pay AWS's bandwidth costs) just for that. I used Ubuntu 21.04 because I'm more familiar with Ubuntu than with Raspbian, and using an arm64 OS makes the setup easier than on armhf. I also tried to use distribution packages instead of manually downloading individual deb files throughout.

Prerequisites

This guide assumes you already have a DNS name set up with an A record pointing to the public IP address of your Raspberry Pi.

Get Ubuntu Server 21.04 for Raspberry Pi

You can get this from https://ubuntu.com/download/raspberry-pi - I used the 64-bit image for Raspberry Pi 4. The default username and password on that are both "ubuntu"; it will prompt you to set a new password on first login.

You'll want to set that up the same way you would any other distribution for a Pi, and set yourself up for SSH access if you don't have a conveniently-placed keyboard connected to your Pi. If you're not familiar with how to get started writing that disk image to a microSD card there's a tutorial you can follow at https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview for this step.

Install the Jitsi packages

Generally speaking this means you'll need to follow the instructions at https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-quickstart, but stop before the Let's Encrypt certificate step.

In slightly more detail:

Set up your Fully-Qualified Domain Name

I assume you already have an FQDN set up in DNS that you want to use for this Jitsi install - suppose that's jitsi.example.com. First, change the hostname on the machine to match that:

sudo hostnamectl set-hostname jitsi.example.com

Then use vim or your favorite editor to put the same FQDN in the /etc/hosts file, associating it with your public IP address. This means you'll edit the top of that file so it looks like:

127.0.0.1 localhost
x.x.x.x jitsi.example.com

Where x.x.x.x is your external IP address.

When this is done, test that you can ping your domain name with ping "$(hostname)". If it worked, you should see a response from your domain name.

Add the Jitsi package repository

curl https://download.jitsi.org/jitsi-key.gpg.key | sudo sh -c 'gpg --dearmor > /usr/share/keyrings/jitsi-keyring.gpg'
echo 'deb [signed-by=/usr/share/keyrings/jitsi-keyring.gpg] https://download.jitsi.org stable/' | sudo tee /etc/apt/sources.list.d/jitsi-stable.list > /dev/null

Open ports in your firewall

Open 80/TCP, 443/TCP and 10000/UDP on your firewall, making sure those ports are forwarded to your Pi if it's behind a NAT.

Install the Jitsi Meet packages

# Ensure support is available for apt repositories served via HTTPS
sudo apt install apt-transport-https

# Retrieve the latest package versions across all repositories
sudo apt update

# Perform jitsi-meet installation
sudo apt install jitsi-meet

The installer will ask you for the hostname of your Jitsi Meet instance; set that to the same FQDN you entered earlier. Then it'll ask about an SSL certificate; pick "Generate a new self-signed certificate". We'll set up a real SSL cert with Let's Encrypt in the next step.

Generate an SSL certificate with Let's Encrypt

First, install certbot from the Ubuntu repositories:

sudo apt install certbot

Then run the script to generate a Let's Encrypt certificate:

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

At this point you should see the landing page load correctly at https://jitsi.example.com! Yay! Unfortunately we're not done yet, because as you'll see it doesn't actually work if you try to connect multiple clients to a jitsi meeting; we'll fix that in the next step.

Install SCTP from source

This section is cribbed off jitsi-meet issue 6449.

Install build requirements

sudo apt install openjdk-8-jdk build-essential libtool maven

Stop services

sudo systemctl stop prosody jitsi-videobridge2 jicofo

Recompile jniwrapper-native-1.0-SNAPSHOT

git clone https://github.com/sctplab/usrsctp.git
git clone https://github.com/jitsi/jitsi-sctp
mv ./usrsctp ./jitsi-sctp/usrsctp/
cd ./jitsi-sctp
mvn package -DbuildSctp -DbuildNativeWrapper -DdeployNewJnilib -DskipTests

Copy libjnisctp.so

cp ./jniwrapper/native/target/libjnisctp-linux-aarch64.so \
 ./jniwrapper/native/src/main/resources/lib/linux/libjnisctp.so

Re-package and Copy jniwrapper-native-1.0-SNAPSHOT.jar into Jitsi VideoBridge2

When running mvn package ensure all unit tests are successful. You will see some warnings about "Using platform encoding", but that's fine because we're building on the platform that we intend to run this on anyway.

mvn package
sudo cp ./jniwrapper/native/target/jniwrapper-native-1.0-SNAPSHOT.jar \
 /usr/share/jitsi-videobridge/lib/jniwrapper-native-1.0-SNAPSHOT.jar

Restart the services

sudo systemctl start prosody jitsi-videobridge2 jicofo

Check if it worked!

systemctl status jitsi-videobridge2

Fire up your web browser, start a jitsi meeting, join it from another tab or another device, and check the jitsi logs at sudo less /var/log/jitsi/jvb.log if something is amiss.

@holger49
Copy link

You need a dns-server in the local network. Par example the pi hole. If the pi hole have receive the tables from the outside-dns-server, you can cut the connection and work inside the local network.
But, what is the reason for closing the connection?
The connection between the participants are encrypted with https. Also the us-american NSA cannot crack the connection. Only on the server are the data open. If you have the server under own control, it is save. It is probability only possible to crack the devices of the participants.

@kultex
Copy link

kultex commented Dec 29, 2020

I just give you countries, where we played - Senegal, Marokko, Tunesia, Afganistan, Pakistan, India, Belarus. In some theaters, I dont eaven have a connection with my phone - like in Senegal I had to walk 500m to get a connection with my phone. The theaters dont have internet. I am not afraid of NSA - I am just afraid of no possibility to connect to the internet.

@kultex
Copy link

kultex commented Jan 2, 2021

I just can tell success with the rock64 and without internet connection - you just have to stay on the "self-signed certificate", which is no problem, when you run it just with chromium and do not use the apps.
To compare with the pi, here the screenshot with 3 participiants and nmon (because I have no idea about grdesktop with xrdp

jitsi1

@ustspecht
Copy link

I followed the instructions on December 18th, 2020 and a running Jitsi server that works. It runs on a Pi 4 with 4 Gb, I have hosted conferences with 6 participants - everything is going very well. Thank you!! I wanted to update Ubuntu now and also included Jitsi. After that Jitsi runs in my network with camera and micro on the clients, but from the outside the camera and micro are off on the clients. The ICE test for the turn server works, port 10000 is open. If I follow the instructions on a new system, the result is the same. My Jitsi still has the blue background, the new Jitsi (which only works internally) has mountains. Does anyone know what has changed? My ports are all open, if I just update Ubuntu, my previous Jitsi will continue to work.
I would be happy to hear from you.

@JannikHaake
Copy link

@superfino have you found a solution for the "Error creating properties files for forking" error? I have the same problem :(

@Rooby69
Copy link

Rooby69 commented May 13, 2021

Hello I wanted to install Jitsi-meet on rapbian with nspawan 64bit debian on rapberry 4 with 8Gb but unfortunately I coul not install openjdk-8-jdk. Only openjdk-11-jdk is availiable. When using this I get a compile error since javah is not available anymore.
Anyone found a solution for that?
Found it in meantime:
sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main'
sudo apt-get update
sudo apt-get install openjdk-8-jdk

One important note when copying the new compiled jniwrapper-native-1.0-SNAPSHOT.jar
it is important to delete the old one on the target path. In my case Jitsi still crashes wehn a 3. person connects.
Maybe this could be added in the instructions above.

@andreicaba
Copy link

Hello I wanted to install Jitsi-meet on rapbian with nspawan 64bit debian on rapberry 4 with 8Gb but unfortunately I coul not install openjdk-8-jdk. Only openjdk-11-jdk is availiable. When using this I get a compile error since javah is not available anymore.
Anyone found a solution for that?
Found it in meantime:
sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main'
sudo apt-get update
sudo apt-get install openjdk-8-jdk

One important note when copying the new compiled jniwrapper-native-1.0-SNAPSHOT.jar
it is important to delete the old one on the target path. In my case Jitsi still crashes wehn a 3. person connects.
Maybe this could be added in the instructions above.

I don't know your exact setup - but in your case, I would use DietPi 32 bit for this (the DietPi distro uses really low resources) (and, of course, without the X server :) ). It has opengl - with either the kms or the fkms driver. If you enforce h264 as a must - it might work even better (haven't tried it yet :) ). Let's hope h264 works out of the box through the onboard h264 hardware video decoder/encoder :) ...

Please tell us the results with this, if you want to implement what I just said :)
succes!...

@fireindark707
Copy link

jitsi-sctp have been updated these days and the related code need to be fixed.

@verlane
Copy link

verlane commented Aug 27, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment