Building and Signing Desktop Applications for Linux
Linux does not require mandatory code signing but provides several distribution formats with different audiences: AppImage (universal), Snap (Ubuntu), Flatpak (Fedora/Gnome).
Package formats
| Format | Store | Audience |
|---|---|---|
| AppImage | None (self-contained) | All distributions |
| Snap | Snapcraft | Ubuntu/Canonical ecosystem |
| Flatpak | Flathub | Fedora, Gnome-oriented |
| .deb | Custom repository | Debian/Ubuntu |
| .rpm | Custom repository | Fedora/RHEL/CentOS |
Electron-builder: AppImage and deb/rpm
# electron-builder.yml
linux:
target:
- target: AppImage
- target: deb
- target: rpm
icon: build/icons
category: Utility
deb:
depends: ['libnotify4', 'libxtst6', 'libnss3']
appImage:
systemIntegration: ask # ask on first launch
# Build
npx electron-builder --linux
AppImage: self-contained executable
AppImage contains all dependencies inside. User downloads one file, gives execute permissions, and runs it — without installation:
chmod +x AppName-1.0.0.AppImage
./AppName-1.0.0.AppImage
Snap package
# snapcraft.yaml
name: appname
version: '1.0.0'
summary: Application Name
description: |
Full description of the application.
grade: stable
confinement: strict
apps:
appname:
command: usr/lib/appname/appname
plugs:
- desktop
- network
- home
parts:
appname:
plugin: dump
source: dist/linux-unpacked
source-type: local
# Publish to Snap Store
snapcraft login
snapcraft upload appname_1.0.0_amd64.snap --release=stable
Flatpak
<!-- com.company.AppName.yml -->
app-id: com.company.AppName
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: appname
finish-args:
- --share=network
- --socket=x11
- --socket=wayland
- --filesystem=home
modules:
- name: appname
buildsystem: simple
build-commands:
- install -Dm755 appname /app/bin/appname
GPG package signing
# Sign deb package
dpkg-sig --sign builder AppName_1.0.0_amd64.deb
# Sign RPM
rpm --addsign AppName-1.0.0.x86_64.rpm
Timeline
Setup of AppImage + deb/rpm build + Snap publication: 2–3 business days.







