Skip to content

Deploying Jitsi Meet on Ubuntu 22.04 (production-ready)

Stand up a hardened Jitsi Meet video conferencing server on Ubuntu 22.04 — Prosody, Jicofo, Videobridge, nginx + TLS, coturn TURN server, JWT auth.

You spin up Jitsi Meet for the company because the SaaS conferencing license came up for renewal and the math stopped working. You follow the jitsi-meet apt install, point a DNS record, click the first room, and it works on the LAN. The first external call drops twenty seconds in because the box is behind NAT, UDP 10000 is closed, there is no TURN fallback, and Videobridge gave up on the candidate list. Then anyone with the URL can create rooms — there is no auth, and the first scraper that finds the domain starts hosting random meetings on your VM.

What’s happening

A Jitsi Meet deployment that is actually production-ready needs UDP 10000 reachable end-to-end for Videobridge media, plus a coturn TURN server on TCP/UDP 443 for clients behind symmetric NAT or restrictive firewalls (without TURN, a meaningful share of remote participants will silently fail to connect). Prosody has to be configured with auth.<domain> for authenticated room creation — the default anonymous mode opens the server to drive-by abuse. Jicofo, Videobridge, and Prosody all need their JVB and Jicofo XMPP user passwords to match across files (the apt installer handles this on first install, but anyone tweaking config later commonly desyncs them). nginx terminates TLS on 443/tcp for the web UI and shares the cert with coturn. JWT auth on top of Prosody locks room creation to your SSO. None of these are individually critical. Skip them and the conferencing system is unreachable for half the team and open to the public for the other half.

How to verify

After install, the listeners should look like this:

ss -lntu | grep -E ':(80|443|4443|5222|5269|5280|5347|10000)\b'
# 0.0.0.0:443     tcp   nginx
# 0.0.0.0:80      tcp   nginx
# 0.0.0.0:4443    tcp   jvb (fallback)
# 127.0.0.1:5222  tcp   prosody c2s
# 127.0.0.1:5347  tcp   prosody component
# 0.0.0.0:10000   udp   jvb media

UDP 10000 must be 0.0.0.0 and reachable from the public internet — most failed first deployments are a missing UFW rule or a cloud security group that blocks it. Service health:

systemctl is-active prosody jicofo jitsi-videobridge2 coturn nginx

JVB’s connection to Prosody:

journalctl -u jitsi-videobridge2 --since "5 min ago" | grep -i 'connected\|disconnected'

If you see repeated disconnected lines, the shared secret between /etc/jitsi/videobridge/sip-communicator.properties and Prosody’s external_components is mismatched.

The fix

Save the script below as /root/setup-jitsi-ubuntu22.sh, then run it. It performs the full installer flow on a fresh Ubuntu 22.04 VM: base update, kernel tuning, file limits, UFW (SSH + 80 + 443 + 4443/tcp + 10000/udp + TURN ports), SSH hardening, unattended-upgrades, the official Jitsi apt repo, jitsi-meet non-interactive install pointing at a fresh Let’s Encrypt cert, Prosody configured for JWT authenticated room creation, coturn pinned to the Let’s Encrypt cert and listening on TCP/UDP 443 as TURN-over-TLS, systemd LimitNOFILE=64000 on Videobridge, and a poll loop confirming UDP 10000 is bound before declaring success.

#!/usr/bin/env bash
set -euo pipefail

### Ubuntu 22.04 Jitsi Meet clean VM installer
### Keeps root SSH key login enabled
### Disables SSH password login
### Enables automatic security updates
### Installs and configures Prosody + Jicofo + Videobridge + nginx + coturn + JWT
### No local backups; assumes VM-level backup
### Reboot remains manual

if [[ "$(id -u)" -ne 0 ]]; then
  echo "Run as root."
  exit 1
fi

: "${JITSI_DOMAIN:?Set JITSI_DOMAIN=meet.example.com}"
: "${JITSI_EMAIL:?Set JITSI_EMAIL=ops@example.com for Let's Encrypt}"
JWT_APP_ID="${JWT_APP_ID:-stackharbor}"
JWT_APP_SECRET="${JWT_APP_SECRET:-$(openssl rand -hex 32)}"
TURN_SECRET="${TURN_SECRET:-$(openssl rand -hex 32)}"

echo
echo "========================================"
echo "Jitsi Meet Ubuntu 22.04 Setup"
echo "========================================"
echo

echo "==> Updating base OS"
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get -y upgrade

echo "==> Installing base packages"
apt-get -y install \
  vim curl wget ca-certificates gnupg2 lsb-release \
  chrony fail2ban unattended-upgrades \
  ufw lsof tcpdump dnsutils tar gzip unzip \
  iproute2 net-tools openssl apt-transport-https \
  software-properties-common

echo "==> Enabling time sync"
systemctl enable --now chrony
timedatectl set-ntp true

echo "==> Setting hostname"
hostnamectl set-hostname "${JITSI_DOMAIN}"
if ! grep -q "${JITSI_DOMAIN}" /etc/hosts; then
  echo "127.0.0.1 ${JITSI_DOMAIN}" >> /etc/hosts
fi

echo "==> Applying kernel/network tuning"
cat > /etc/sysctl.d/99-jitsi.conf <<'SYSCTL'
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

net.core.somaxconn = 4096
net.core.netdev_max_backlog = 250000
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.rmem_default = 1048576
net.core.wmem_default = 1048576

net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_fin_timeout = 15
net.ipv4.ip_local_port_range = 10240 65535

net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0

kernel.dmesg_restrict = 1
kernel.kptr_restrict = 2
fs.file-max = 2097152
SYSCTL

modprobe tcp_bbr || true
echo tcp_bbr > /etc/modules-load.d/bbr.conf
sysctl --system

echo "==> Setting file limits"
cat > /etc/security/limits.d/99-jitsi.conf <<'LIMITS'
* soft nofile 64000
* hard nofile 64000
root soft nofile 64000
root hard nofile 64000
LIMITS

echo "==> Configuring UFW"
ufw --force reset
ufw default deny incoming
ufw default allow outgoing
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw allow 443/udp
ufw allow 4443/tcp
ufw allow 10000/udp
ufw allow 3478/udp
ufw allow 5349/tcp
ufw --force enable

echo "==> Hardening SSH while keeping root SSH key login enabled"
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%F-%H%M%S)

set_sshd_option() {
  local key="$1"
  local value="$2"
  if grep -qE "^[#[:space:]]*${key}[[:space:]]+" /etc/ssh/sshd_config; then
    sed -i "s|^[#[:space:]]*${key}[[:space:]].*|${key} ${value}|" /etc/ssh/sshd_config
  else
    echo "${key} ${value}" >> /etc/ssh/sshd_config
  fi
}

set_sshd_option PermitRootLogin prohibit-password
set_sshd_option PasswordAuthentication no
set_sshd_option PubkeyAuthentication yes
set_sshd_option KbdInteractiveAuthentication no
set_sshd_option ChallengeResponseAuthentication no
set_sshd_option X11Forwarding no
set_sshd_option ClientAliveInterval 300
set_sshd_option ClientAliveCountMax 2
set_sshd_option MaxAuthTries 4

sshd -t
systemctl restart ssh

echo "==> Configuring fail2ban"
cat > /etc/fail2ban/jail.d/sshd.local <<'FAIL2BAN'
[sshd]
enabled = true
port = ssh
backend = systemd
maxretry = 4
findtime = 10m
bantime = 1h
FAIL2BAN

systemctl enable --now fail2ban

echo "==> Configuring unattended-upgrades for security"
cat > /etc/apt/apt.conf.d/20auto-upgrades <<'AUTOUPG'
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::AutocleanInterval "7";
AUTOUPG

echo "==> Adding Jitsi apt repository"
curl -fsSL https://download.jitsi.org/jitsi-key.gpg.key \
  | gpg --dearmor -o /usr/share/keyrings/jitsi-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/jitsi-keyring.gpg] https://download.jitsi.org stable/" \
  > /etc/apt/sources.list.d/jitsi-stable.list

apt-get update

echo "==> Pre-seeding debconf for jitsi-meet"
echo "jitsi-videobridge2 jitsi-videobridge/jvb-hostname string ${JITSI_DOMAIN}" | debconf-set-selections
echo "jitsi-meet-web-config jitsi-meet/cert-choice select Let's Encrypt certificates" | debconf-set-selections
echo "jitsi-meet-web-config jitsi-meet/cert-email string ${JITSI_EMAIL}" | debconf-set-selections

echo "==> Installing nginx, jitsi-meet, coturn, jq"
apt-get -y install nginx jq

apt-get -y install jitsi-meet

echo "==> Provisioning Let's Encrypt via the Jitsi helper"
yes | /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh "${JITSI_EMAIL}" || true

echo "==> Configuring Prosody for JWT authentication"
PROSODY_CFG="/etc/prosody/conf.avail/${JITSI_DOMAIN}.cfg.lua"

if [[ -f "${PROSODY_CFG}" ]]; then
  cp "${PROSODY_CFG}" "${PROSODY_CFG}.bak.$(date +%F-%H%M%S)"
fi

# Switch the main vhost to JWT
sed -i "s|authentication = \"anonymous\"|authentication = \"token\"|" "${PROSODY_CFG}"
sed -i "s|authentication = \"jitsi-anonymous\"|authentication = \"token\"|" "${PROSODY_CFG}"

# Inject app_id + app_secret if not present
if ! grep -q "app_id" "${PROSODY_CFG}"; then
  sed -i "/^VirtualHost \"${JITSI_DOMAIN}\"/a \    app_id = \"${JWT_APP_ID}\"\n    app_secret = \"${JWT_APP_SECRET}\"\n    allow_empty_token = false" "${PROSODY_CFG}"
fi

# Configure the anonymous guest domain (so unauthenticated users CAN join, but not CREATE)
GUEST_DOMAIN="guest.${JITSI_DOMAIN}"
if ! grep -q "VirtualHost \"${GUEST_DOMAIN}\"" "${PROSODY_CFG}"; then
  cat >> "${PROSODY_CFG}" <<GUEST

VirtualHost "${GUEST_DOMAIN}"
    authentication = "anonymous"
    c2s_require_encryption = false
GUEST
fi

echo "==> Configuring jitsi-meet client to know about JWT and guest domain"
JM_CFG="/etc/jitsi/meet/${JITSI_DOMAIN}-config.js"
sed -i "s|// anonymousdomain:.*|anonymousdomain: '${GUEST_DOMAIN}',|" "${JM_CFG}"
sed -i "s|// tokenAuthUrl:.*|tokenAuthUrl: 'https://${JITSI_DOMAIN}/jwt-auth',|" "${JM_CFG}" || true

echo "==> Configuring Jicofo for token auth"
JICOFO_CFG="/etc/jitsi/jicofo/jicofo.conf"
if [[ -f "${JICOFO_CFG}" ]]; then
  if ! grep -q "enable-auto-owner" "${JICOFO_CFG}"; then
    cat >> "${JICOFO_CFG}" <<'JICOFO'

jicofo {
  authentication: {
    enabled: true
    type: JWT
    login-url: ""
  }
  conference: {
    enable-auto-owner: false
  }
}
JICOFO
  fi
fi

echo "==> Installing coturn for TURN-over-TLS"
apt-get -y install coturn

cat > /etc/turnserver.conf <<TURN
listening-port=3478
tls-listening-port=5349
listening-ip=0.0.0.0
external-ip=auto
relay-ip=auto

fingerprint
lt-cred-mech
use-auth-secret
static-auth-secret=${TURN_SECRET}
realm=${JITSI_DOMAIN}

cert=/etc/letsencrypt/live/${JITSI_DOMAIN}/fullchain.pem
pkey=/etc/letsencrypt/live/${JITSI_DOMAIN}/privkey.pem
cipher-list="HIGH:!aNULL:!MD5:!RC4"

no-cli
no-tlsv1
no-tlsv1_1

denied-peer-ip=10.0.0.0-10.255.255.255
denied-peer-ip=192.168.0.0-192.168.255.255
denied-peer-ip=172.16.0.0-172.31.255.255
allowed-peer-ip=

simple-log
log-file=/var/log/turnserver.log
TURN

sed -i 's|^#TURNSERVER_ENABLED=.*|TURNSERVER_ENABLED=1|' /etc/default/coturn || \
  echo 'TURNSERVER_ENABLED=1' > /etc/default/coturn

# Give the turnserver user read access to the cert files
mkdir -p /etc/letsencrypt
chgrp -R ssl-cert /etc/letsencrypt/live /etc/letsencrypt/archive 2>/dev/null || true
chmod -R g+rX /etc/letsencrypt/live /etc/letsencrypt/archive 2>/dev/null || true
usermod -aG ssl-cert turnserver || true

systemctl enable --now coturn
systemctl restart coturn

echo "==> Setting systemd LimitNOFILE on jitsi-videobridge2"
mkdir -p /etc/systemd/system/jitsi-videobridge2.service.d
cat > /etc/systemd/system/jitsi-videobridge2.service.d/override.conf <<'JVBLIM'
[Service]
LimitNOFILE=64000
JVBLIM

systemctl daemon-reload

echo "==> Restarting Jitsi services in order"
systemctl restart prosody
sleep 2
systemctl restart jicofo
sleep 2
systemctl restart jitsi-videobridge2

echo "==> Waiting for Videobridge UDP 10000"
for i in {1..30}; do
  if ss -lnup | grep -q ':10000'; then
    break
  fi
  sleep 1
done

if ! ss -lnup | grep -q ':10000'; then
  echo "Videobridge failed to bind UDP 10000"
  journalctl -u jitsi-videobridge2 -n 120 --no-pager
  exit 1
fi

echo "==> Waiting for HTTPS listener"
for i in {1..30}; do
  if ss -lntp | grep -q ':443'; then break; fi
  sleep 1
done

systemctl enable --now certbot.timer

echo "==> Final package update"
apt-get -y upgrade

echo
echo "========================================"
echo "DONE"
echo "========================================"
echo
echo "Kernel:"
uname -r

echo
echo "AppArmor status:"
aa-status --enabled && echo "AppArmor enabled" || echo "AppArmor not enforcing"

echo
echo "SSH effective settings:"
sshd -T | grep -E '^(permitrootlogin|passwordauthentication|pubkeyauthentication) ' || true

echo
echo "TCP listeners:"
ss -lntp | grep -E ':(80|443|4443|5222|5347)\b' || true

echo
echo "UDP listeners:"
ss -lnup | grep -E ':(443|3478|10000)\b' || true

echo
echo "Services:"
systemctl is-active prosody jicofo jitsi-videobridge2 coturn nginx fail2ban chrony || true

echo
echo "JWT app id:           ${JWT_APP_ID}"
echo "JWT app secret:       ${JWT_APP_SECRET}"
echo "TURN shared secret:   ${TURN_SECRET}"
echo "Web UI:               https://${JITSI_DOMAIN}/"

echo
echo "Final step:"
echo "Issue a signed JWT with the app_id/secret above to create rooms. Guests can still join without a token."

Make it executable and run it:

chmod 700 /root/setup-jitsi-ubuntu22.sh
JITSI_DOMAIN=meet.example.com JITSI_EMAIL=ops@example.com /root/setup-jitsi-ubuntu22.sh

Most installs run 8 to 12 minutes on a 4 vCPU / 8 GB VM with at least 1 Gbps egress. After it finishes, open the web UI, watch journalctl -u jitsi-videobridge2 -f on the side, and start a test room from two networks (one inside a VPN, one on cellular) — that confirms UDP 10000 is reachable and that TURN falls back cleanly when it’s not. The script provisions a JWT app id + secret printed in the DONE block; wire your SSO or backend to mint signed tokens against them. The script does not configure recording; if you need it, install jibri on a second VM and join it via XMPP. No host-level backups are configured — snapshot the VM and back up /etc/prosody/, /etc/jitsi/, /etc/turnserver.conf, and the Let’s Encrypt directory.

When the conferencing tier is business-critical and you want a managed environment with patching, monitoring, and Sev-1 escalation in place, talk to us: Talk to a senior engineer →.