### Build and run Matterbridge inside container Source: https://github.com/luligu/matterbridge/blob/main/README-BUN.md Installs dependencies, builds the project, and starts the Matterbridge application. ```bash apt-get update && apt-get install -y git git clone --depth 1 --single-branch --no-tags --branch dev https://github.com/Luligu/matterbridge.git && cd matterbridge bun install bun run build cd apps/frontend bun install bun run build cd ../.. bun link matterbridge --docker --logger debug --debug ``` -------------------------------- ### Initialize Matterbridge directories and installation Source: https://github.com/luligu/matterbridge/blob/main/README-MACOS-PLIST.md Creates the necessary directory structure and installs Matterbridge into a dedicated global node_modules path. ```bash sudo mkdir -p /usr/local/etc/matterbridge sudo mkdir -p /usr/local/etc/matterbridge/.npm-global sudo mkdir -p /usr/local/etc/matterbridge/Matterbridge sudo mkdir -p /usr/local/etc/matterbridge/.matterbridge sudo mkdir -p /usr/local/etc/matterbridge/.mattercert sudo chown -R root:wheel /usr/local/etc/matterbridge sudo chown -R root:wheel /usr/local/etc/matterbridge/.npm-global sudo chmod -R 755 /usr/local/etc/matterbridge/.npm-global sudo NPM_CONFIG_PREFIX=/usr/local/etc/matterbridge/.npm-global npm install -g matterbridge --omit=dev ``` -------------------------------- ### Initialize directories and install Matterbridge Source: https://github.com/luligu/matterbridge/blob/main/README-WINDOWS.md Creates required user directories and installs the Matterbridge package globally. ```powershell New-Item -ItemType Directory -Force -Path "$HOME\Matterbridge", "$HOME\.matterbridge", "$HOME\.mattercert" | Out-Null npm install -g matterbridge --omit=dev where.exe matterbridge.cmd matterbridge --version ``` -------------------------------- ### Initialize directories and install Matterbridge Source: https://github.com/luligu/matterbridge/blob/main/README-SERVICE-OPT.md Creates the required directory structure, sets ownership, and installs Matterbridge into a private global node_modules location. ```bash cd ~ # ✅ Safe precaution if matterbridge was already running with the traditional setup sudo systemctl stop matterbridge 2>/dev/null || true # ✅ Safe precaution we need to uninstall from the global node_modules sudo npm uninstall matterbridge -g 2>/dev/null || true # ✅ Creates all required directories sudo mkdir -p /opt/matterbridge /opt/matterbridge/Matterbridge /opt/matterbridge/.matterbridge /opt/matterbridge/.mattercert /opt/matterbridge/.npm-global /opt/matterbridge/.npm-cache # ✅ Ensures ownership sudo chown -R matterbridge:matterbridge /opt/matterbridge /opt/matterbridge/Matterbridge /opt/matterbridge/.matterbridge /opt/matterbridge/.mattercert /opt/matterbridge/.npm-global /opt/matterbridge/.npm-cache # ✅ Secure permissions sudo chmod -R 755 /opt/matterbridge /opt/matterbridge/Matterbridge /opt/matterbridge/.matterbridge /opt/matterbridge/.mattercert /opt/matterbridge/.npm-global /opt/matterbridge/.npm-cache # ✅ make sure the “bin” dir exists for global executables sudo -u matterbridge mkdir -p /opt/matterbridge/.npm-global/bin # ✅ Install matterbridge in the private global node_modules using the private npm cache sudo -u matterbridge npm install matterbridge --omit=dev --verbose --global --prefix=/opt/matterbridge/.npm-global --cache=/opt/matterbridge/.npm-cache # ✅ Create a link to matterbridge bins sudo ln -sf /opt/matterbridge/.npm-global/bin/matterbridge /usr/bin/matterbridge sudo ln -sf /opt/matterbridge/.npm-global/bin/mb_mdns /usr/bin/mb_mdns sudo ln -sf /opt/matterbridge/.npm-global/bin/mb_coap /usr/bin/mb_coap # ✅ Clear bash command cache as a precaution hash -r # ✅ Check if matterbridge is /usr/bin/matterbridge which matterbridge # ✅ Will output the matterbridge version matterbridge --version ``` -------------------------------- ### Clone and Install Plugin Source: https://github.com/luligu/matterbridge/blob/main/README-DEV.md Commands to clone a plugin repository, install dependencies, link the Matterbridge package, and build the project. ```bash git clone --depth 1 --single-branch --no-tags https://github.com/Luligu/matterbridge-example-accessory-platform cd matterbridge-example-accessory-platform npm install --no-fund --no-audit npm link matterbridge npm run build ``` -------------------------------- ### Install dependencies for Bun Source: https://github.com/luligu/matterbridge/blob/main/README-BUN.md Commands to install production dependencies and link the project using Bun. ```bash bun install --omit=dev bun link ``` -------------------------------- ### Start Docker Compose Source: https://github.com/luligu/matterbridge/blob/main/README-DOCKER.md Commands to pull and start the Matterbridge service. ```bash docker compose pull matterbridge docker compose up -d ``` ```bash docker compose pull matterbridge docker compose up -d matterbridge ``` -------------------------------- ### Install and register a plugin Source: https://github.com/luligu/matterbridge/blob/main/docs/README-DEV.html Commands to clone a plugin, link it to Matterbridge, and register it. ```bash git clone --depth 1 --single-branch --no-tags https://github.com/Luligu/matterbridge-example-accessory-platform cd matterbridge-example-accessory-platform npm install --no-fund --no-audit npm link matterbridge npm run build ``` ```bash matterbridge -add . ``` -------------------------------- ### Install NGINX Source: https://github.com/luligu/matterbridge/blob/main/README-NGINX.md Commands to update package lists and install the NGINX web server. ```bash sudo apt update sudo apt install nginx ``` -------------------------------- ### Start Matterbridge Source: https://github.com/luligu/matterbridge/blob/main/docs/README-WINDOWS.html Manually triggers the scheduled task to start Matterbridge. ```bash schtasks /run /tn "Matterbridge" ``` -------------------------------- ### View Matterbridge help and version Source: https://github.com/luligu/matterbridge/blob/main/README.md Displays command line syntax or the current installed version. ```bash matterbridge --help ``` ```bash matterbridge --version ``` -------------------------------- ### Initialize Bun development container Source: https://github.com/luligu/matterbridge/blob/main/README-BUN.md Pulls the latest Bun image and starts a container with the necessary network and port configurations. ```bash docker pull oven/bun:latest && docker run -dit --network matterbridge -p 8283:8283 --name bun-development oven/bun:latest bash docker exec -it bun-development bash ``` -------------------------------- ### Run container with extra parameters Source: https://github.com/luligu/matterbridge/blob/main/README-DOCKER.md Example of overriding the default command to specify a custom frontend port. ```bash sudo docker pull luligu/matterbridge:latest sudo docker stop matterbridge 2>/dev/null sudo docker rm matterbridge 2>/dev/null sudo 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:latest \ matterbridge --docker --frontend 8585 ``` -------------------------------- ### Service Lifecycle Management Source: https://github.com/luligu/matterbridge/blob/main/README-SERVICE-OPT.md Standard systemctl commands to start, stop, check status, enable, and disable the service. ```bash sudo systemctl start matterbridge ``` ```bash sudo systemctl stop matterbridge ``` ```bash sudo systemctl status matterbridge ``` ```bash sudo systemctl enable matterbridge ``` ```bash sudo systemctl disable matterbridge ``` -------------------------------- ### Install Podman Source: https://github.com/luligu/matterbridge/blob/main/README-PODMAN.md Updates the package repository and installs Podman on Debian-based systems. ```bash cd ~ sudo apt update sudo apt install podman -y podman --version ``` -------------------------------- ### Install plugin manually via terminal Source: https://github.com/luligu/matterbridge/blob/main/README.md Install a plugin from npm and register it with Matterbridge. Ensure the current directory is set to the Matterbridge home folder. ```powershell cd $HOME\Matterbridge npm install -g matterbridge-zigbee2mqtt --omit=dev matterbridge --add matterbridge-zigbee2mqtt ``` ```bash cd ~/Matterbridge sudo npm install -g matterbridge-zigbee2mqtt --omit=dev matterbridge --add matterbridge-zigbee2mqtt ``` -------------------------------- ### Install Matterbridge via Node.js Source: https://github.com/luligu/matterbridge/blob/main/docs/index.html Use npm to install the Matterbridge package globally. Linux and macOS users may require sudo privileges. ```bash npm install -g matterbridge --omit=dev ``` ```bash sudo npm install -g matterbridge --omit=dev ``` -------------------------------- ### Run Matterbridge Container Source: https://github.com/luligu/matterbridge/blob/main/README-PODMAN.md Starts the Matterbridge container with host network access and volume mounts for configuration and storage. ```bash podman run --name matterbridge \ -v ~/Matterbridge:/root/Matterbridge \ -v ~/.matterbridge:/root/.matterbridge \ --network host --restart always --stop-timeout 60 -d docker.io/luligu/matterbridge:latest ``` -------------------------------- ### Manage Matterbridge Service Source: https://github.com/luligu/matterbridge/blob/main/README-SERVICE.md Common commands to start, stop, check status, and toggle automatic boot startup. ```bash sudo systemctl start matterbridge ``` ```bash sudo systemctl stop matterbridge ``` ```bash sudo systemctl status matterbridge.service ``` ```bash sudo systemctl enable matterbridge.service ``` ```bash sudo systemctl disable matterbridge.service ``` -------------------------------- ### Install Matterbridge Globally Source: https://github.com/luligu/matterbridge/blob/main/README-SERVICE.md Attempt to install Matterbridge globally without development dependencies. ```bash sudo npm install -g matterbridge --omit=dev ``` -------------------------------- ### Verify Node.js environment Source: https://github.com/luligu/matterbridge/blob/main/README-MACOS-PLIST.md Checks the installed versions and path of Node.js. ```bash node -v npm -v ``` ```text v22.20.0 10.9.3 ``` ```bash which node ``` ```text /usr/local/bin/node ``` -------------------------------- ### Inspect Container Network Configuration Source: https://github.com/luligu/matterbridge/blob/main/docs/reflector/Reflector.html Install diagnostic tools and display IP and routing information for the container. ```bash docker exec -it matterbridge-test apt-get update docker exec -it matterbridge-test apt-get install -y --no-install-recommends iproute2 iputils-ping net-tools dnsutils tcpdump netcat-openbsd docker exec -it matterbridge-test ip a docker exec -it matterbridge-test ip r ``` -------------------------------- ### Install and Run Matterbridge via Docker Source: https://github.com/luligu/matterbridge/blob/main/docs/index.html Pull the latest image and run the container with necessary volume mounts and network configuration. ```bash docker pull luligu/matterbridge:latest && 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:latest ``` -------------------------------- ### Manage Container Lifecycle Source: https://github.com/luligu/matterbridge/blob/main/README-PODMAN.md Standard commands to start, stop, restart, and remove the Matterbridge container. ```bash podman start matterbridge ``` ```bash podman stop matterbridge ``` ```bash podman restart matterbridge ``` ```bash podman rm matterbridge ``` -------------------------------- ### Verify Node.js environment Source: https://github.com/luligu/matterbridge/blob/main/README-WINDOWS.md Checks the installed versions of Node.js and npm. ```powershell node -v npm -v ``` -------------------------------- ### Manage container lifecycle Source: https://github.com/luligu/matterbridge/blob/main/README-DOCKER.md Standard commands to start, stop, or restart the Matterbridge container. ```bash docker start matterbridge ``` ```bash docker stop matterbridge ``` ```bash docker restart matterbridge ``` -------------------------------- ### Enable HTTPS with mTLS Source: https://github.com/luligu/matterbridge/blob/main/README.md Starts the Matterbridge frontend with SSL and mutual TLS authentication enabled. ```bash matterbridge --ssl --mtls --frontend 443 ``` -------------------------------- ### Enable or disable automatic boot startup Source: https://github.com/luligu/matterbridge/blob/main/README-MACOS-PLIST.md Controls whether the service starts automatically when the system boots. ```bash sudo launchctl enable system/matterbridge ``` ```bash sudo launchctl disable system/matterbridge ``` -------------------------------- ### Enable HTTPS with custom port Source: https://github.com/luligu/matterbridge/blob/main/README.md Starts the Matterbridge frontend with SSL enabled on a specified port. ```bash matterbridge --ssl --frontend 443 ``` -------------------------------- ### Start Matterbridge in Dev Container Source: https://github.com/luligu/matterbridge/blob/main/docs/reflector/MatterbridgeDevContainer.html Executes the Matterbridge application from within the development container terminal. ```bash matterbridge ``` -------------------------------- ### Manage Matterbridge service lifecycle Source: https://github.com/luligu/matterbridge/blob/main/README-MACOS-PLIST.md Commands to start, stop, restart, and check the status of the Matterbridge service. ```bash sudo launchctl kickstart -k system/matterbridge ``` ```bash sudo launchctl bootout system/matterbridge ``` ```bash sudo launchctl kickstart -k system/matterbridge ``` ```bash sudo launchctl print system/matterbridge ``` ```bash sudo launchctl print system/matterbridge | grep -E "pid|state" ``` -------------------------------- ### Identify npm dependency warning Source: https://github.com/luligu/matterbridge/blob/main/docs/CHANGELOG.html Example of a common npm warning message that may appear during installation. This is a transitive dependency issue and can be safely ignored. ```text npm warn deprecated glob@10.5.0: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me ``` -------------------------------- ### Create Matterbridge Directories Source: https://github.com/luligu/matterbridge/blob/main/README-PODMAN.md Sets up the necessary plugin and storage directories in the user home folder with appropriate ownership. ```bash cd ~ mkdir -p ./Matterbridge mkdir -p ./.matterbridge sudo chown -R $USER:$USER ./Matterbridge ./.matterbridge ``` -------------------------------- ### Create Matterbridge Directories Source: https://github.com/luligu/matterbridge/blob/main/README-SERVICE.md Initializes the necessary directory structure and sets ownership permissions. ```bash cd ~ mkdir -p ~/Matterbridge mkdir -p ~/.matterbridge mkdir -p ~/.mattercert sudo chown -R $USER:$USER ~/Matterbridge ~/.matterbridge ~/.mattercert ``` -------------------------------- ### Run Home Assistant and Matter Server via Docker Compose Source: https://github.com/luligu/matterbridge/blob/main/docs/reflector/Reflector.html Commands to initialize the network and deploy the Home Assistant and Matter Server stack using a specific Docker Compose configuration. ```bash docker network inspect matterbridge || docker network create --ipv6 matterbridge docker compose -p matterbridge-reflector -f reflector-docker-compose.yml down docker compose -p matterbridge-reflector -f reflector-docker-compose.yml pull docker compose -p matterbridge-reflector -f reflector-docker-compose.yml up -d --force-recreate docker logs --tail 1000 -f reflector ``` -------------------------------- ### Check Node.js path Source: https://github.com/luligu/matterbridge/blob/main/README-WINDOWS.md Locates the executable path for the Node.js installation. ```powershell where.exe node ``` -------------------------------- ### Enable NGINX Site Source: https://github.com/luligu/matterbridge/blob/main/README-NGINX.md Command to create a symbolic link to enable the site configuration. ```bash sudo ln -s /etc/nginx/sites-available/matterbridge /etc/nginx/sites-enabled/ ``` -------------------------------- ### Create NGINX Configuration File Source: https://github.com/luligu/matterbridge/blob/main/README-NGINX.md Command to open the configuration file for editing. ```bash sudo nano /etc/nginx/sites-available/matterbridge ``` -------------------------------- ### Access Matterbridge Web Frontend Source: https://github.com/luligu/matterbridge/blob/main/docs/index.html The web interface is available on port 8283 after the service has started. ```text http://localhost:8283 http://[::1]:8283 http://:8283 http://[]:8283 ``` -------------------------------- ### Integrate with Systemd Source: https://github.com/luligu/matterbridge/blob/main/README-PODMAN.md Generates a systemd service file for the container and enables it for automatic startup on boot. ```bash podman generate systemd --name matterbridge --files --new sudo mv container-matterbridge.service /etc/systemd/system/ sudo systemctl enable container-matterbridge sudo systemctl start container-matterbridge ``` -------------------------------- ### Add a plugin Source: https://github.com/luligu/matterbridge/blob/main/README.md Register a plugin by its path or name. ```bash matterbridge --add [plugin path or plugin name] ``` -------------------------------- ### Build and link Matterbridge locally Source: https://github.com/luligu/matterbridge/blob/main/README-DEV.md Commands to clone, build, and link the Matterbridge repository for plugin development. ```bash git clone --depth 1 --single-branch --no-tags https://github.com/Luligu/matterbridge.git cd matterbridge npm install --no-fund --no-audit npm run build cd apps/frontend npm install --no-fund --no-audit npm run build cd ../.. npm link --no-fund --no-audit ``` -------------------------------- ### Enable automatic startup Source: https://github.com/luligu/matterbridge/blob/main/docs/README-WINDOWS.html Enables the scheduled task to run on logon. ```bash schtasks /change /tn "Matterbridge" /enable ``` -------------------------------- ### Override command in Docker Compose Source: https://github.com/luligu/matterbridge/blob/main/README-DOCKER.md Example of adding a command override and disabling healthchecks in YAML. ```yaml services: matterbridge: ... command: ["matterbridge", "--docker", "--frontend", "8585"] ``` ```yaml healthcheck: disable: true ``` -------------------------------- ### Configure HTTPS for frontend Source: https://github.com/luligu/matterbridge/blob/main/docs/README.html Enable SSL/TLS for the frontend, optionally requiring mTLS for client authentication. ```bash matterbridge --ssl --frontend 443 ``` ```bash matterbridge --ssl --mtls --frontend 443 ``` -------------------------------- ### Instantiate Appliance Devices Source: https://github.com/luligu/matterbridge/blob/main/README-DEV.md Creates various single class appliance devices. ```typescript const laundryWasher = new LaundryWasher('Laundry Washer', 'LW1234567890'); ``` ```typescript const laundryDryer = new LaundryDryer('Laundry Dryer', 'LDW1235227890'); ``` ```typescript const dishwasher = new Dishwasher('Dishwasher', 'DW1234567890'); ``` ```typescript const extractorHood = new ExtractorHood('Extractor Hood', 'EH1234567893'); ``` ```typescript const microwaveOven = new MicrowaveOven('Microwave Oven', 'MO1234567893'); ``` -------------------------------- ### Configure launchctl plist Source: https://github.com/luligu/matterbridge/blob/main/README-MACOS-PLIST.md Creates and validates the launch daemon configuration file for Matterbridge. ```bash sudo nano /Library/LaunchDaemons/matterbridge.plist ``` ```xml EnvironmentVariables PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/etc/matterbridge/.npm-global/bin NPM_CONFIG_PREFIX /usr/local/etc/matterbridge/.npm-global HOME /var/root NODE_PATH /usr/local/etc/matterbridge/.npm-global/lib/node_modules KeepAlive Label matterbridge ProgramArguments /usr/local/etc/matterbridge/.npm-global/bin/matterbridge --homedir /usr/local/etc/matterbridge --service --nosudo RunAtLoad StandardErrorPath /var/log/matterbridge.err StandardOutPath /var/log/matterbridge.log WorkingDirectory /usr/local/etc/matterbridge ``` ```bash sudo launchctl bootout system/matterbridge ``` ```bash sudo chown root:wheel /Library/LaunchDaemons/matterbridge.plist sudo chmod 644 /Library/LaunchDaemons/matterbridge.plist sudo plutil -lint /Library/LaunchDaemons/matterbridge.plist sudo plutil -convert xml1 /Library/LaunchDaemons/matterbridge.plist ``` ```bash sudo rm -f /var/log/matterbridge.log /var/log/matterbridge.err sudo launchctl bootstrap system /Library/LaunchDaemons/matterbridge.plist sudo launchctl enable system/matterbridge ``` -------------------------------- ### Manage Matterbridge task lifecycle Source: https://github.com/luligu/matterbridge/blob/main/README-WINDOWS.md Commands to start, stop, restart, and query the status of the Matterbridge scheduled task. ```cmd schtasks /run /tn "Matterbridge" ``` ```cmd schtasks /end /tn "Matterbridge" ``` ```cmd schtasks /end /tn "Matterbridge" schtasks /run /tn "Matterbridge" ``` ```cmd schtasks /query /tn "Matterbridge" /v /fo list ``` ```cmd schtasks /query /tn "Matterbridge" /v /fo list | findstr /I "TaskName Status Last Run Time Last Result" ``` -------------------------------- ### Create Systemd Service Configuration Source: https://github.com/luligu/matterbridge/blob/main/README-SERVICE-LOCAL.md Commands to create and define the systemd service file for Matterbridge. ```bash sudo nano /etc/systemd/system/matterbridge.service ``` ```text [Unit] Description=matterbridge After=network.target Wants=network.target StartLimitIntervalSec=60 StartLimitBurst=5 [Service] Type=simple Environment="NPM_CONFIG_PREFIX=/home//.npm-global" Environment="NPM_CONFIG_CACHE=/home//.npm-cache" ExecStart=matterbridge --service --nosudo WorkingDirectory=/home//Matterbridge StandardOutput=inherit StandardError=inherit Restart=always User= Group= [Install] WantedBy=multi-user.target ``` -------------------------------- ### Navigate to Matterbridge Directory Source: https://github.com/luligu/matterbridge/blob/main/README-DEV.md Commands to change the working directory to the Matterbridge installation folder based on the operating system. ```powershell cd $HOME\Matterbridge ``` ```bash cd ~/Matterbridge ``` -------------------------------- ### Verify Sudoers Include Directory Source: https://github.com/luligu/matterbridge/blob/main/README-SERVICE.md Ensure the sudoers file includes the configuration directory. ```text @includedir /etc/sudoers.d ``` -------------------------------- ### Open sudoers file for editing Source: https://github.com/luligu/matterbridge/blob/main/README-MACOS-PLIST.md Use this command to open the sudoers configuration file with the nano editor. ```bash sudo EDITOR=nano visudo ``` -------------------------------- ### Cleanup previous Matterbridge installations Source: https://github.com/luligu/matterbridge/blob/main/README-WINDOWS.md Removes existing scheduled tasks, configuration directories, and global npm packages. ```powershell schtasks /delete /tn "Matterbridge" /f Remove-Item -Recurse -Force "$HOME\Matterbridge", "$HOME\.matterbridge", "$HOME\.mattercert" -ErrorAction SilentlyContinue npm uninstall -g matterbridge ``` -------------------------------- ### Apply and verify journald configuration Source: https://github.com/luligu/matterbridge/blob/main/README-SERVICE-OPT.md Restart the service to apply changes and verify the final configuration. ```bash sudo systemctl restart systemd-journald sudo systemd-analyze cat-config systemd/journald.conf ``` -------------------------------- ### Matterbridge Frontend Log Output Source: https://github.com/luligu/matterbridge/blob/main/reflector/Reflector.md Example log output showing the frontend server listening on container-internal IP addresses. ```text [09:02:10.140] [Frontend] The frontend http server is listening on http://172.17.0.2:8283 [09:02:10.140] [Frontend] The frontend http server is listening on http://[fd3d:8954:ffe5::2]:8283 ``` -------------------------------- ### Create Systemd Service File Source: https://github.com/luligu/matterbridge/blob/main/README-SERVICE-OPT.md Command to open the systemd service configuration file for editing. ```bash sudo nano /etc/systemd/system/matterbridge.service ``` -------------------------------- ### Cleanup previous Matterbridge installations Source: https://github.com/luligu/matterbridge/blob/main/README-MACOS-PLIST.md Removes existing configuration files, logs, and global npm packages to ensure a clean state. ```bash sudo rm -rf ~/Matterbridge sudo rm -rf ~/.matterbridge sudo rm -rf ~/.mattercert sudo rm -f /usr/local/etc/matterbridge sudo rm -f /Library/LaunchDaemons/matterbridge.plist sudo rm -f /var/log/matterbridge.log /var/log/matterbridge.err sudo npm uninstall matterbridge -g ``` -------------------------------- ### Configure passwordless sudo for npm Source: https://github.com/luligu/matterbridge/blob/main/docs/README-SERVICE.html Steps to grant a user passwordless sudo access for npm installations, including editing the sudoers file. ```bash sudo npm install -g matterbridge --omit=dev ``` ```bash sudo visudo ``` ```bash @includedir /etc/sudoers.d ``` ```bash sudo nano /etc/sudoers.d/matterbridge ``` ```text ALL=(ALL) NOPASSWD: ALL ``` ```text ALL=(ALL) NOPASSWD: /usr/bin/npm ``` ```bash sudo chmod 0440 /etc/sudoers.d/matterbridge sudo visudo -c ``` ```bash sudo npm install -g matterbridge --omit=dev ``` -------------------------------- ### Create Matterbridge system user and group Source: https://github.com/luligu/matterbridge/blob/main/README-SERVICE-OPT.md Sets up a dedicated system user and group for running the service securely without sudo requirements. ```bash # ✅ Create the matterbridge group sudo groupadd --system matterbridge 2>/dev/null || true # ✅ Create the matterbridge user sudo useradd --system \ --home-dir /opt/matterbridge \ --shell /usr/sbin/nologin \ --gid matterbridge \ matterbridge 2>/dev/null || true ``` -------------------------------- ### Apply Sudoers Permissions Source: https://github.com/luligu/matterbridge/blob/main/README-SERVICE.md Set correct file permissions and validate the sudoers configuration. ```bash sudo chmod 0440 /etc/sudoers.d/matterbridge sudo visudo -c ``` -------------------------------- ### Reproduce Bun OS User Info Issue Source: https://github.com/luligu/matterbridge/blob/main/README-BUN.md Use this command to verify that Bun returns 'unknown' for username and shell in official container images. ```bash bun -e "import * as os from 'bun:os'; console.log(os.userInfo())" ``` -------------------------------- ### Enable or disable Matterbridge autostart Source: https://github.com/luligu/matterbridge/blob/main/README-WINDOWS.md Toggles the automatic startup behavior of the Matterbridge task at logon. ```cmd schtasks /change /tn "Matterbridge" /enable ``` ```cmd schtasks /change /tn "Matterbridge" /disable ``` -------------------------------- ### Run Matterbridge on Windows Command Prompt Source: https://github.com/luligu/matterbridge/blob/main/README-DOCKER.md Deploys the Matterbridge container using the Windows Command Prompt with appropriate path variables. ```cmd docker pull luligu/matterbridge:latest docker stop matterbridge 2>nul docker rm matterbridge 2>nul docker run --name matterbridge ^ -p 8283:8283 -p 5540-5559:5540-5559/udp ^ -v %USERPROFILE%/Matterbridge:/root/Matterbridge ^ -v %USERPROFILE%/.matterbridge:/root/.matterbridge ^ -v %USERPROFILE%/.mattercert:/root/.mattercert ^ --restart always --stop-timeout 60 -d luligu/matterbridge:latest matterbridge --docker --frontend 8283 --port 5540 ``` -------------------------------- ### Register Plugin Source: https://github.com/luligu/matterbridge/blob/main/README-DEV.md Command to register the local plugin directory with the Matterbridge instance. ```bash matterbridge -add . ``` -------------------------------- ### Instantiate Composed Refrigerator Source: https://github.com/luligu/matterbridge/blob/main/README-DEV.md Creates a Refrigerator device and adds a cabinet component with specific tags. ```typescript const refrigerator = new Refrigerator('Refrigerator', 'RE1234567890'); refrigerator.addCabinet('Refrigerator Top', [ { mfgCode: null, namespaceId: PositionTag.Top.namespaceId, tag: PositionTag.Top.tag, label: 'Refrigerator Top' }, { mfgCode: null, namespaceId: RefrigeratorTag.Refrigerator.namespaceId, tag: RefrigeratorTag.Refrigerator.tag, label: RefrigeratorTag.Refrigerator.label }, ]); ```