Skip to content

feat(docker): run BigBlueButton 4.0 with Docker Compose - #22894

Closed
tibroc wants to merge 26 commits into
bigbluebutton:v4.0.x-developfrom
tibroc:build-and-publish-docker-images
Closed

tibroc wants to merge 26 commits into
bigbluebutton:v4.0.x-developfrom
tibroc:build-and-publish-docker-images

Conversation

@tibroc

@tibroc tibroc commented Apr 8, 2025 •

Copy link
Copy Markdown
Collaborator

Docker Compose setup for BigBlueButton 4.0

What this is

This updates #22894 to BigBlueButton 4.0 and turns it into a complete container setup for a
single server: one static docker-compose.yml, images built from this repository that configure
themselves at start, a machine-readable configuration contract, tests and CI. LiveKit is the only
media server and shared notes run on the BlockNote server, as in 4.0.

The guiding rule is to stay close to the packages: each image renders upstream's own
configuration files at their bare-metal paths and changes only what containers need. Override
files are mounted at the same paths as on a package-based server, so the existing documentation
applies. The design and its reasons are in docs/docs/administration/docker-design.md;
installing, upgrading and backing up are in docs/docs/administration/docker.md.

The stack is working and open for review, including recording. Running behind an existing reverse
proxy comes in a follow-up change (see below).

How to try it

On a server with Docker Engine, the Compose plugin (2.24.4 or later) and Buildx, a DNS name
pointing to it and ports 80/tcp, 443/tcp, 7882/udp and 3478/udp+tcp open:

git fetch https://github.com/bigbluebutton/bigbluebutton.git pull/22894/head:docker-compose
git checkout docker-compose
docker buildx bake -f docker-bake.hcl $(printf -- '-f %s ' docker/bake/*.hcl) --load   # all images, tag 4.0.1
BBB_IMAGE_REGISTRY=localhost docker compose run --rm setup   # writes .env: secrets generated, domain, e-mail, address asked
echo 'BBB_IMAGE_REGISTRY=localhost' >> .env                  # run the images just built
docker compose up -d
docker compose ps -a                                         # all services healthy, db-init Exited (0)
docker/tests/smoke/api-smoke.sh --api-url https://<your domain>/bigbluebutton/api   # SMOKE PASS

The smoke test reads the shared secret from the environment only: read -rs BBB_SHARED_SECRET && export BBB_SHARED_SECRET first, and add --insecure until certbot has obtained the certificate.
Once the images are published to ghcr.io, docker compose pull replaces the bake step and the
two BBB_IMAGE_REGISTRY settings.

What is in it

Compose and configuration

  • docker-compose.yml: one committed file, never generated; optional parts as profiles selected
    by BBB_FEATURES (today webhooks). Every service has an explicit image tag (third-party
    images also a digest) and a read-only root filesystem; every long-running service has a
    healthcheck and a restart policy (db-init and setup are run-only).
  • docker/config-contract.yaml: every variable with tier, format, default, consumers and
    upstream sources. .env.sample and docs/docs/administration/docker-configuration.md are
    generated from it and checked in CI.
  • Three tiers: about a dozen essential values in .env, optional advanced values, and override
    files at bare-metal paths.
  • setup service: writes .env (generates secrets, asks for domain, e-mail, features and public
    address, keeps existing values), without network access.

Images

  • Pattern: <component>/Dockerfile with <component>/docker/ for components with a source
    directory, docker/<name>/ for the others; one bake file per image in docker/bake/.
  • Bases pinned by digest: node:24-slim, a shared Java 21 base on ubuntu:24.04, ubuntu:24.04
    for the document tools, official haproxy, nginx, postgres and coturn images.
  • One shared entrypoint helper (docker/lib/): validate, derive, render (envsubst), merge Tier 3
    (yq, the packaging's merge), exec; --render-only for tests. Missing or malformed variables stop
    the container with the variable's name, never its value.
  • Every image runs as non-root under any UID/GID, except setup (root, to give .env the
    directory's owner) and postgres (the official image's user); writers of /var/bigbluebutton
    share BBB_UID/BBB_GID.

Networking and TLS

  • haproxy on 443 terminates TLS and routes by ALPN / first byte to nginx or coturn (TURN over 443),
    as bbb-install.sh does; certbot obtains and renews the certificate, haproxy reloads it by
    itself.
  • LiveKit on the bridge network with one UDP port (7882); no port range, no host networking.
  • Only 80/tcp, 443/tcp, 7882/udp and 3478/udp+tcp are published.
  • Internal networks for shared notes and office conversion; nginx and haproxy follow recreated
    services through DNS.

Services

  • bbb-web, akka-apps, graphql-server, graphql-middleware, graphql-actions, html5 client, learning
    dashboard, shared notes (BlockNote), export-annotations, LiveKit, bbb-webrtc-sfu (LiveKit
    controller), coturn, redis, postgres, a db-init job (recreates the 4.0 databases on upgrades,
    as the packages do), optional bbb-webhooks.
  • Office documents are converted by Collabora Online (collabora/code), which bbb-web already
    supports (bbb-libreoffice/assets/convert-cool.sh), instead of a docker run per document.

Tests and CI

  • Golden-file tests of every image's rendered configuration, with an allowlist of the differences
    from a bare-metal reference and a reason for each.
  • Contract checks, compose assertions for every feature combination, hadolint, shellcheck, UID
    and directory-mode checks.
  • A stack test on Docker Engine that follows a browser's join path, including restart cycles.
  • Workflows docker-checks.yml (pull requests) and build-all-images.yml (multi-arch build and
    push to ghcr.io).

Docs

  • docs/docs/administration/docker.md (install, upgrade, backup, troubleshooting),
    docker-configuration.md (generated reference), docker-design.md (design for reviewers).

Recording

With BBB_FEATURES=recording (the default, as on bare metal): bbb-webrtc-recorder (upstream's
image v0.17.0 with a thin configuration layer), the record-and-playback image rebuilt on Ubuntu
24.04 running what the bare-metal units run (resque workers, rap-starter, caption inbox, daily
cleanup), and the presentation player (bbb-playback v5.4.8) as its own service behind the edge
nginx. Published recordings are served from the data volume. The earlier
bbb-remove-old-recordings example (it deleted published recordings) is removed: deleting
published recordings stays a manual decision, as on bare metal.

Development setup

compose.dev.yml on top of docker-compose.yml builds every image from the tree and adds the
common loops as on bare metal: the html5 dev server with hot reload, and rebuilds of bbb-web and
akka-apps from the mounted source (docker/README.md, "Development").

Not in it yet

  • Running behind an existing reverse proxy (without haproxy and certbot).
  • Greenlight, monitoring, a preflight check, phone dial-in.
  • Kubernetes manifests (the images and the contract are built for them, see the design page).

How it was tested

  • CI on this PR: docker-checks.yml runs the contract, golden, compose and lint jobs, then
    builds each image with BuildKit and checks it (golden cases with parity, UID, directory modes),
    then the stack test on those images. build-all-images.yml builds every image for its
    platforms.
  • Stack test (docker/tests/stack/) on Docker Engine: API create and join, the client and its
    bundle, the GraphQL WebSocket and join mutation, shared notes exported as PDF, the learning
    dashboard, presentation upload with PDF and Word conversion, LiveKit signaling, repeated after
    four restart and recreate cycles; plus the effective SFU and webhooks configuration, webhook
    callbacks, the conversion service's restrictions and the network isolation of the notes PDF
    converter. It can be run locally with docker/tests/stack/dind.sh on a host with only podman.
  • Recording end to end (docker/tests/stack/recording-e2e.sh, also in CI): headless Chromium
    joins through upstream's Playwright helpers with a fake microphone and webcam, the meeting is
    recorded, processed and published, and the test checks the recorder's raw camera and microphone
    files, audible audio in the published recording, getRecordings and the player served by nginx.
  • Real server: tested on an Ubuntu 24.04 VM with a public IP and a real Let's Encrypt certificate: meetings with audio, webcams, screen sharing, office upload, shared notes, in Chromium and Firefox; restart and down/up.

Notes for reviewers

  • Where to start: docs/docs/administration/docker-design.md, then docker-compose.yml (its
    comments explain each service), docker/README.md, docker/lib/README.md, and one entrypoint,
    for example bigbluebutton-web/docker/entrypoint.sh with its golden case
    docker/tests/golden/bbb-web/ (parity.yaml lists every difference from bare metal).
  • Upstream images used as they are, pinned by tag and digest: redis:7.0.15-alpine (the
    version of Ubuntu 24.04), collabora/code:26.04.5.1.1, ghcr.io/bigbluebutton/bbb-webhooks:3.7.0.
    ghcr.io/bigbluebutton/bbb-webrtc-sfu:2.25.0-beta.3 is the base of a thin layer
    (docker/bbb-webrtc-sfu/). Versions follow the <component>.placeholder.sh pins. The SFU and
    webhooks images run upstream's Node 22.
  • Accepted exceptions:
    • conversion (Collabora) runs as its image's user cool, keeps CHOWN, FOWNER and
      SYS_CHROOT, runs without no-new-privileges and has exec tmpfs mounts for its jail
      directories, because its per-document chroot jails need them. It is on an internal network
      with bbb-web only, and its data sources are limited to loopback.
    • setup runs as root with only CHOWN and DAC_OVERRIDE, to write .env into a directory
      of any owner (--user runs it as you instead).
    • graphql-server's /tmp tmpfs allows exec: the Hasura CLI runs its helper from there.
    • haproxy and nginx bind 443, 80 and 81 as non-root through the per-container sysctl
      net.ipv4.ip_unprivileged_port_start=0.
  • Some images are amd64 only for now (graphql-server's engine binary, and images that need
    upstream's yq checksums, which cover amd64 only); the reasons are in docker/bake/*.hcl.

Credits

This builds on the Docker work started in this PR and on the work from the 2025 Vienna Dev
Summit by @samuelwei, @danimo, @fcecagno, @gschwienbacher and @tibroc, which is kept as its own
commits with their original authors (Samuel Weirich's squashed summit commit and "Add arm
support", Daniel Molkentin's "parallelize platform builds").

Samuel Weirich (@samuelwei) independently updated these Docker files for 4.0 in
samuelwei#2. His findings confirmed several fixes and informed the learning
dashboard and export-annotations images; the commits that take over his approach carry a
Co-authored-by: Samuel Weirich <[email protected]> trailer.

@coderabbitai

coderabbitai Bot commented Apr 8, 2025 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tibroc
tibroc force-pushed the build-and-publish-docker-images branch 11 times, most recently from cedbbc1 to 044e0d0 Compare April 14, 2025 12:58
@tibroc
tibroc force-pushed the build-and-publish-docker-images branch 16 times, most recently from 38c657e to 3c029b1 Compare April 16, 2025 15:10
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
24 Security Hotspots

See analysis details on SonarQube Cloud

tibroc and others added 7 commits October 19, 2026 18:24
Complete the container images for BigBlueButton 4.0 and add a single,
committed docker-compose.yml that runs the whole stack: haproxy and
certbot at the edge, nginx, bbb-web, akka-apps, the GraphQL services,
html5 client, learning dashboard, shared notes, export-annotations,
LiveKit, bbb-webrtc-sfu, coturn, redis, postgres, db-init, office
conversion (Collabora CODE), an optional bbb-webhooks service and a
setup container that writes .env.

- Configuration contract (docker/config-contract.yaml) with the
  generated .env.sample and the variables reference page.
- Entrypoints that validate required variables, render configuration
  with each component's native mechanism, merge override files mounted
  at the bare-metal paths, then exec the process.
- Images run as non-root with read-only root filesystems and
  healthchecks; third-party base images are pinned by digest.
- Tests: golden configuration trees with parity against bare metal,
  contract and compose assertions, lint, and a real Docker stack test
  (join path, restarts, conversion, webhooks, notes PDF export), run in
  the new docker-checks workflow.
- Docs: install, upgrade and backup page, configuration reference and
  a design page explaining the choices.

Recording, running behind an existing reverse proxy and a development
setup follow in later changes.

Co-authored-by: Samuel Weirich <[email protected]>
@tibroc
tibroc force-pushed the build-and-publish-docker-images branch from 4e63aa2 to d2edb50 Compare October 19, 2026 16:29
@tibroc tibroc changed the title Introduce automatic docker image builds feat(docker): run BigBlueButton 4.0 with Docker Compose Oct 19, 2026
samuelwei and others added 13 commits October 19, 2026 19:47
bbb-graphql-server is still amd only and emulated
Upstream's bbb-webrtc-recorder image (v0.17.0, pinned by digest) with a thin layer: yq, an
entrypoint that merges the container wiring and the Tier 3 override
/etc/bigbluebutton/bbb-webrtc-recorder.yml over the packaged default (the recorder loads only
one file), and a healthcheck on its redis connection. The service writes the recorder-raw
volume as BBB_UID/BBB_GID; a compose rule checks the volume's path, writer and user.
Build the recording player (bbb-playback v5.4.8, pinned by commit) as its
own image and run it as service playback in the recording profile. With
the recording feature the edge nginx proxies /playback/presentation/2.3 to
it and serves published recordings read-only from the bbb-data volume;
without the feature none of these locations exist.

Golden cases bbb-playback and nginx-norecording, the nginx case updated
for the playback upstream group, and a real-Docker playback check.
Rebuild the record-and-playback image on ubuntu:24.04 (the Debian 11 base
no longer installs) with Ruby, ffmpeg, bbb-presentation-video and the
bbb-record tools installed as the bare-metal packages do, and run what the
bare-metal units run as services of one image: the resque workers
(RECORDING_WORKERS), rap-starter, rap-caption-inbox and the daily cleanup.
The workers fetch shared notes over the notes network, remove the
recorder's files after archiving them, and post the analytics callback
with bbb-web's default properties. Overrides go to the bare-metal paths
under /etc/bigbluebutton/recording/.

The example script that deleted published recordings is removed: deleting
published recordings stays a manual decision, as on bare metal.

Golden cases record-and-playback and record-and-playback-keepraw, lint for
the Dockerfile again, and a real-Docker check that takes a recorded
meeting through archive, sanity, process and publish.
@alangecker

alangecker commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

I'm really looking forward to get the docker project bigbluebutton/docker merged into the main repo, why I'm happy about that move and thought I could do a review on this PR.

Unfortunately I was just overwhelmed. 29k (edit: 34k) lines of changes with so many wired, obviously vibecoded parts, which don't make any sense to me and I'm quite sure that no human ever decided on them.

just a few examples from the the first few files I've looked into:

  1. wired excessive java script for getting the redis host + port for an is-up-check, while the hostname being an constant in the config file ("redis") - it never changes.
    https://github.com/bigbluebutton/bigbluebutton/pull/22894/changes#diff-b670effe5ff720eb36cb0af787d8661a95a80d7bbdcc4d1d1ec345c285b541b2R49
  2. unreadable healthchecks: https://github.com/bigbluebutton/bigbluebutton/pull/22894/changes#diff-c83f328ec91770210319dac7acc32dd2407a26c68ea07f4a6f426c2cf913e32bR21
  3. builds own sandboxing tool in C instead of existing solutions: https://github.com/bigbluebutton/bigbluebutton/pull/22894/changes#diff-333f5ce2925801dd096e40a125d95b09d936dca31f1a279c051b7804fda06858
  4. healthchecks defined for almost every container in the compose file, but duplicated in the Dockerfiles https://github.com/bigbluebutton/bigbluebutton/pull/22894/changes#diff-e45e45baeda1c1e73482975a664062aa56f20c03dd9d64a827aba57775bed0d3
  5. ...

I'm might be wrong with some of the points, I did not dive deeper into these changes, because my brain started smoking. It seems impossible to review for me, there could be lots of bug or even backdoors and, in my opinion, this would just create an non-maintainable mess when merged.

…g by default

Add docker/tests/stack/recording-e2e.sh: headless Chromium in the
Playwright image joins a meeting created with record=true through the
html5 client with a fake microphone and webcam (upstream's Playwright
helpers), the meeting is ended, and the test requires the recorder's
camera and microphone files with real content in the raw archive, a
published recording with audible audio, getRecordings listing it, and
nginx serving the player, metadata and video. The CI stack job runs it
and the playback check against the running stack.

With recording working, BBB_FEATURES defaults to recording again, as on
bare metal: unset means recording, set but empty means no optional
feature. COMPOSE_PROFILES follows the same default.
compose.dev.yml, used on top of docker-compose.yml, builds every image
from the source tree and adds the three common development loops, each
following the bare-metal workflow: the html5 client's dev server with hot
reload behind the edge nginx (as run-dev.sh does), and rebuilds of
bbb-web and akka-apps from the mounted source into a volume, followed by
a restart of the service. docker/tests/compose/check-dev.sh checks the
file for every feature combination against the bake targets, and
docker/tests/stack/dev-check.sh (dind.sh dev-check) exercises each loop.
@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@tibroc

tibroc commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

@alangecker i actually agree with you, i just let claude running a weekend over this to have a working proof of concept - which actually it is. however, I agree this is not reviewable for a human any more. We can still revert back to the state of the last dev-summit (437c1a2). and work forward from there.

@antobinary

Copy link
Copy Markdown
Member

We merged #26141 instead.

@antobinary antobinary closed this Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants