Hướng dẫn triển khai Jitsi Meet (chuyên sâu) trên Ubuntu 20.04 / 24.04 Chuyên mục Devops 2025-06-12 0 Lượt xem 0 Lượt thích 0 Bình luận
Mục tiêu: cài Jitsi Meet production-ready, domain + HTTPS, websocket & bosh hoạt động, UDP media (10000) sẵn sàng, dễ custom giao diện, biết cách debug lỗi phổ biến.
1. Chuẩn bị máy chủ (recommendations)
-
OS: Ubuntu 20.04 LTS hoặc 24.04 LTS.
-
Tài nguyên tối thiểu cho small team: 2 vCPU + 4GB RAM. Khuyến nghị production: 4 vCPU + 8GB+.
-
Public IP cố định: dùng Elastic IP (AWS) hoặc static IP — tránh IP thay đổi.
-
Domain (ví dụ
meet.example.com) trỏ A → public IP của server. -
Mở port trên cloud firewall / SG:
TCP 22,80,443,5280,5281,5347,5222vàUDP 10000.-
Client → nginx HTTPS 443
-
nginx → prosody BOSH (5280) & websocket (5281)
-
JVB media → UDP 10000
-
Jicofo ↔ JVB internal uses 5347 etc.
-
2. Cập nhật hệ thống & cài gói cơ bản
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget gnupg2 apt-transport-https ca-certificates ufw
Thiết hostname:
sudo hostnamectl set-hostname meet.example.com
sudo bash -c 'cat > /etc/hosts <<EOF
127.0.0.1 localhost
<YOUR_PUBLIC_IP> meet.example.com
EOF'
(Thay <YOUR_PUBLIC_IP>).
3. Mở firewall (UFW) — Thận trọng nếu SSH đang active
Nếu dùng UFW trên server:
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 10000/udp
sudo ufw status
Nếu chạy trên cloud provider (AWS/GCP), quản lý port ưu tiên ở Security Group/Firewall cloud — UFW là lớp bổ sung.
4. Thêm repo Jitsi & cài Jitsi Meet
curl https://download.jitsi.org/jitsi-key.gpg.key | sudo gpg --dearmor -o /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
sudo apt update
sudo apt install -y jitsi-meet
Trong quá trình cài đặt apt sẽ hỏi Hostname — nhập meet.example.com.
Khi hỏi SSL, bạn có thể chọn self-signed tạm thời rồi cài Let’s Encrypt sau.
5. Cấp SSL Let's Encrypt (nếu domain đã trỏ về IP)
Jitsi cung cấp script:
sudo /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh
Script sẽ dùng Certbot để issue cert. Đảm bảo port 80 mở và DNS trỏ đúng.
Kiểm tra cert:
sudo openssl x509 -in /etc/jitsi/meet/meet.example.com.crt -noout -subject -dates
6. Kiểm tra service cơ bản
sudo systemctl status prosody
sudo systemctl status jicofo
sudo systemctl status jitsi-videobridge2
sudo systemctl status nginx
Nếu cần restart:
sudo systemctl restart prosody jicofo jitsi-videobridge2 nginx
Lưu ý: các process Java (Jicofo/JVB) có thể cần nhiều mem; cấu hình Xmx trong
/etc/jitsi/jicofovà/etc/jitsi/videobridgenếu cần.
7. Nginx reverse-proxy essentials (websocket & bosh)
Nginx config (auto setup by package) nhưng cần đảm bảo có block sau trong HTTPS server:
# inside server { listen 443 ssl; server_name meet.example.com; ... }
# BOSH (http-bind)
location /http-bind {
proxy_pass http://127.0.0.1:5280/http-bind;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
}
# XMPP WebSocket
location = /xmpp-websocket {
proxy_pass http://127.0.0.1:5281/xmpp-websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
tcp_nodelay on;
}
Test websocket:
curl -vk https://meet.example.com/xmpp-websocket
# expected: 400 Bad Request or similar (means endpoint reachable)
curl -vk https://meet.example.com/http-bind
# expected: 404 or something (reachable)
8. Prosody (XMPP) — điểm cần quan tâm
-
Config site:
/etc/prosody/conf.avail/meet.example.com.cfg.lua -
Modules: phải enable
"websocket"; "smacks";trongmodules_enabled. -
Đảm bảo BOSH/websocket secure flags:
consider_websocket_secure = true;
consider_bosh_secure = true;
cross_domain_websocket = true;
-
Nếu thay domain hoặc IP, kiểm tra file và certificate paths.
Restart prosody nếu chỉnh:
sudo systemctl restart prosody
9. Jicofo & JVB — kiểm tra kết nối
-
Xem logs:
sudo journalctl -u jicofo -n 200
sudo journalctl -u jitsi-videobridge2 -n 200
-
Jicofo phải register JVB(s) — log sẽ báo
Registered new bridgehoặcNo BUNDLEetc. -
JVB cần UDP 10000 reachable; test UDP path bằng công cụ (phải test từ client) — nếu NAT, cần cấu hình ice4j NAT harvester.
JVB config file: /etc/jitsi/videobridge/sip-communicator.properties
-
Nếu server có public IP và NAT, set:
org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS=10.0.x.x org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS=<public-ip>
10. Custom giao diện — file & bước thực hiện
Vị trí file giao diện: /usr/share/jitsi-meet/
10.1 Thay logo & favicon
-
Watermark (welcome page / header):
/usr/share/jitsi-meet/images/watermark.svg(hoặc .png) -
Favicon:
/usr/share/jitsi-meet/images/favicon.ico
Backup file gốc trước:
sudo cp /usr/share/jitsi-meet/images/watermark.svg /usr/share/jitsi-meet/images/watermark.svg.bak
sudo cp /path/to/new/logo.svg /usr/share/jitsi-meet/images/watermark.svg
sudo systemctl restart nginx
10.2 Thay background welcome page
-
Welcome background:
/usr/share/jitsi-meet/images/welcome-background.pngsudo cp /path/to/bg.png /usr/share/jitsi-meet/images/welcome-background.png sudo systemctl restart nginx -
10.3 Thay background trong cuộc gọi & custom CSS (recommended approach)
-
Tạo file CSS tùy chỉnh:
/usr/share/jitsi-meet/css/custom.css
Ví dụ:
#largeVideoContainer {
background: #10181c url('../images/custom-call-bg.jpg') no-repeat center center / cover !important;
}
#videoconference_page::after {
content: '';
position: absolute;
bottom: 10px;
left: 10px;
width: 120px;
height: 40px;
background: url('../images/custom-logo.png') no-repeat center center;
background-size: contain;
opacity: 0.9;
pointer-events: none;
}
-
Copy ảnh vào
/usr/share/jitsi-meet/images/ -
Include CSS: edit
/usr/share/jitsi-meet/index.html, trước</head>thêm:
<link rel="stylesheet" href="css/custom.css">
-
Restart nginx and clear browser cache.
Important: nếu dùng apt updates,
/usr/share/jitsi-meet/có thể bị overwrite — best practice: keep your custom files in separate folder and configure Nginx to serve your branding assets (or maintain a custom build).
11. Cấu hình feature flags (prejoin, lobby, disable chat, toolbar)
Có hai nơi thường thay:
-
/usr/share/jitsi-meet/interface_config.js— giao diện, watermark, buttons list (client-side) -
/etc/jitsi/meet/meet.example.com-config.js— server-side client config (config.js)
Ví dụ bật prejoin:
Trong config.js (file tại /etc/jitsi/meet/meet.example.com-config.js), thêm:
prejoinConfig: {
enabled: true,
hideDisplayName: false,
showDeviceSelection: true
},
Ẩn watermark & powered by:
Trong interface_config.js:
SHOW_JITSI_WATERMARK = false;
SHOW_BRAND_WATERMARK = false;
SHOW_POWERED_BY = false;
Tùy chỉnh toolbar:
Trong interface_config.js (hoặc config.js toolbarConfig):
TOOLBAR_BUTTONS = [
'microphone','camera','desktop','chat','closedcaptions','hangup'
];
Bật lobby / enable lobby
Lobby thường require Prosody module mod_lobby and Jicofo config. Jitsi apt may include. To enable, follow Jitsi docs — enable lobby in prosody config and toggle in config.js/jicofo properties.
12. Xác thực (internal auth) — hạn chế tạo phòng
-
Sửa
prosodysite config/etc/prosody/conf.avail/meet.example.com.cfg.lua:
authentication = "internal_plain"
-
Tạo user admin:
sudo prosodyctl register admin meet.example.com strongpassword
-
Cấu hình
jicofođể chỉ admin có thể start conference? (Jicofo sẽ use authenticated users; check prosody/jicofo docs) -
Để cho guest vẫn join: Jitsi supports guest by enabling anonymous component; typical flow: set virtualhost and component for internal auth; see Jitsi multi-host setup docs for exact layout.
13. Debugging / Troubleshooting (common errors)
A. “Connection error — device may be offline”
-
Nguyên nhân: websocket/BOSH unreachable (Nginx misconfigured), prosody down, certificate mismatch, or DNS/IP mismtach.
-
Kiểm tra:
-
curl -vk https://meet.example.com/xmpp-websocket→ expect 400/404 not hang. -
sudo tail -f /var/log/prosody/prosody.log -
sudo tail -f /var/log/nginx/error.log -
sudo ss -tlnp | grep 5281(prosody websocket) -
sudo ss -tlnp | grep 443(nginx)
-
B. Websocket hangs on TLS handshake
-
Cause: Nginx using wrong certificate file or permissions; ensure cert and key paths are correct and readable by nginx.
-
Check:
sudo openssl s_client -connect meet.example.com:443 -servername meet.example.com
C. JVB no media (black screen, no audio)
-
Check UDP 10000 is open inbound/outbound both on server firewall and cloud SG.
-
Check
/var/log/jitsi/jvb.logfor ICE failures. -
For NAT: set NAT harvester properties in
sip-communicator.propertiesas described earlier.
D. After reboot IP changed → DNS mismatch
-
Use Elastic IP or automate DNS update. Always use domain (not raw IP) in config files to avoid manual edits.
14. Performance & hardening tips
-
Java heap: set Xmx for JVB & Jicofo appropriately in system config (
/etc/jitsi/jicofo/sip-communicator.properties,/etc/jitsi/videobridge/jvb.confor env var JVB_OPTS). -
Run monitoring (Prometheus exporter for JVB available).
-
Use swap if RAM limited, but prefer more RAM.
-
Limit public exposure: use cloud SG + UFW. Consider enabling
ufw logging on. -
Regularly renew Let's Encrypt (cron included in certbot). Check
/var/log/letsencrypt.
15. Backup & update strategy
-
Backup
/etc/jitsi/,/etc/prosody/,/usr/share/jitsi-meet/(if you customized). -
Before
apt upgrade, snapshot VM or backup files — custom files under/usr/share/jitsi-meet/may be overwritten. -
Consider building custom web bundle from source and serving it separately to persist customizations across package upgrades.
Appendix — Useful commands (cheat sheet)
# restart services
sudo systemctl restart prosody jicofo jitsi-videobridge2 nginx
# logs
sudo tail -f /var/log/prosody/prosody.log
sudo tail -f /var/log/jitsi/jicofo.log
sudo tail -f /var/log/jitsi/jvb.log
sudo tail -f /var/log/nginx/error.log
# test websocket
curl -vk https://meet.example.com/xmpp-websocket
# check ports
sudo ss -tlnp | egrep '443|5281|5280|10000'
# check certificate
sudo openssl x509 -in /etc/jitsi/meet/meet.example.com.crt -noout -subject -dates
Kết luận
Bài trên là một playbook đủ sâu cho team DevOps triển khai Jitsi Meet production: cài đặt, SSL, Nginx websockets, Prosody/Jicofo/JVB, cách custom giao diện, bật/tắt tính năng và debug lỗi phổ biến. Nếu bạn muốn mình cung cấp 1 file Nginx config hoàn chỉnh cho domain meet.example.com, hoặc 1 bộ script tự động (bash) để chạy toàn bộ bước cài đặt trên Ubuntu 24.04 (có prompts cho domain/email), mình sẽ viết sẵn cho bạn để copy–paste và chạy.
Bạn muốn tiếp theo:
-
Mình tạo Nginx config mẫu hoàn chỉnh?
-
Hay script cài đặt tự động cho Ubuntu 24.04 (với prompts)?
-
Hoặc mình viết phiên bản SEO-ready của bài này (H1, meta, FAQs, snippet) để đăng blog?
Bình luận (0)