Flatpak Concepts

Application ID

Every application needs a unique application ID, based on a reversed domain name. For example org.gnome.Maps. All resources exported by the application must be prefixed by this identifier. This includes the desktop file, the appdata file for the application, and any icons referenced by the desktop file.

Appdata

The appdata file for a Flatpak is used for displaying information about the application prior to installation. See Fedora Packaging Guidelines for AppData Files.

Runtimes and bundled libraries

When a Flatpak is executed, the files that the application see come from two places:

  • The Flatpak runtime, mounted at /usr. This contains libraries and data files shared by all Fedora Flatpaks. There are runtimes for each Fedora release.

  • The Flatpak application, mounted at /app. This contains the application code itself, but also contains any libraries that are bundled with the application. The application and libraries must be rebuilt with this prefix - this is done by rebuilding them for flatpaks.

RPM builds

Packaging flatpaks in Fedora makes use of RPM builds. The application and bundled libraries are rebuilt in Fedora’s build system (Koji) with a special build target - this gives a couple of advantages:

  • The same RPM spec file used to create the regular RPM build is also used to create the Flatpak RPM build.

  • The Flatpak RPM build target has a different buildroot configuration with macros that result in RPMs being built with a prefix of /app.

Note that Flatpak RPM builds will not work outside the Flatpak context, since they are rebuilt with a prefix of /app with the same name as system libraries - you cannot use dnf install to install them.

OCI Images

For Fedora, Flatpak runtimes and applications are built as OCI Images and distributed via https://registry.fedoraproject.org. This allows Flatpaks to be handled in a very similar way to server side containers. (Flatpaks are also commonly distributed via ostree.)