How to Install Flatpak on Debian Linux

Flatpak provides a universal packaging system that lets you install applications in isolated sandboxes, separate from your base system. As a result, this approach simplifies installing the latest software versions directly from developers, running applications that may not be packaged for Debian, and maintaining consistent behavior across different Linux distributions. Common use cases include installing proprietary applications like Discord on Debian, Steam on Debian, and Spotify, accessing newer versions of creative tools like GIMP and Blender, and running software with specific dependency requirements without affecting system libraries.

By the end of this guide, you will have Flatpak installed on Debian with access to thousands of applications through the Flathub repository. Additionally, you will learn how to browse and install applications using either GNOME Software or KDE Plasma Discover, manage Flatpak applications from the terminal, and properly remove Flatpak if needed.

Update Debian Before Flatpak Installation

First, before installing new packages, update your system to ensure package lists are current and avoid dependency conflicts:

sudo apt update && sudo apt upgrade

Install Flatpak on Debian

Debian includes Flatpak in its standard repositories across all supported versions, so you do not need any additional repository configuration. Therefore, install Flatpak with:

sudo apt install flatpak

Next, verify the installation by checking the version:

flatpak --version
Flatpak 1.x.x

The version number varies by Debian release, but all currently supported versions work identically for the commands in this guide.

Add the Flathub Repository

Flathub is the primary repository for Flatpak applications, hosting thousands of applications from individual developers, open-source projects, and commercial vendors. To access these applications, add Flathub to your system:

sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Then, verify that Flatpak recognizes Flathub:

flatpak remotes
flathub	system

Apply Flatpak Environment Paths

Flatpak requires specific environment variables and XDG paths for applications to appear in your desktop menu and function correctly. To apply these changes, log out and back in. In most cases, logging out and back in resolves the issue. You only need a full system reboot if applications still do not appear after re-logging:

sudo reboot

Try logging out and back in first. Only reboot if Flatpak applications still do not appear in your menu or fail to launch.

Install Flatpak Applications with GNOME Software

For users who prefer a graphical interface, GNOME Software provides an easy way to browse, install, and manage Flatpak applications. This section covers setup for GNOME desktop users. For additional GNOME customization options, see how to install GNOME Tweaks on Debian.

Install the GNOME Software Flatpak Plugin

First, install the Flatpak plugin to enable Flathub integration in GNOME Software:

sudo apt install gnome-software-plugin-flatpak

After installation, restart GNOME Software or log out and back in for the plugin to take effect.

Browse and Install Applications in GNOME Software

Once the plugin is active, open GNOME Software from your application menu (labeled “Software”). With the Flatpak plugin installed, you can now browse Flathub applications directly:

  1. Use the search bar to find a specific application or browse categories.
  2. Click an application to view its description, screenshots, and reviews.
  3. Click “Install” to download and install the application.

Once installation completes, applications appear in your system’s application menu. From there, you can launch, update, or remove them through GNOME Software.

Install Flatpak Applications with KDE Plasma Discover

Alternatively, KDE Plasma users can use Discover, the KDE software center, to manage Flatpak applications. Install the Flatpak backend:

sudo apt install plasma-discover-backend-flatpak

After installation, restart Discover or log out and back in. Subsequently, Flathub applications will appear alongside distribution packages when searching for software.

Manage Flatpak Applications from Terminal

The Flatpak command-line interface provides full control over application management. Moreover, these commands work regardless of your desktop environment.

Search for Applications

To search for applications by name or keyword, run:

flatpak search gimp
GNU Image Manipulation Program  Create images and edit photographs  org.gimp.GIMP  x.x.x  stable  flathub

As shown above, the output displays tab-separated columns: application name, description, application ID, version, branch, and source repository. Use the application ID (such as org.gimp.GIMP) for installation commands.

Install Applications

Once you find an application, install it using the application ID from the search results:

flatpak install flathub org.gimp.GIMP

During installation, Flatpak will prompt you to confirm and display any required runtimes that will be downloaded.

By default, flatpak install installs applications system-wide, making them available to all users. To install for the current user only, add the --user flag: flatpak install --user flathub org.gimp.GIMP

View Application Details

To check details about an installed application, run:

flatpak info org.gimp.GIMP
GNU Image Manipulation Program - Create images and edit photographs

          ID: org.gimp.GIMP
         Ref: app/org.gimp.GIMP/x86_64/stable
        Arch: x86_64
      Branch: stable
     Version: x.x.x
     License: GPL-3.0+ AND LGPL-3.0+
      Origin: flathub
Installation: system
     Runtime: org.gnome.Platform/x86_64/xx
         ...

As you can see, the output shows the application ID, reference path, architecture, branch, version, license, origin repository, installation scope, and runtime dependency. Additionally, fields like commit hash and installation size appear for installed applications.

List Installed Applications

To view all installed Flatpak applications, run:

flatpak list --app

In this command, the --app flag filters the output to show only applications, excluding runtimes and extensions.

Update Applications

To update all installed Flatpak applications and runtimes, run:

flatpak update

Alternatively, to update a specific application only:

flatpak update org.gimp.GIMP

Remove Applications

To uninstall a Flatpak application, run:

flatpak uninstall org.gimp.GIMP

Afterward, clean up unused runtimes and dependencies:

flatpak uninstall --unused

Essentially, this command removes shared runtimes that are no longer required by any installed application, freeing disk space.

Run Applications from Terminal

To launch a Flatpak application directly from the terminal, run:

flatpak run org.gimp.GIMP

In particular, this is useful for debugging or when an application does not appear in your desktop menu.

Flatpak Application Data Location

Flatpak applications store user data, configuration files, and cache in a dedicated directory: ~/.var/app/

Specifically, each application has its own subdirectory named after its application ID. For example, GIMP stores its data in ~/.var/app/org.gimp.GIMP/. When backing up application settings or performing a complete removal, include this directory.

Troubleshoot Common Flatpak Issues

Application Does Not Appear in Menu

If a newly installed application does not appear in your desktop menu, the desktop environment may not have detected the new .desktop file. Initially, try logging out and back in. However, if the issue persists, run:

flatpak list --app

First, verify that Flatpak shows the application in its list, then launch it from the terminal using flatpak run [application_id] to confirm it works. Generally, a full system reboot resolves menu visibility issues.

Portal-Related Errors

Flatpak applications use XDG Desktop Portals to interact with system features like file dialogs and screen sharing. If you see errors like the following when launching applications:

No portal found for org.freedesktop.portal.FileChooser
Failed to create portal proxy: No such interface

To fix this, install the portal package for your desktop environment:

sudo apt install xdg-desktop-portal-gtk

However, for KDE Plasma, install the KDE-specific portal instead:

sudo apt install xdg-desktop-portal-kde

After installing the portal package, log out and back in to start the portal services. Then verify the portal is running:

systemctl --user status xdg-desktop-portal
● xdg-desktop-portal.service - Portal service
     Loaded: loaded
     Active: active (running)

Permission Issues with Files or Devices

Flatpak applications run in sandboxes with limited filesystem access by default. If an application cannot access specific files or devices, you may see errors like:

Permission denied: /home/user/Documents/file.txt
Cannot access /dev/video0: Operation not permitted

The flatpak override command grants additional access. For example, to give GIMP access to your home directory:

flatpak override --user --filesystem=home org.gimp.GIMP

Next, verify that Flatpak applied the override:

flatpak info --show-permissions org.gimp.GIMP | grep filesystems
filesystems=xdg-config/GIMP:create;xdg-config/gtk-3.0;/tmp;host;home;

The --user flag applies the override for the current user only. To apply system-wide (for all users), replace --user with --system and run with sudo.

Alternatively, for a graphical tool to manage Flatpak permissions, consider installing Flatseal from Flathub.

Remove Flatpak from Debian

If you decide to remove Flatpak from your system, begin by uninstalling all Flatpak applications:

flatpak uninstall --all

Then, remove the Flathub remote (and any other configured remotes):

flatpak remote-delete flathub

Next, remove Flatpak and the software center plugins:

sudo apt remove --purge flatpak gnome-software-plugin-flatpak plasma-discover-backend-flatpak

Then, clean up orphaned dependencies:

sudo apt autoremove

Remove Flatpak User Data

Flatpak application data remains in ~/.var/app/ after uninstalling applications and Flatpak itself. To remove all Flatpak-related user data:

Warning: This permanently deletes all configuration, saves, and cache data for every Flatpak application. Back up any important data first. This action cannot be undone.

rm -rf ~/.var/app/

When you purge the flatpak package, APT also removes the system-wide data in /var/lib/flatpak/. To verify complete removal:

Verify Flatpak Removal

Finally, confirm Flatpak is no longer installed:

which flatpak

This command should return no output. You can also verify no remotes remain:

flatpak remotes
bash: flatpak: command not found

Conclusion

You now have Flatpak configured on Debian with access to Flathub’s application library. The key techniques covered include installing and verifying Flatpak, adding the Flathub repository, integrating with GNOME Software or KDE Plasma Discover for graphical management, and using terminal commands to search, install, update, and remove applications. For production desktop use, consider setting up automatic Flatpak updates and exploring Flatseal for granular permission management. To expand your Debian software options further, you can also install Firefox on Debian using Flatpak or other methods, or explore Snapd as an alternative package manager on Debian.

Leave a Comment