Linux Packaging
Ce contenu n’est pas encore disponible dans votre langue.
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.0description: 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=arm64Legacy GTK3 Support
Section titled “Legacy GTK3 Support”Wails v3 builds on GTK4 with WebKitGTK 6.0 by default. A legacy GTK3 / WebKit2GTK 4.1 path is still available for distributions that don’t yet ship WebKitGTK 6.0 (Ubuntu 22.04 LTS, Debian 12, Fedora ≤ 39, RHEL 9.x). The legacy path is opt-in via a build tag and is scheduled for removal in v3.1.
Dependencies
Section titled “Dependencies”Install GTK3 and WebKit2GTK 4.1 development libraries:
# Ubuntu/Debiansudo apt install libgtk-3-dev libwebkit2gtk-4.1-dev
# Fedorasudo dnf install gtk3-devel webkit2gtk4.1-devel
# Archsudo pacman -S gtk3 webkit2gtk-4.1The required pkg-config packages are gtk+-3.0 and webkit2gtk-4.1.
Building with GTK3
Section titled “Building with GTK3”Use the -tags gtk3 flag:
wails3 build -tags gtk3Or directly with Go:
go build -tags gtk3 -o myapp .Known Differences from GTK4
Section titled “Known Differences from GTK4”- File dialogs: GTK4 uses
xdg-desktop-portalfor file dialogs (the default), which means some dialog options (like default directory, custom filters display) behave differently from GTK3. See Dialogs Reference - Linux Dialog Behavior for details. - Menu style: GTK4 supports a
LinuxMenuStylePrimaryMenuoption that displays a hamburger button (☰) in the header bar, following GNOME HIG. This option has no effect on-tags gtk3builds. 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. With no flags it checks for GTK4 / WebKitGTK 6.0 (the default). The legacy GTK3 / WebKit2GTK 4.1 packages are listed as optional.
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.
Blank or white window on NVIDIA GPU
Section titled “Blank or white window on NVIDIA GPU”On Linux with NVIDIA proprietary drivers, Wails apps may show a blank or white window on startup. This is caused by a WebKitGTK bug where the DMA-BUF renderer fails with gbm_bo_map() against the NVIDIA proprietary driver (affects X11 and Wayland, driver versions 377–580+, GPUs from the 10 series and older GT 710).
Wails applies WEBKIT_DISABLE_DMABUF_RENDERER=1 automatically when it detects the NVIDIA kernel module (/sys/module/nvidia), so most users will not need to do anything.
If you still see a blank window (for example in a container where the module path is not visible), set the environment variable manually before launching your app:
WEBKIT_DISABLE_DMABUF_RENDERER=1 ./myappRelated upstream bugs: WebKit #262607, WebKit #180739.
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.