Matterbridge Logo   Matterbridge on Bun

matterbridge.io Docker Image Size ESM ESM


What is Bun

Bun is an all-in-one JavaScript and TypeScript toolkit: a runtime, package manager, bundler, and test runner in a single executable. It is designed as a drop-in replacement for Node.js and runs most npm packages and Node.js APIs unchanged.

Why it is so fast

Why I invest in Bun

I believe Bun is the future of the JavaScript runtime. In December 2025 Anthropic acquired Bun, and it now powers Claude Code and the Claude Agent SDK. Bun stays open source and MIT-licensed, and now has long-term backing. That is why I spend time making Matterbridge and its plugins run well on Bun.

Bun documentation

Run matterbridge with bun

Install matterbridge globally with bun

bun add matterbridge --global --omit=dev

Run matterbridge with bun

bunx --bun matterbridge

Run matterbridge with the bun docker hub image

The image (tag bun 69 MB) includes only Matterbridge, using the latest release published on npm. This image is based on oven/bun:slim. Plugins are not included in the image: they will be reinstalled on first run.

docker pull luligu/matterbridge:bun && docker run --name matterbridge -v ~/Matterbridge:/root/Matterbridge -v ~/.matterbridge:/root/.matterbridge -v ~/.mattercert:/root/.mattercert --network host --restart always --stop-timeout 60 -d luligu/matterbridge:bun

Bun docker image

The bun image installs the latest Matterbridge release from npm and runs it with the Bun runtime.

Files

File Purpose
docker/Dockerfile.bun Builds the Bun image with Matterbridge installed from npm
docker/Dockerfile.bun.dockerignore Limits the Docker build context
docker/entrypoint.bun.sh Prints container and Bun details, then starts Matterbridge

Scripts

npm run docker:build:local:bun   # build the local image (matterbridge:bun)
npm run docker:run:local:bun     # run the local image (container matterbridge-bun-local, port 8283)
npm run docker:run:hub:bun       # pull and run luligu/matterbridge:bun
npm run docker:buildx:cloud:bun  # build and publish the multi-platform image

Bun local image with no production build (development)

The local-bun image copies the local Matterbridge source tree and runs it directly with the Bun runtime. It does not create a production TypeScript build.

Files

File Purpose
docker/Dockerfile.local.bun Builds the development image from the local source tree
docker/Dockerfile.local.bun.dockerignore Limits the Docker build context
docker/entrypoint.local.bun.sh Prints container and Bun details, then starts Matterbridge

Scripts

npm run docker:build:localbun   # build the image (matterbridge:local-bun)
npm run docker:run:localbun     # run it (container matterbridge-local-bun, port 8283)
npm run docker:exec:localbun    # open a shell in the running container
npm run docker:log:localbun     # follow the container logs

Bun projects

Matterbridge on a Raspberry Pi Zero 2 W

A headless Pi Zero 2 W (512 MB RAM) running Matterbridge on Bun, with zram swap, a trimmed service list, and the graphics stack disabled to free RAM. Tested with a bridge of 50 devices.

See Matterbridge on a Raspberry Pi Zero 2 W for the full setup.

Matterbridge on a Raspberry Pi 4 Model B

A headless Pi 4 Model B (8 GB RAM) running Matterbridge on Bun as the only runtime, with no swap, no Docker, passwordless sudo, a trimmed service list, and the graphics stack disabled.

See Matterbridge on a Raspberry Pi 4 Model B for the full setup.

Status

The core bridge runs on Bun: it creates its directories, initializes the Matter node storage, and brings up the server node and endpoints. The web frontend is built and served. See the TODO list below for the known limitations.


Known issue with release 1.4.0