When installing applications using Flatpak you'll sooner or later run into a situation where the default filesystem access permissions the application has been given can get in the way. Sometimes you just want to use applications like Handbrake or MusicBrainz Picard with files located outside of your home folder. For those cases there is fortunately an easy way to give applications more filesystem access, either to specific folders or just to your whole filesystem (user permission permitting, of course).
As I keep forgetting how I did this whenever I run into a new app that needs additional filesystem permissions, I'm writing it down here for future reference.
First you'll have to look up the full identifier of the application you have installed using flatpak. I personally use
flatpak list to get a full list of all flatpak-installed applications and find it like that, but you can also find its identifier by checking out the URL of the application over at flathub.org.
Once you have that, you can use the following command to give the application full filesystem access:
sudo flatpak override <package identifier> --filesystem=<permission>
There are quite a few options you can set, but in my personal case I mostly only ever needed to set it to
host for full filesystem access if I want to change it. Here are some of the more commonly used options you can use:
home– access to your home directory and subdirectories.
host– full filesystem access (user permission permitting, of course)
~/specific/path/in/home– Specific path inside your home directory.
/specific/path– Specific absolute path
You can set the
--filesystem multiple times in the same command if you want to give access to multiple folders for example. For the full list of available options, please refer to man flatpak-override.
To give a more specific example, here is giving Handbrake full filesystem access:
sudo flatpak override fr.handbrake.ghb --filesystem=host
And the same for MusicBrainz Picard:
sudo flatpak override org.musicbrainz.Picard --filesystem=host
One more example if, for example, you want to give access to your home directory and one other specific folder. Let's use OpenMW for this example, just because.
sudo flatpak override org.openmw.OpenMW --filesystem=home --filesystem=/mnt/Data/Games/Morrowind
Once setting this option, be sure to restart the application for the changes to take full effect.
That's it! I hope this is useful to you.