Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Packaging & Distribu | Electron.js Desktop App Development l | BraveProgrammer
  1. Courses
  2. /
  3. Electron.js Desktop App Development

Lesson 14 of 28

·javascript

Packaging & Distribution – electron‑builder

12 mins

Course progress50%

What you'll learn

Keep these ideas in mind as you work through the lesson.

4 points
  • `electron-builder` can output **installers** for all major OSes from a single command.
  • Specify which files to include with the `files` array – include the compiled renderer bundle.
  • Code‑signing is required for macOS Gatekeeper and Windows SmartScreen.
  • After the build you can upload the installer to GitHub releases for auto‑update discovery.

Packaging & Distribution – electron‑builder

electron‑builder is the most popular tool for creating installers for Windows (nsis), macOS (dmg, pkg) and Linux (AppImage, deb).

Install

npm install --save-dev electron-builder

Add build config to package.json

"build": {
  "appId": "com.example.myapp",
  "productName": "MyApp",
  "directories": { "output": "dist" },
  "files": [ "dist/**/*", "main/**/*", "preload/**/*", "package.json" ],
  "mac": { "target": "dmg" },
  "win": { "target": "nsis" },
  "linux": { "target": "AppImage" }
}

Scripts

"scripts": {
  "build": "electron-builder",
  "dist": "npm run build"
}

Run npm run build – you’ll get platform‑specific installers in the dist/ folder.

Code signing (macOS)

  1. Create an Apple Developer ID certificate.
  2. Add to build config:
"mac": {
  "identity": "Developer ID Application: Your Name (TEAMID)"
}

Code signing (Windows)

  • Obtain a code‑signing certificate (pfx file)
  • Add to config:
"win": {
  "certificateFile": "cert.pfx",
  "certificatePassword": "your‑password"
}
Make it stickPractice what you've learned1 quiz · 5 practical tests · Optional activities from Electron.js Desktop App DevelopmentBrowse activities
Previous lessonAuto‑Updates with electron‑updaterContinue to lesson 15Code Signing – macOS & WindowsBack to Electron.js Desktop App Development curriculum