Website review
This review may include AI-generated content and is not individually verified. Domain, certificate and other facts come from the observed data on this page.
What is electron-builder?
electron-builder is a packaging and distribution tool for Electron desktop apps. It takes your app's source and produces installers, portable builds, and archives for macOS, Windows, and Linux from a single command, and it bundles auto-update support through its companion component, electron-updater. It also handles code signing and notarization, so the resulting apps appear as trusted, verified software on each platform.
H3 What it does in practice
- Builds per-platform artifacts: installers, portable executables, and distribution-ready archives.
- Ships updates: differential updates, staged rollouts, and multiple hosting providers such as GitHub Releases and S3.
- Handles trust requirements: macOS notarization and Windows Authenticode signing.
H3 Who it's for Developers and small teams already building an Electron app who want one repeatable release pipeline instead of stitching together separate tools per operating system. If your app is not Electron-based, this tool is not relevant to you.
H3 How it compares to alternatives
| Tool | Typical fit |
|---|---|
| electron-builder | Broadest built-in coverage: multi-platform packaging, signing, notarization, and auto-update in one place |
| Electron Forge | Official Electron tooling with a plugin model; more assembly required for some release tasks |
| Manual scripts + platform tools | Maximum control, but you maintain signing, installers, and update logic yourself |
H3 Next step
Open your project's package.json, add electron-builder as a dev dependency, and define a build section describing your targets (for example, a Windows NSIS installer and a macOS DMG). Then run the build command and inspect the output artifacts before wiring up electron-updater with your chosen release provider. Start with one platform, confirm signing works, then expand.
For setup details and current options, see electron-builder.
How do I package an Electron app for Windows, macOS, and Linux with electron-builder?
Use electron-builder as the packaging layer for an existing Electron project, then drive each platform's installer format from one configuration file. The core idea is to define your app metadata and per-OS targets once, and let the tool produce installers, portable builds, and distribution-ready archives.
A practical workflow
- Add electron-builder as a dev dependency and give it a
buildblock inpackage.json(or a separate config file). - Set
appId,productName, anddirectories.outputso artifacts land in a predictable folder. - Declare per-platform targets: NSIS or portable for Windows, DMG or ZIP for macOS, AppImage, deb, or snap for Linux.
- Run the build command for one platform at a time, or all three if your machine and toolchain support it.
- Add electron-updater if you want in-app updates, and configure a publish provider such as GitHub Releases or S3.
What differs per platform
| Platform | Typical targets | Extra work to plan for |
|---|---|---|
| Windows | NSIS installer, portable exe | Authenticode signing certificate |
| macOS | DMG, ZIP | Apple Developer ID signing and notarization |
| Linux | AppImage, deb, snap | Distro-specific packaging conventions |
Signing and updates
The page states that macOS notarization and Windows Authenticode signing are available out of the box, and that auto-update supports differential updates, staged rollouts, and providers including GitHub Releases and S3. Treat signing as the step that most often blocks a release: without it, users see warnings, and macOS notarization is effectively required for smooth distribution.
A concrete scenario
If you maintain a small cross-platform utility and release through GitHub, you can configure GitHub Releases as your publish provider, build a DMG, an NSIS installer, and an AppImage, and let electron-updater handle differential downloads so users only fetch the changed bytes. For a team shipping to managed Windows fleets, the same setup plus an Authenticode certificate is usually the deciding factor.
Next step
Start with one platform end to end — build, sign, install, and launch — before adding the other two. Once that pipeline is stable, layer in auto-update. For reference and configuration details, see electron-builder.
How do I set up auto-updates for an Electron app using electron-updater?
Auto-updates with electron-updater work by having your packaged app check a release provider (GitHub Releases, S3, a generic HTTP server) for a newer version, download it in the background, and then apply it on quit or on demand. electron-builder is designed to pair with it, so the same configuration that produces your installers also feeds the updater.
The moving parts
- A publish target — where builds and metadata are uploaded. electron-builder generates a
latest.yml(Windows),latest-mac.yml(macOS), orlatest-linux.ymlfile alongside each release. That YAML is what the updater reads; without it, updates fail even if the installer is present. - A version bump —
electron-updatercompares the running app's version against the version in the metadata. If you rebuild without changingversioninpackage.json, nothing will be offered. - A signed build — macOS requires signing and notarization for updates to install cleanly; Windows benefits from Authenticode signing to avoid SmartScreen warnings. electron-builder handles both out of the box.
- Updater wiring in your main process — configure the feed, listen for events, and prompt the user.
Minimal main-process setup
const { autoUpdater } = require('electron-updater')
autoUpdater.autoDownload = true
autoUpdater.autoInstallOnAppQuit = true
autoUpdater.on('update-available', (info) => {
// tell the renderer to show "Downloading update…"
})
autoUpdater.on('update-downloaded', (info) => {
// offer a "Restart to update" button
autoUpdater.quitAndInstall()
})
app.whenReady().then(() => {
if (app.isPackaged) autoUpdater.checkForUpdatesAndNotify()
})
Key practical points:
- Guard with
app.isPackagedso development runs don't throw errors. checkForUpdatesAndNotify()shows a native notification on download; usecheckForUpdates()if you want full control of the UI.quitAndInstall()must be called after the user has saved work — it restarts the app immediately.- On macOS, updates only apply to signed, notarized builds distributed outside the Mac App Store.
Choosing a provider
| Provider | Best for | Trade-off |
|---|---|---|
| GitHub Releases | Open-source or small private projects | Public repos expose builds; rate limits apply |
| S3 / compatible storage | Private distribution, high volume | You manage bucket permissions and costs |
| Generic HTTP server | Full control, existing infra | You host and serve the YAML and artifacts yourself |
Differential updates (downloading only changed blocks) are supported and worth enabling for large apps, since they cut download size substantially. Staged rollouts let you release to a percentage of users first — useful when you can't fully test every OS combination.
A realistic first-run scenario
You ship v1.0.0 to a few beta testers. You bump to v1.0.1, run your build, and upload the installer plus latest.yml to your provider. On next launch, each tester's app reads the YAML, sees 1.0.1, downloads it silently, and installs on quit. If something breaks, you can't easily pull it back from users who already updated — so test the update path itself, not just the fresh install.
Next step: start with a private GitHub repo or an S3 bucket, ship one version, then deliberately publish a patch version and confirm the update lands on a machine you control before widening the rollout.
What are the steps for code signing and notarizing an Electron app on macOS and Windows?
Code signing and notarization are two distinct steps: signing proves the app came from you, while notarization (macOS only) is Apple's automated malware scan. On Windows, code signing alone is the trust mechanism; there is no notarization equivalent. electron-builder exposes both through configuration rather than manual scripting, which is the main reason to use it over hand-rolling your own pipeline.
macOS: sign, then notarize
- Get an Apple Developer account and a "Developer ID Application" certificate, exported as a
.p12file. - Configure signing in your build config, pointing to the certificate and password (or let it read from your keychain). electron-builder handles nested binaries, frameworks, and helper apps, which is where manual
codesignscripts usually break. - Enable hardened runtime — required for notarization.
- Notarize by supplying Apple ID credentials or an app-specific password plus team ID. electron-builder submits the app to Apple's service and staples the resulting ticket so the app validates offline.
- Verify with
spctl --assessand by opening the app on a clean Mac that has never seen your developer certificate.
Windows: sign the installer and the executable
- Obtain a code signing certificate. Standard OV certificates now typically require hardware tokens or cloud HSM services; EV certificates give immediate SmartScreen reputation.
- Configure signing with your certificate file or a custom signing hook if your certificate lives in a cloud service (Azure Trusted Signing, DigiCert KeyLocker, and similar).
- Sign both the app executable and the installer — unsigned installers trigger SmartScreen warnings even if the inner binary is signed.
- Test on a fresh Windows machine and watch SmartScreen reputation build over time.
Where the two platforms differ
| Step | macOS | Windows |
|---|---|---|
| Certificate | Developer ID Application | OV or EV code signing cert |
| Second trust step | Notarization + stapling | None |
| Hardware requirement | No | Often yes (token or HSM) |
| Reputation system | Gatekeeper | SmartScreen |
Practical next step
Set up macOS signing first if you ship to both platforms — notarization is the stricter gate, and getting hardened runtime and entitlements right early avoids rework. Keep certificates and passwords in CI secrets, never in the repository, and run a signed build on a clean machine before every public release.
As a reader scenario: a two-person team shipping a cross-platform desktop app would typically store the .p12 and Apple credentials as CI secrets, let electron-builder sign and notarize on tagged releases, and use a cloud signing service for Windows to avoid shipping a physical token to every build machine.
How can I reduce the size of my Electron app's installer or portable build?
Focus on what ships inside the bundle before reaching for compression tricks. electron-builder's page evidence highlights one-command packaging for macOS, Windows and Linux plus installers, portable builds and archives, but the biggest size wins usually come from your project contents, not the packaging step.
Practical levers, roughly in order of impact
- Exclude dev-only files from the packaged app. Test suites, source maps, docs, CI configs and local fixtures often get pulled in by broad glob patterns. Tighten the
fileslist so only runtime assets, compiled output and required native modules are included. - Move to ASAR and verify it is on. Packing app code into an archive reduces file count and typically shrinks the payload; you can then inspect the archive to see what is actually inside.
- Audit
node_modules. A single dependency can drag in large binaries or duplicated libraries. Use a production-only install for packaging and check for packages that ship prebuilt binaries for every platform when you only target one. - Split per-platform and per-arch builds. Building a universal macOS binary or a bundle containing both x64 and arm64 native modules roughly doubles the native payload. Separate artifacts per architecture are larger in count but smaller individually.
- Trim locales and unused Electron features. Chromium ships many locale files and optional components; if your audience is single-language, dropping unused locales is a common reduction.
- Compress the installer. electron-builder's NSIS target supports compression settings, and higher compression trades build time for a smaller download. This helps the installer, not the installed footprint.
- Check whether "portable" is the right target. A portable build is typically a self-extracting or single-file form and can end up larger than a normal installer because it carries the full app uncompressed or lightly compressed.
Choosing between installer and portable
| Goal | Better fit | Trade-off |
|---|---|---|
| Smallest download | Compressed installer | Slower install, writes to disk |
| No installation, run from USB | Portable build | Often larger file, slower first launch |
| Smallest installed footprint | Installer with trimmed files | Requires uninstall to remove |
H3. A concrete first step Run a build, then open the produced artifact and list the largest entries inside the app bundle. In most Electron projects the top offenders are duplicated native modules, bundled Chromium locales, and stray development files. Fixing those usually beats any packaging-level compression setting.
For configuration specifics on files patterns, ASAR and target compression, the project's own documentation is the right reference: electron-builder.
Which update providers and rollout strategies does electron-builder support for distributing updates?
electron-builder supports auto-updating through its companion library, electron-updater. According to the project's own description, it handles updates with "differential updates, staged rollouts, and multiple providers," and the providers named on the page are GitHub Releases and S3, with "more" implied beyond those examples.
H3 Update providers
- GitHub Releases — convenient when your code and releases already live on GitHub; no separate hosting to manage.
- S3 — useful if you want your own bucket, custom access rules, or to serve from infrastructure you already pay for.
- Other providers — the page states "and more" without listing them, so treat the full set as broader than the two named here.
H3 Rollout strategies
- Differential updates — ship only the changed parts of a build rather than the whole package, which reduces download size for users on slow or metered connections.
- Staged rollouts — release to a subset of users first so you can catch regressions before everyone receives the update.
H3 How to choose If you already publish on GitHub, GitHub Releases is the lowest-friction starting point. If you need private distribution, granular access control, or region-specific delivery, S3 is the more flexible option. For a small user base, staged rollouts may be unnecessary overhead; for a large one, they are cheap insurance against a bad release reaching everyone at once.
Next step: check the electron-updater documentation for your chosen provider's exact configuration keys before wiring it into your build pipeline. The main trade-off is that auto-update support adds signing and hosting setup work up front, which you should weigh against manual download-and-reinstall flows.
User reviews (0)