linux configuration contains options for building Linux targets. These options apply to all Linux target types including AppImage, Snap, Flatpak, deb, and rpm.
Linux Targets Overview
AppImage
Universal Linux package format
Snap
Snapcraft package for Ubuntu and more
Debian
.deb packages for Debian-based systems
Base Linux Configuration
Thelinux key in your electron-builder configuration applies to all Linux targets:
For detailed Linux configuration options, see the LinuxConfiguration interface reference.
AppImage
AppImage is a universal Linux package format that runs on most Linux distributions without installation.Basic AppImage Configuration
- JSON
- YAML
Desktop Integration
Since electron-builder 21, desktop integration is not included in the AppImage file. AppImageLauncher is the recommended way to integrate AppImages with your desktop environment.
AppImage Example
Build an AppImage with custom icon and desktop entry:For complete AppImage configuration options, see the AppImageOptions interface reference.
Snap
Snap packages work across many Linux distributions and provide automatic updates.Basic Snap Configuration
- JSON
- YAML
Snap Confinement
Choose the appropriate confinement level:- strict - Full confinement with limited system access (recommended)
- classic - No confinement, full system access (requires manual review)
- devmode - Development mode with warnings instead of errors
Advanced Snap Configuration
For complete Snap configuration options, see the SnapOptions interface reference.
Debian Package
Create.deb packages for Debian, Ubuntu, and other Debian-based distributions.
Basic Debian Configuration
- JSON
- YAML
Package Scripts
Create post-install and pre-remove scripts: build/deb-postinstall.shMake sure scripts are executable:
chmod +x build/*.shDebian Package Priorities
- required - Essential for system operation
- important - Important but not essential
- standard - Standard system installations
- optional - Optional packages (default)
- extra - Conflicts with other packages
For complete Debian configuration options, see the DebOptions interface reference.
RPM Package
Create.rpm packages for Red Hat, Fedora, CentOS, and other RPM-based distributions.
Basic RPM Configuration
- JSON
- YAML
RPM Package Groups
Applications/InternetApplications/DevelopmentApplications/ProductivityApplications/MultimediaApplications/System
For complete RPM configuration options, see the LinuxTargetSpecificOptions interface reference.
Other Linux Targets
electron-builder supports additional Linux package formats:Flatpak
Pacman
APK
Target-Specific Configuration
Each target can have its own configuration:Icon Requirements
Linux builds require icons in multiple sizes. Create a directory structure:electron-builder will automatically generate the required icon sizes from a single 512x512 PNG file.
Building Multiple Targets
- CLI
- package.json
Desktop Entry
Customize the desktop entry for all Linux packages:Development- Development toolsUtility- Utility applicationsNetwork- Network applicationsGraphics- Graphics applicationsAudioVideo- Multimedia applicationsOffice- Office applications