In this guide we show you how to install Flatpak on Ubuntu 18.04 LTS and above to unlock a world of new and updated software via Flathub.
Recent versions of Ubuntu come with support for Snap apps out of the box — but Snaps aren’t the only universal package format on the scene.
Regular readers will have noticed an uptick in the number of Flatpak apps we mention on these very pages. Indeed, it was an omg! reader who asked if I could put together a step-by-step guide on how to install Flatpak in Ubuntu, explain how to set up the Flathub repo, and show you how to install Flatpak apps.
The official Flatpak website has a great setup guide covering multiple distributions. The guide that follows is adapted from that, but with added screenshots, background details, and pointers to walk you though the process, step by step.
What is Flatpak?
Flatpak is a ‘next-generation’ Linux app format developed by Red Hat and used in Fedora.
It’s similar to Snappy in many ways: apps are sandboxed; come bundled up with everything they need to run; and support automatic updates in the background.
Because these technologies allow Linux users to install apps regardless of which distro or package manager they use, more and more software developers are choosing to distribute apps using these new methods.
Build once, run everywhere is a strong sell. Dependencies were the main headache in packaging software for different Linux distributions, something Flatpak (like Snaps) ‘solves’.
And by using OSTree Flatpak enables developers to create a complete app bundle that contains all of the dependencies, libraries and other files needed to run their program.
Because Flatpak apps are run in isolation from the rest of the system, it’s possible to run multiple versions of the same program at the same time (e.g., nightly and stable).
Flatpak apps also have to ask for permission before they can access hardware (e.g., web cam); read or open files outside of the sandbox; or use location detection technologies like geoclue. In all, Flatpaks gives you far greater control over the software you run.
So why use Flatpak? There are a few key reasons:
- No dependency incompatibilities
- More control over what apps can do
- Get app updates sooner
- Access a wider range of software
- Get updates direct from app developers
There are plenty of other reasons why you might want to use this new-fangled app format, so feel free to expand on this in the comments section.
How to Install Flatpak on Ubuntu 18.04 LTS +
If you run Ubuntu 18.04 LTS or later you can install Flatpak on Ubuntu using the Ubuntu Software tool — though you can’t search for it by name.
Instead, hit this button:
A small prompt will appear asking you to OK the installation:
Click ‘Install’ and let it do its thing!
Add the Flatpak PPA
One ‘catch’ to installing the version of Flatpak which is available through Ubuntu Software tool is that it’s (usually) out of date.
New versions of Flatpak are released regularly but those updates are not pushed out to Ubuntu users, not automatically.
If you want to install the latest version of Flatpak on Ubuntu (and chances are you do) then add the following official Flatpak PPA to your software sources. The PPA supports Ubuntu 16.04 LTS and above:
sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt update && sudo apt install flatpak
But you’re not done yet…
Install the Flatpak software plugin
To install Flatpak apps without needing to use the command line you need to install the Flatpak plugin for Ubuntu Software:
sudo apt install gnome-software-plugin-flatpak
This plugin allows the Software app to handle .flatpakref files, which are sort of like .torrent files: they don’t contain the download itself, but where to get it from.
Which leads us on to…
How to Use Flathub on Ubuntu
Flathub is the leading app store for Flatpak apps. More and more developers are choosing both Flatpak and Flathub as a primary distribution method, making it a real no-brainer: you’ll want to add this.
What is Flathub?
Canonical’s Snappy is proving a big hit with developers and users alike. Part of its success is in its simplicity. It has a single, centralised ‘app store’ (of sorts) where devs upload their Snap apps to, and users download Snap apps from.
Snapd (the tool for installing and managing snaps on Linux) is configured to use this store by default, ensuring that every Ubuntu user has access to hundreds of apps out of the box.
The good news is that Flatpak also has an ‘app store’ of sorts, called Flathub. Like the Snap store, Flathub acts as a centralised repository that any user can install Flatpak apps from, and any app developer can add their apps to.
How to add Flathub Repo
To install Flathub on Ubuntu run this command:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
You’ll be prompted to enter your password to authorise the change.
And then… That’s almost it! All you need to do now is restart your computer so that all the necessary components lock into place correctly.
When your system comes back up you’ll be set; you have everything you need to install Flatpak apps on Ubuntu using Ubuntu Software or the Flathub website.
How to Install Apps from Flathub
If you installed the Flatpak software plugin mentioned earlier in this guide then you’re all set: you can install Flatpak apps by searching in the Ubuntu Software center.
The downside is you may find it difficult to tell which apps are Flatpaks, and which apps are Snaps or regular repo software.
Keep an eye out for the “source: flathub.org” text in Software search results:
You can also browse and install apps from Flathub using a web browser. Just point your browser towards the Flathub website to get started.
Here you can browse apps on Flathub based on their category (Utility, Games, etc) or search for apps by name (e.g., ‘GIMP’, ‘Spotify’, etc).
When you find an app you want to install all you have to do is click through to its store listing page and click the “Install” button (1).
You’ll see a dialog asking you which app you want to open the .flatpakref file with. Make sure that “Software install (default)” is selected (2):
This will start installation of the Software:
Ubuntu Software will open up and you’ll be able to see the pgoress of installation.
This is how you can enable Flatpak and install Flatpak apps from Flathub in Ubuntu. Drop a comment below if you are facing difficulties with Flatpak.