オンライン学習・ビデオ会議システムBigBlueButton v3.0 on Docker

ダウンロード後、安定版として提供しているmainブランチ(バージョン3.0.4)へチェックアウト

$ git clone https://github.com/bigbluebutton/docker.git bbb-docker
$ cd bbb-docker
$ git checkout main 

以下のスクリプトを実行すると.envとdocker-compose.ymlファイルが作成されます。LetsencryptによるTLS認証は自身で設定するため"n"を選択。

$ ./scripts/setup
Should greenlight be included? (y/n): y
Should an automatic HTTPS Proxy be included? (y/n): n
Please enter the domain name: bbb.ficusonline.com
Should the recording feature be included?
   IMPORTANT: this is currently a big privacy issues, because it will 
   record everything which happens in the conference, even when the button
   suggests, that it does not.
   make sure that you always get people's consent, before they join a room!
   https://github.com/bigbluebutton/bigbluebutton/issues/9202
Choice (y/n): y
Should a Prometheus exporter be included? (y/n): n
Should old recordings be removed? (y/n): y
Please enter max age(days) for keeping recordings: 3
Is xx.xx.xx.xx your external IPv4 address? (y/n): y
Is xx:xx:xx:xx:xx:xx:xx:xx your external IPv6 address? (y/n): y

.envを確認・編集後、以下のスクリプトを実行し、docker-compose.ymlに反映させます。

$ ./scripts/generate-compose

ファイヤーウォール設定(ポート設定)

  • TCP/IP ports 80/443 (for HTTP/HTTPS)
  • UDP ports in the range 16384 - 32768 (for FreeSWITCH/HTML5 RTP streams)

コンテナNginxのネットワークをhostからdocker networkへ変更し、リバースプロキシにも対応。

docker-compose.yml

  nginx:
    build:
      context: mod/nginx
      additional_contexts:
        - src-learning-dashboard=./repos/bigbluebutton/bbb-learning-dashboard
        - src-playback=./repos/bbb-playback
        - src-html5=./repos/bigbluebutton/bigbluebutton-html5
      args:
        BBB_BUILD_TAG: v3.0.x-release--2025-02-06-143818
        TAG_BBB: v3.0.4
    image: alangecker/bbb-docker-nginx:v3.0.4-v5.3.1-1.25
    restart: unless-stopped
    ports:
            - '9443:443'
    volumes:
      - ./data/bigbluebutton:/var/bigbluebutton
      - ${DEFAULT_PRESENTATION:-/dev/null}:/www/default.pdf
      
      - ./mod/nginx/bigbluebutton/:/etc/nginx/conf.d/default.conf
      - ./mod/nginx/nginx.conf:/etc/nginx/nginx.conf

      # in advance, execute certbot on docker to get ssl certification.
      # "$ sudo docker run -it --rm --name certbot -v "$PWD/letsencrypt:/etc/letsencrypt" -p 80:80 certbot/certbot certonly --standalone -d www.example.com"
      
      # added 4096-bit diffie-hellman parameters. see https://docs.bigbluebutton.org/2.2/install.html#configure-freeswitch-for-using-ssl
      # need /etc/letsencrypt/dhp-4096.pem: "$ openssl dhparam -out letsencrypt/dhp-4096.pem 4096"
      
      # For FreeSwith Web Socket, need to implement the following files.
      # $ sudo cat cert.pem privkey.pem fullchain.pem > wss.pem
      # add symbolic links
      # "$ sudo ln -s wss.pem agent.pem"
      # "$ sudo ln -s wss.pem tls.pem"
      # "$ sudo ln -s wss.pem dtls-srtp.pem"
      - ./letsencrypt:/etc/letsencrypt
      
      # added for reverse-proxy config template file; see https://hub.docker.com/_/nginx
      # *.conf.template changed into /etc/nginx/conf.d/*.conf after variables transferred.
      - ./nginx_config_temp:/etc/nginx/templates
      
    tmpfs:
     - /tmp
#    network_mode: host
    networks:
      bbb-net:
        ipv4_address: 10.7.7.3
        ipv6_address: fd6c:dfc7:8a45:2::3
    extra_hosts:
      - "host.docker.internal:10.7.7.1"
      - "bbb-web:10.7.7.2"
      - "etherpad:10.7.7.4"
      - "webrtc-sfu:10.7.7.1"
      - "greenlight:10.7.7.21"
      - "bbb-graphql-server:10.7.7.31"
      - "bbb-graphql-middleware:10.7.7.32"

トラブルシュート

http2" directive is deprecated

nginx-1 | 2025/04/07 11:33:57 [warn] 1#1: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:3
nginx-1 | nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/default.conf:3
nginx-1 | 2025/04/07 11:33:57 [warn] 1#1: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/nginx.conf:40
nginx-1 | nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/nginx.conf:40

mod/nginx.conf, mod/bigbluebutton, reverse-proxy.conf.template

上記nginx設定ファイルのhttp2記述ルール変更

listen 443 ssl hhtp2;

以下訂正後

listen 443 ssl;
http2 on;

再ビルドする必要があるため、docker-compose.ymlファイルに修正したファイルを直接nginxコンテナに読み込みます。

docker-compose.yml

    volumes:
      
      - ./mod/nginx/bigbluebutton/:/etc/nginx/conf.d/default.conf
      - ./mod/nginx/nginx.conf:/etc/nginx/nginx.conf

bind() to 10.7.7.1:8185 failed

nginx-1  | 2025/04/07 11:33:57 [emerg] 1#1: bind() to 10.7.7.1:8185 failed (99: Address not available)
nginx-1  | nginx: [emerg] bind() to 10.7.7.1:8185 failed (99: Address not available)

注) インターネットからホストへのアクセスはポート443を利用、iptablesでポート8443へリダイレクトする設定としている。このためNginxの入口ポートは8443にする必要があり、Nginxのネットワークモードをhostからdockerネットワークへ変更。
以下の設定ファイルのlisten IPを、Nginxコンテナに割当てたdockerネットワークIP10.7.7.3に変更する必要があります。

mod/bigbluebutton

server {
    listen 10.7.7.3:8185;
    listen 127.0.0.1:8185;

同じ理由で以下ファイル内のIPを10.7.7.1から10.7.7.3へ変更。

docker-compose.yml

  bbb-graphql-middleware:

    extra_hosts:
      - "nginx:10.7.7.3"

mod/nginx/nginx.conf

    server {
        # additional server only used for greenlight in dev mode
        # allows it to use the BBB API without failing 
        # due to the self signed certificates
        # 
        # all other requests (e.g. /join) is then redirected
        listen 48083;
        http2 on;
        
        location /bigbluebutton/api/join {
            return 301 https://10.7.7.3$request_uri;
        }
        location /bigbluebutton/api {
            proxy_pass http://127.0.0.1:48087;
        }
        location / {
            return 301 https://10.7.7.3$request_uri;
        }
    }

}

以下はDEV_MODEを有効にした場合

mod/nginx/bbb-html5.dev.nginx

  proxy_pass http://10.7.7.3:3000/;

freeswitchのコンテナIP誤記:10.7.7.1 —> 10.7.7.10

mod/periodic/bbb-resync-freeswitch

docker exec -it bbb-freeswitch fs_cli -H 10.7.7.10 -P 8021 -x 'fsctl sync_clock_when_idle'

FreeSWITCH関連(Firewallエラー)

以下Firewall設定の再確認

ErrorDetected the following WebRTC issue Probable Cause
1002: Could not make a WebSocket connection Note 1
1007: ICE negotiation failed Note 2

デバイス接続エラー(マイク・ビデオエラー)

docker-compose.yml

webrtc-sfu:

    environment:
      ESL_PASSWORD: ${FSESL_PASSWORD:-ClueCon}
      #MS_WEBRTC_LISTEN_IPS: '[{"ip":"::", "announcedIp":"${EXTERNAL_IPv6}"}, {"ip":"${EXTERNAL_IPv4}", "announcedIp":"${EXTERNAL_IPv4}"}]'
      MS_WEBRTC_LISTEN_IPS: '[{"ip":"0.0.0.0", "announcedIp":"${EXTERNAL_IPv4}"}, {"ip":"${EXTERNAL_IPv6}"}]'

BigBlueButtonを起動

$ docker compose up -d

暫定管理者アカウントの作成

$ docker compose exec greenlight bundle exec rake admin:create
User account was created successfully!
  Name: Administrator
  Email: [email protected]
  Password: Administrator1!
  Role: Administrator

上記暫定管理者アカウント(メールアドレスとパスワード)でログイン

ログイン後、正規の管理者を作成しログアウト

正規の管理者でログイン(メールによるアクティベーション必須)

ログイン後、暫定管理者を削除、会議室を作成

マイク・ビデオ動作確認、画面共有、録画機能確認

画面共有・カメラ・マイク動作確認

録画リスト(再生の動作確認)

Androidでの確認(画面共有)

Collabora Online

LibreOfficeをブラウザ上で操作できるようにしたWebアプリ

Etherpad 単体では PDF 出力に対応していないため、Collabora Online をバックエンドとして使い、HTMLをPDFに変換しています。

Etherpad HTML出力

Collabora Online にリクエスト(/convert-to?pdf)

LibreOfficeエンジンでPDF生成

Etherpadがそれを受け取ってユーザーに返す

https://hub.docker.com/r/collabora/code


TLSに対応するため、Nginxのリバースプロキシ経由でcollaboraコンテナへアクセスするよう以下の関連ファイルを変更。

以下スクリプト内で、curlでhttpsを指定しているが、URLを正規のドメインへ変更、-k オプションを削除。

mod/bbb-web/office-convert.sh

timeout $(printf %03d $timeoutSecs)s curl -F "data=@${source}" https://test.ficusonline.com/cool/convert-to/$convertTo > "${dest}"

mod/etherpad/etherpad-export.sh

curl -v -F "data=@${src}" https://test.ficusonline.com/cool/convert-to/$convertTo > "${dest}"

collaboraに対応したlocationセクションを追加。

nginx_config_temp/reverse-proxy.conf.template

  # main websocket
  location ~ ^/cool/(.*)/ws$ {
      proxy_pass http://collabora:9980;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "Upgrade";
      proxy_set_header Host $host;
      proxy_read_timeout 36000s;
  }

  # download, presentation and image upload
  # we accept 'lool' to be backward compatible
  location ~ ^/(c|l)ool {
      proxy_pass http://collabora:9980;
      proxy_set_header Host $host;
  }

再ビルドして上記.shファイルの内容を反映させるか、直接docker-composeファイルで指定して上書き。

collaboraサービスに環境変数(extra_params=--o:ssl.enable=false --o:ssl.termination=true)追加

docker-compose.yml

  bbb-web:

      # overwrite script for collabora
      - ./mod/bbb-web/office-convert.sh:/usr/share/bbb-libreoffice-conversion/convert.sh

  etherpad:

    # added the below volume section for having modified script.
    volumes:
      - ./mod/etherpad/etherpad-export.sh:/etherpad-export.sh

  collabora:

    environment:
      - extra_params=--o:ssl.enable=false --o:ssl.termination=true

Nginx Proxy Settings

Docker Environment

カスタム設定

以下コンテナのポート変更やIPv6対応する際に書換え必要な設定ファイル。


Coturn

ポート設定

mod/coturn/turnserver.conf

listening-port=3478

# listening-ip=${INTERNAL_IP:-$IP}
# relay-ip=${INTERNAL_IP:-$IP}

min-port=32769
max-port=65535

.env

TURN_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

DOMAIN=test.ficusonline.com

# STUN SERVER
# stun.freeswitch.org
STUN_IP=xx.xx.xx.xx(public IPv4)
STUN_PORT=3478

mod/bbb-web/turn-stun-servers.xml

    <bean id="stun1" class="org.bigbluebutton.web.services.turn.StunServer">
        <constructor-arg index="0" value="{{ .Env.STUN_SERVER }}"/>
    </bean>

    <bean id="turn0" class="org.bigbluebutton.web.services.turn.TurnServer">
        <constructor-arg index="0" value="{{ .Env.TURN_SECRET }}"/>
        <constructor-arg index="1" value="turn:{{ .Env.DOMAIN }}:{{ .Env.STUN_PORT }}"/>
        <constructor-arg index="2" value="86400"/>
    </bean>

UDPポート範囲変更

FreeSWITCH uses the range 16384 - 24576, which is defined in

/opt/freeswitch/etc/freeswitch/autoload_configs/switch.conf.xml

<!-- RTP port range -->    
<param name="rtp-start-port" value="16384"/>    
<param name="rtp-end-port" value="24576"/>

bbb-webrtc-recorder uses the range 24577 - 32768

docker-compose.ymlを参照すると、以下のソースからファイルを抽出可能。

docker-compose.yml

src=./repos/bbb-webrtc-recorder

mod/bbb-webrtc-recorder/Dockerfile

COPY --from=builder /app/config/bbb-webrtc-recorder.yml /etc/bbb-webrtc-recorder/bbb-webrtc-recorder.yml

[...]
webrtc:
  rtcMinPort: 24577
  rtcMaxPort: 32768
[...]

mediasoup(webrtc-sfu) also uses 24577 - 32768 by default

mod/webrtc-sfu/Dockerfile

COPY config.yaml /etc/bigbluebutton/bbb-webrtc-sfu/production.yml

mod/webrtc-sfu/config.yaml

mediasoup:
  worker:
    rtcMinPort: 50000
    rtcMaxPort: 51999

Mediasoup(Web-SFU)のIPv6対応

Docker Composeファイルで環境変数 MS_WEBRTC_LISTEN_IPS で設定(mod/webrtc-sfu/config.yamlmediasoupセクション)を上書き。

docker-compose.yml

  webrtc-sfu:
      
    environment:
      ESL_PASSWORD: ${FSESL_PASSWORD:-ClueCon}
      
      # MS_WEBRTC_LISTEN_IPS: '[{"ip":"::", "announcedIp":"${EXTERNAL_IPv6}"}, {"ip":"${EXTERNAL_IPv4}", "announcedIp":"${EXTERNAL_IPv4}"}]'
      MS_WEBRTC_LISTEN_IPS: '[{"ip":"0.0.0.0", "announcedIp":"${EXTERNAL_IPv4}"}, {"ip":"${EXTERNAL_IPv6}"}]'


ロードバランサー