Encrypting Firefox Snap User Data in Ubuntu 22.04 – How to Guide

22.04encryptionfirefoxsnap

With the regular firefox package, I was able to move my ~/.mozilla folder to a eCryptFS Private directory and symlink it to encrypt all my profile data (cookies, history, etc) and make this transparent to Firefox.

Now, with the snap package being the default installation method for Firefox, I'm not really sure where the data is stored… ~/snap/firefox/common appears to be mounted from /var/lib/snapd/snaps/firefox_XXXX.snap, which is some kind of file system on its own managed entirely by snapd, so how am I supposed to encrypt it now (other than encrypt full disk)?

Best Answer

The application is indeed inside a compressed file in /var/lib/snapd/snaps, like all snaps. It's mounted underneath /snap/firefox as a read-only mount.

Your personal data is indeed in your home under ~/snap/firefox. I haven't tried moving that folder to an eCryptFS location, but it may be possible. Just be aware that the Firefox snap is strictly confined so there's limited locations you can put the eCryptFS and it still be accessible to Firefox. Specifically don't put it outside $HOME and don't put it in a hidden folder in your $HOME.

Related Question