Guide · Open source
How to use Electron: install, build and ship desktop apps
Updated · written with AI from the project's own documentation and checked against our catalogue data
Electron is an open-source framework for building desktop applications with JavaScript, HTML and CSS. It is based on Node.js and Chromium, and the README notes that apps such as Visual Studio Code are built with it. This guide shows how to install Electron into a project, what platforms it supports, and where to find the next steps for building your own app.
Quick start
- 1Install Node.js and npm. Make sure Node.js and npm are available on your machine. The README does not state a required Node.js version.
- 2Create or open your app folder. Go to the project folder where your app's code lives.
- 3Install Electron as a dev dependency. Run npm install electron --save-dev to add Electron to your project.
- 4Check platform support. Confirm your target operating systems and architectures are among the macOS, Windows and Linux binaries listed.
- 5Read the docs and try examples. Use the Electron documentation and Electron Fiddle to learn the APIs before building your app.
What Electron is and who it is for
Electron lets you write desktop applications using web technologies instead of platform-specific languages. The same code can run on macOS, Windows, and Linux.
It suits web developers who want to ship a desktop app with skills they already have, teams that need one codebase across three operating systems, and developers building editor-style or tool-style apps with web UIs.
What you need before you install Electron
The main prerequisites are Node.js and npm. The README does not state a required Node.js version, so check the installation docs for current details.
- Node.js (version not stated in the README)
- npm
Install Electron in your app
The preferred method is to install Electron as a development dependency in your app using npm. Run the command from your project folder.
For more installation options and troubleshooting tips, see the installation docs in the repository. For how to manage Electron versions in your apps, see the Electron versioning guide.
npm install electron --save-devCheck which platforms are supported
Each Electron release provides binaries for macOS, Windows, and Linux. Electron generally aligns with Chromium on platform support.
- macOS (Ventura and up): 64-bit Intel and Apple Silicon / ARM binaries
- Windows (Windows 10 and up): x64 (amd64) and arm64 binaries
- Linux: x64 (amd64) and arm64 binaries, for major distributions such as Ubuntu, Fedora and Debian in versions still supported by both Chromium and the distro maker. Prebuilt binaries are built on Ubuntu.
Learn Electron with Fiddle and the docs
Electron Fiddle is a tool to build, run, and package small Electron experiments. It shows code examples for Electron's APIs and lets you try different Electron versions, which makes it a good starting point.
The full documentation is at electronjs.org/docs. Community resources for getting help and finding third-party tools and sample apps are on the Community page.
- electronjs.org/docs: all of Electron's documentation
- electron/fiddle: build, run and package small experiments
Use Electron from Node scripts
Most people run Electron from the command line. If you require electron inside a Node app (not an Electron app), it returns the file path to the binary, which you can use to spawn Electron from Node scripts.
const electron = require('electron')
const proc = require('node:child_process')
console.log(electron)
const child = proc.spawn(electron)What people use it for
- Building a code editor with a web-based interface, as Visual Studio Code does
- Shipping one desktop tool that runs on macOS, Windows and Linux from a single codebase
- Creating a desktop front end for a web developer's existing JavaScript, HTML and CSS skills
- Experimenting with Electron APIs and versions using Electron Fiddle
Frequently asked questions
How do I install Electron?
Install it as a development dependency in your app with npm install electron --save-dev. The README calls this the preferred method. Prebuilt binaries are used, and more options are in the installation docs.
Is Electron free to use?
Yes. The repository is licensed under the MIT License, as stated in the README. Check the LICENSE file for the full terms.
What are the requirements for Electron?
You need Node.js and npm. The README does not state a specific Node.js version, so check the installation docs. Electron provides binaries for macOS (Ventura and up), Windows 10 and up, and Linux.
Which operating systems does Electron support?
Each release provides binaries for macOS, Windows, and Linux. Intel and Apple Silicon are covered on macOS, and x64 and arm64 on Windows and Linux.
What are the alternatives to Electron?
The comparable projects listed for this directory are Tauri, NW.js and Neutralinojs. Compare them on the factors that matter to you, such as bundle size, memory use and the runtime each one uses.
Why is Electron considered heavy?
Each app bundles a Chromium and Node.js runtime, based on the README's description of its base components. This can mean larger downloads and more memory use than apps that need minimal resources.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Electron suits web developers who want a desktop app across macOS, Windows and Linux from one JavaScript, HTML and CSS codebase, and it is MIT licensed. If you only want to use an existing desktop app, or need very small downloads and low memory use, or want native platform UI toolkits, consider another option such as Tauri, NW.js or Neutralinojs.
Install options & downloads