Overview
MQTT Explorer supports two deployment modes: the traditional Electron desktop application and a modern browser-based mode. This guide covers building both modes from source.Prerequisites
Building Desktop Application (Electron)
The Electron build creates a native desktop application for Windows, macOS, and Linux.Development Build
For active development with hot reload:dev:app- Webpack dev server with hot module replacementdev:electron- Electron process that loads the app
The development build automatically recompiles TypeScript and reloads the app when you make changes.
Production Build
Build optimized production assets:- Compiles TypeScript in the root project (
tsc) - Builds the React app with production optimizations (
cd app && yarn run build)
Running the Built Application
After building, launch the Electron app:Building Browser Mode
The browser mode runs as a Node.js web server, making MQTT Explorer accessible through any modern browser.Development Build
Launch with hot reload:dev:server:app- Webpack dev server on port 8080dev:server:backend- Node.js Express server on port 3000
Browser mode requires authentication. Set
MQTT_EXPLORER_USERNAME and MQTT_EXPLORER_PASSWORD environment variables.Production Build
Build for production deployment:- Compiles TypeScript (
npx tsc) - Bundles the app with Webpack in production mode (
cd app && npx webpack --config webpack.browser.config.mjs --mode production)
Running the Server
Start the production server:http://localhost:3000.
Build Output Structure
Electron Build
Browser Build
Build Scripts Reference
Platform-Specific Considerations
Linux
On Linux, the application runs with
--no-sandbox flag for AppImage compatibility.afterPack.ts script wraps the binary:
macOS
macOS builds use hardened runtime and require entitlements:res/entitlements.mac.plist- Main app entitlementsres/entitlements.mac.inherit.plist- Child process entitlementsres/entitlements.mas.plist- Mac App Store entitlements
Windows
No special build considerations. The application builds cleanly on Windows with the standard toolchain.Docker Build (Browser Mode)
Build a containerized version of browser mode:linux/amd64(x86-64)linux/arm64(Raspberry Pi 3/4/5, Apple Silicon)linux/arm/v7(Raspberry Pi 2/3)
Troubleshooting
Build Fails with TypeScript Errors
Ensure you’re using a compatible TypeScript version:Electron Build Fails
-
Clear build artifacts:
-
Check Node.js version:
Browser Mode Server Won’t Start
-
Check if port 3000 is in use:
-
Verify build output exists:
Missing Dependencies
Reinstall with frozen lockfile:Next Steps
Packaging
Create distributable packages for all platforms
Releases
Learn the release workflow and version management