Mozilla Firefox Web Browsers WordPress

How to Backup and Restore Firefox Profile On Linux

Backup and Restore Firefox Profile On Linux
Written by Martins D. Okoi

We recently published an article on how to backup and restore a Google Chrome profile on Linux, now, our concentration is on Firefox.

Like I did in the Chrome article, I’ll list the steps required to backup and restore your Firefox Profile. The listed commands are for you to copy and paste in your terminal after you may have edited them to suit your needs e.g. your preferred directory path. None of the terminal commands requires root access.

A backup of your Firefox profile enables you to save all your browser data (extensions, history, settings, etc.) on your local machine or any other storage medium so that you can restore it at a later time in case of a system failure, fresh installation, or migration. What’s cool about this method is that you don’t need to be connected to the Internet.

Firefox Profile Backup

1. Launch your terminal and navigate to the ~/.mozilla directory from your home folder with the following command.

$ cd ~/.mozilla

2. Use tar command to compress your entire ~/.mozilla directory into a GZip archive with the following command.

$ tar -jcvf firefox-browser-profile.tar.bz2 .mozilla

3. Once the compression is complete, move the archive file to any safe location of your choosing. This time around, let’s move the archive to the desktop folder.

$ mv firefox-browser-profile.tar.bz2 ~/Desktop

That’s it. You can now back the profile archive to secondary storage devices or your preferred cloud service to restore it whenever.

  12 Firefox Add-ons for Developers & Designers

Firefox Profile Restore

1. Remove entire Mozilla’s configuration directory.

$ rm -rf ~/.mozilla

2. Next, unzip the ~/.mozilla folder in your home directory with the following command:

$ tar -xvf firefox-browser-profile.tar.bz2

Now you can run Firefox with all of your bookmarks, history, extensions, etc. back in place.

Encrypt Firefox Profile Backup

You already know by now that it is important to back up your profile with encryption because it restricts your data to you and users with the key as the file will be virtually useless to anyone without the rights to decrypt the archive.

It takes a couple more steps to complete but we can easily complete them with GnuPG. If it’s not installed, you can install it using following command.

$ sudo apt install gnupg  [On Debian/Ubuntu]
$ sudo yum install gnupg  [On CentOS/RHEL]
$ sudo dnf install gnupg  [On Fedora]

After you have created the backup, enter the following terminal command from the directory containing the backup.

$ gpg -c firefox-browser-profile.tar.bz2

Enter a secure password when gpg -c prompts you for one. Once done with the encryption, save the firefox-browser-profile.tar.bz2.gpg file and delete the unprotected firefox-browser-profile.tar.bz2 file.

You can decrypt the archive at any time with:

$ gpg firefox-browser-profile.tar.bz2.gpg

Do you have any comments or questions to contribute? Drop them below in the comments section.

Your Unwavering Support Matters a Lot:

The cost of maintenance is skyrocketing as more readers are coming on board and the ad service that we employ in order to generate revenue is unfortunately no longer sufficient and this is especially due to the increased use of ad-blockers.

We humbly request that you consider disabling your ad-blockers to support us financially or by donating as anything from $1. Your donation(s) will go a long way in supporting FossMint and sister site, TecMint, in running efficiently. Thank you.

Make a Contribution via PayPal


Top Deals

About the author

Martins D. Okoi

Martins Divine Okoi is a graduate of Computer Science with a passion for Linux and the Open Source community. He works as a Graphic Designer, Web Developer, and programmer.