Linux Packaging
Package Formats
Section titled “Package Formats”Package your app for Linux distribution:
wails3 package GOOS=linuxThis creates multiple formats in the bin/ directory:
- AppImage: Portable, runs on any Linux distribution
- DEB: For Debian, Ubuntu, and derivatives
- RPM: For Fedora, RHEL, and derivatives
- Arch: For Arch Linux and derivatives
Individual Formats
Section titled “Individual Formats”Build specific formats:
wails3 task linux:create:appimagewails3 task linux:create:debwails3 task linux:create:rpmwails3 task linux:create:aurCustomizing Packages
Section titled “Customizing Packages”Desktop Entry
Section titled “Desktop Entry”The .desktop file controls how your app appears in application menus. It’s generated from values in build/linux/Taskfile.yml:
vars: APP_NAME: 'MyApp' EXEC: 'MyApp' ICON: 'MyApp' CATEGORIES: 'Development;'Package Metadata
Section titled “Package Metadata”Edit build/linux/nfpm/nfpm.yaml to customize DEB and RPM packages:
name: myappversion: 1.0.0maintainer: Your Name <you@example.com>description: My awesome Wails applicationhomepage: https://example.comlicense: MITAppImage
Section titled “AppImage”AppImage configuration is in build/linux/appimage/. The app icon comes from build/appicon.png.
Signing Packages
Section titled “Signing Packages”Sign DEB and RPM packages with a PGP key:
# Using the wrapper (auto-detects platform)wails3 sign GOOS=linux
# Or using tasks directlywails3 task linux:sign:debwails3 task linux:sign:rpmwails3 task linux:sign:packages # BothConfigure signing in build/linux/Taskfile.yml:
vars: PGP_KEY: "path/to/signing-key.asc" SIGN_ROLE: "builder" # origin, maint, archive, or builderStore your key password:
wails3 setup signingSee Signing Applications for details.
Building for ARM
Section titled “Building for ARM”wails3 build GOOS=linux GOARCH=arm64wails3 package GOOS=linux GOARCH=arm64GTK4 Support (Experimental)
Section titled “GTK4 Support (Experimental)”Wails v3 includes experimental support for GTK4 with WebKitGTK 6.0. By default, Wails uses GTK3 with WebKit2GTK 4.1. GTK4 support is opt-in via a build tag.
Dependencies
Section titled “Dependencies”Install GTK4 and WebKitGTK 6.0 development libraries:
# Ubuntu/Debiansudo apt install libgtk-4-dev libwebkitgtk-6.0-dev
# Fedorasudo dnf install gtk4-devel webkitgtk6.0-devel
# Archsudo pacman -S gtk4 webkitgtk-6.0The required pkg-config packages are gtk4 and webkitgtk-6.0.
Building with GTK4
Section titled “Building with GTK4”Use the -tags gtk4 flag:
wails3 build -tags gtk4Or directly with Go:
go build -tags gtk4 -o myapp .Known Differences from GTK3
Section titled “Known Differences from GTK3”- File dialogs: GTK4 uses
xdg-desktop-portalfor file dialogs, which means some dialog options (like default directory, custom filters display) behave differently. See Dialogs Reference - Linux GTK4 Limitations for details. - Menu style: GTK4 supports a
LinuxMenuStylePrimaryMenuoption that displays a hamburger button (☰) in the header bar, following GNOME HIG. See Window API - Linux MenuStyle. - DPI scaling: GTK4 uses
gdk_monitor_get_scale(GTK 4.14+) for fractional scaling support.
Checking Your Build
Section titled “Checking Your Build”Run wails3 doctor to verify your setup. GTK4 dependencies will be shown as optional/experimental.
Troubleshooting
Section titled “Troubleshooting”AppImage won’t run
Section titled “AppImage won’t run”Make it executable:
chmod +x MyApp-x86_64.AppImageMissing dependencies
Section titled “Missing dependencies”If the app fails to start, check for missing WebKit dependencies:
# Debian/Ubuntusudo apt install libwebkit2gtk-4.1-0
# Fedorasudo dnf install webkit2gtk4.1
# Archsudo pacman -S webkit2gtk-4.1No C compiler found
Section titled “No C compiler found”The build system needs GCC or Clang for CGO:
# Debian/Ubuntusudo apt install build-essential
# Fedorasudo dnf install gcc
# Archsudo pacman -S base-develAlternatively, run wails3 task setup:docker and the build system will use Docker automatically.
AppImage strip compatibility
Section titled “AppImage strip compatibility”On modern Linux distributions (Arch Linux, Fedora 39+, Ubuntu 24.04+), system libraries are compiled with .relr.dyn ELF sections for more efficient relocations. The linuxdeploy tool used to create AppImages bundles an older strip binary that cannot process these modern sections.
Wails automatically detects this situation by checking system GTK libraries before building the AppImage. When detected, stripping is disabled (NO_STRIP=1) to ensure compatibility.
What this means:
- AppImages will be slightly larger (~20-40%) on affected systems
- The application functionality is not affected
- This is handled automatically—no action required
If you need smaller AppImages on modern systems, you can install a newer strip binary and configure linuxdeploy to use it instead of its bundled version.