Building your own AppImages with appimagetool
Portable Packages
© Lead Image © kurhan, 123RF.com
AppImage packages are highly portable and don't require dependencies. A tool called appimagetool will bundle your Python application into a single AppImage executable.
AppImage [1] is a format for packaging applications on Linux so they can run on most distributions without installation or root permissions. Instead of scattering files across the system, an AppImage bundles the application's executable, libraries, icons, and other resources into a single, self-contained file. You can download it, make it executable, and run it directly, much like a portable app on Windows or a macOS .app bundle. Because it carries its dependencies with it, an AppImage avoids many of the compatibility issues that arise from differences between Linux distributions. It also leaves the host system untouched, because it doesn't require modifying system directories or package managers. An AppImage is therefore a convenient way to distribute software to a wide audience while keeping the user's environment clean and easy to maintain.
Turning a Python script into a portable Linux application might sound like a task reserved for seasoned developers, but with the right tools, it's surprisingly easy. In this article, I will walk through the transformation step by step, starting with PyInstaller to bundle code and dependencies into a single executable. From there, I'll introduce appimagetool, the utility that packages this executable into an AppImage. Throughout this guide, I will elucidate the AppImage creation workflow, detailing the rationale behind each procedural step. Upon completion, you will possess a comprehensive grasp of the methodology required to build an AppImage.
Setting Up Your Linux Environment
To get the most out of this article, you'll need a basic understanding of Python, because the starting point will be a Python script. You will also need Python installed on your system, along with pip to manage packages, and the ability to install additional tools such as PyInstaller. For preparing the Python script that will eventually become your AppImage, you will want a reliable and comfortable coding environment. A code editor such as Visual Studio Code (Figure 1) is a good choice, offering syntax highlighting, intelligent code completion, integrated terminal access, and built-in Git support. Working in an editor like VS Code makes it easier to write and debug your script, and it also helps you keep your project organized as you move from development to packaging. Because the process involves running commands for PyInstaller, and later appimagetool, having the terminal right inside your editor means you can write, test, and package your application without constantly switching between windows. This streamlined workflow is especially valuable when you are fine-tuning your code before locking it into a portable, distributable format.
[...]
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Linux Kernel Project Releases Project Continuity Document
What happens to Linux when there's no Linus? It's a question many of us have asked over the years, and it seems it's also on the minds of the Linux kernel project.
-
Mecha Systems Introduces Linux Handheld
Mecha Systems has revealed its Mecha Comet, a new handheld computer powered by – you guessed it – Linux.
-
MX Linux 25.1 Features Dual Init System ISO
The latest release of MX Linux caters to lovers of two different init systems and even offers instructions on how to transition.
-
Photoshop on Linux?
A developer has patched Wine so that it'll run specific versions of Photoshop that depend on Adobe Creative Cloud.
-
Linux Mint 22.3 Now Available with New Tools
Linux Mint 22.3 has been released with a pair of new tools for system admins and some pretty cool new features.
-
New Linux Malware Targets Cloud-Based Linux Installations
VoidLink, a new Linux malware, should be of real concern because of its stealth and customization.
-
Say Goodbye to Middle-Mouse Paste
Both Gnome and Firefox have proposed getting rid of a long-time favorite Linux feature.
-
Manjaro 26.0 Primary Desktop Environments Default to Wayland
If you want to stick with X.Org, you'll be limited to the desktop environments you can choose.
-
Mozilla Plans to AI-ify Firefox
With a new CEO in control, Mozilla is doubling down on a strategy of trust, all the while leaning into AI.
-
Gnome Says No to AI-Generated Extensions
If you're a developer wanting to create a new Gnome extension, you'd best set aside that AI code generator, because the extension team will have none of that.

