flatpak Command Guide for Desktop Applications
The distro-independent way to install desktop apps, so Firefox 132 works on any Linux, whatever its age.
flatpak installs desktop applications as sandboxes: each app arrives with all of its own libraries, runs isolated from the rest of the system, and can be granted access to only the files and devices it needs. If you have ever wanted the current version of an app on a stable server-grade distro — or an app from a distro your machine is not — flatpak is usually the answer.
What is flatpak, and Why Use It?
- Version independence — apps come from the Flathub repository and carry their own runtime, so you get the latest release regardless of how old your distro is.
- One format everywhere — the same
.flatpakappinstall works on Ubuntu, Fedora, Arch, Debian — anything with flatpak support. - Sandboxing built in — an app sees its own files and nothing else until you explicitly grant it more (
--share=network, file access, and so on). - It coexists with the system manager — flatpak sits beside apt/dnf/pacman; system packages keep doing system work while flatpak handles desktop apps.
A flatpak is a desktop application that behaves the same way on every Linux you will ever meet — current version, contained blast radius, one command to install.
1. Adding the Flathub Repository
Flatpak itself ships with most distros, but the app repository — Flathub, the de-facto central store — needs adding once:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
--if-not-exists makes the command safe to re-run (as in scripts). Some distros preconfigure Flathub; a quick flatpak remotes will tell you whether you need this step.
2. Searching and Listing
# Search for apps by keyword
flatpak search text-editor
# List installed apps, runtimes, and remotes
flatpak list
# Show details about one app (version, size, permissions)
flatpak info org.gedit.Gedit
The output of flatpak list uses reverse-DNS app IDs (org.gimp.GIMP, com.spotify.Client). Those IDs are what install, remove, and permission commands use — Flathub’s website shows each app’s ID.
3. Installing an App
# Install the latest stable GIMP from Flathub
flatpak install flathub org.gimp.GIMP
flatpak resolves the app and its runtime (the shared base of libraries) automatically — the same dependency model as apt. A first install pulls the runtime too, so expect a download measured in hundreds of megabytes; later apps sharing that runtime add only their own size.
To install a local file instead (for example, one sent to you):
flatpak install --user ./MyApp.flatpakref
4. Running and Managing Apps
Installed apps appear in your normal application menu (the .desktop entries are wired up automatically). From the terminal:
# Run an installed app
flatpak run org.gimp.GIMP
# Update everything (all apps and runtimes)
flatpak update
# Remove an app (add --include-undepended to clean up orphaned runtimes)
flatpak uninstall org.gimp.GIMP
Forgetting the exact ID? flatpak run is forgiving with tab completion, and flatpak search will remind you.
5. Permissions: the Sandbox
This is flatpak’s signature feature. An app cannot read your home directory or touch the network unless granted:
# See what an app can currently reach
flatpak info --show-permissions org.gimp.GIMP
# Grant a permission (e.g., let the app use the network)
flatpak permission-set org.gimp.GIMP network yes
# Override sandbox restrictions at launch, e.g. allow home-directory access
flatpak run --filesystem=home org.gimp.GIMP
The general rule: start restrictive, grant only what the app actually needs, and prefer per-launch overrides (--filesystem=..., --share=...) for one-off tasks over permanent grants.
6. Common Pitfalls
- Installing without adding Flathub — on many distros
flatpak install org.gimp.GIMPfails with “no remote ref found”; the remote-add step in section 1 is the fix. - Forgetting runtimes — the first app install downloads a runtime (hundreds of MB); that is normal and shared by every later app based on it.
- Confusing app IDs —
gimpis notorg.gimp.GIMP; the ID comes from the app’s Flathub page, andflatpak searchis your friend. - Assuming the sandbox is invisible — a sandboxed app that cannot see
/homemay look broken (missing files, no printers); grant the specific access it needs rather than disabling the sandbox wholesale.
Related Pages
| Page | Why You’ll Open It |
|---|---|
| Package Management | How flatpak fits beside the distro’s own package manager. |
| apt | Ubuntu/Debian’s manager — system packages first, flatpak for the rest. |
| dnf | Fedora/RHEL’s manager; Fedora ships flatpak support out of the box. |
| sudo | Required for system-wide installs and remote configuration. |
flatpak Cheatsheet
| Command | What It Does |
|---|---|
flatpak remote-add --if-not-exists flathub <url> | Add the Flathub repository (once). |
flatpak search gimp | Search Flathub by keyword. |
flatpak list | Show installed apps and runtimes. |
flatpak info org.gimp.GIMP | Show an app’s details and permissions. |
flatpak install flathub org.gimp.GIMP | Install an app (pulls its runtime too). |
flatpak run org.gimp.GIMP | Run an installed app. |
flatpak update | Update all apps and runtimes. |
flatpak uninstall org.gimp.GIMP | Remove an app. |
flatpak info --show-permissions <app-id> | Show the app’s sandbox permissions. |
flatpak run --filesystem=home <app-id> | Run an app with extra access for one session. |