A comprehensive bash script to convert compiled Linux applications into portable AppImage files.
- ✅ Automatic executable detection
- ✅ Dependency bundling (shared libraries)
- ✅ Automatic .desktop file generation
- ✅ Icon detection and packaging
- ✅ Downloads appimagetool automatically
- ✅ Creates proper AppDir structure
- ✅ Includes AppRun launcher with proper environment setup
- Linux system (x86_64)
- bash
- wget (for downloading appimagetool)
- Basic utilities (find, ldd, cp, etc.)
- Download the script:
wget https://your-url/create-appimage.sh
chmod +x create-appimage.shOr simply make it executable if you already have it:
chmod +x create-appimage.sh./create-appimage.sh <app-folder>The script will auto-detect the executable and create an AppImage with default settings.
./create-appimage.sh <app-folder> <app-name>./create-appimage.sh <app-folder> <app-name> <version># You have a folder structure like:
myapp/
├── myapp (executable)
├── config.txt
└── data/
# Create AppImage:
./create-appimage.sh ./myapp
# Output: myapp-1.0-x86_64.AppImage# Specify the app name:
./create-appimage.sh ./myapp "My Cool App" 2.1
# Output: My Cool App-2.1-x86_64.AppImage# Application folder structure:
myapp/
├── bin/
│ └── myapp (executable)
├── lib/
│ ├── libcustom.so
│ └── libhelper.so.1
├── share/
│ ├── icon.png
│ └── data/
└── README.md
# Create AppImage:
./create-appimage.sh ./myapp MyApplication 3.0
# The script will:
# - Detect the executable in bin/
# - Copy all .so files from lib/
# - Detect and bundle system dependencies
# - Use icon.png as the application icon
# - Create: MyApplication-3.0-x86_64.AppImage- Validates Input: Checks if the application folder exists
- Detects Executable: Finds the main executable file
- Creates AppDir Structure:
AppName.AppDir/ ├── AppRun (launcher script) ├── AppName.desktop ├── AppName.png (icon) ├── AppName (main executable) └── usr/ ├── bin/ (application files) ├── lib/ (bundled libraries) └── share/ (desktop file and icon) - Bundles Dependencies: Uses
lddto detect and copy required shared libraries - Creates Metadata: Generates .desktop file and copies/creates icon
- Builds AppImage: Uses appimagetool to package everything
Your application folder should contain:
- At least one executable file
myapp/
├── myapp (or bin/myapp) # Main executable
├── *.so* files # Shared libraries (if any)
└── icon.png (optional) # Application icon
Flat Structure:
myapp/
├── myapp
├── libcustom.so
└── data/
Organized Structure:
myapp/
├── bin/
│ └── myapp
├── lib/
│ └── *.so
└── share/
└── icon.png
Complex Structure:
myapp/
├── myapp
├── lib/
├── plugins/
├── resources/
└── config/
The script automatically:
- Detects dependencies using
ldd - Copies non-system libraries (libraries not in /lib or /usr/lib)
- Includes any .so files found in your application folder
- Sets up
LD_LIBRARY_PATHin the AppRun launcher
If you need to add specific libraries, place them in your application folder before running the script:
myapp/
├── myapp
└── extra-libs/
└── libspecial.soThe script searches for icons in this order:
- Files matching
*icon*.png,*icon*.svg, or*icon*.ico - Files matching
{appname}.png,{appname}.svg, or{appname}.ico
If no icon is found:
- Creates a placeholder icon (if ImageMagick is installed)
- Or creates an empty icon file
Place a PNG icon in your application folder:
myapp/
├── myapp
└── icon.png (256x256 recommended)- Make sure your executable has execute permissions:
chmod +x myapp/myapp - Verify the file is actually an executable:
file myapp/myapp
- Check if all dependencies are bundled:
ldd myapp/myapp - Try running with
APPIMAGE_EXTRACT_AND_RUN=1 ./MyApp.AppImage - Extract and debug:
./MyApp.AppImage --appimage-extract
- The script bundles non-system libraries automatically
- For system libraries, ensure they're available on target systems
- Use
lddto check what's missing
- Remove unnecessary files from your application folder before creating AppImage
- Consider excluding documentation or dev files
The AppRun launcher sets up:
LD_LIBRARY_PATH- for bundled librariesPATH- includes the usr/bin directoryXDG_DATA_DIRS- for application data
After the script completes, you can:
- Extract the AppImage:
./MyApp-1.0-x86_64.AppImage --appimage-extract-
Modify the extracted
squashfs-root/directory -
Recreate the AppImage:
appimagetool-x86_64.AppImage squashfs-root/ MyApp-1.0-custom-x86_64.AppImageThe script creates:
{AppName}-{Version}-x86_64.AppImage- The final AppImage file- Downloads
appimagetool-x86_64.AppImage(if not present) - Kept for future use
# Make executable (script does this automatically)
chmod +x MyApp-1.0-x86_64.AppImage
# Run it
./MyApp-1.0-x86_64.AppImage
# Test on different system
scp MyApp-1.0-x86_64.AppImage user@othersystem:
ssh user@othersystem './MyApp-1.0-x86_64.AppImage'# Ensure Qt libraries are in the app folder
myapp/
├── myapp
└── lib/
├── libQt5Core.so.5
├── libQt5Gui.so.5
└── libQt5Widgets.so.5
./create-appimage.sh ./myapp "My Qt App" 1.0# After PyInstaller creates dist/myapp/
./create-appimage.sh ./dist/myapp# Static binary (no dependencies)
myapp/
└── myapp
./create-appimage.sh ./myapp- The script creates x86_64 AppImages only
- System libraries (glibc, etc.) are not bundled - ensure compatibility with target systems
- AppImages work best with forward compatibility (run on newer systems than built on)
- For maximum compatibility, build on an older Linux distribution
This script is provided as-is for creating AppImages from your applications.
For AppImage-related questions, visit:
- AppImage Documentation: https://docs.appimage.org/
- AppImage GitHub: https://github.com/AppImage
For script issues, check the error messages - they're designed to be helpful!