How to create a portable version of Firefox

Post tutorials, HOWTO's and other useful resources here.
Kulle
Warlord
Warlord
Posts: 704
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

How to create a portable version of Firefox

Post#1 by Kulle » 26 Mar 2025, 16:34

How to create a portable version of Firefox

Download the Linux version of Firefox (tar.xz) from the Mozilla website:
https://download.mozilla.org/?product=f ... os=linux64

Create a new folder, for example, firefox-portable.
Create a subfolder named profilordner inside the newly created folder.

Extract the downloaded archive into the firefox-portable folder to get the firefox folder.

Create a new file named loader.sh in the firefox-portable folder with the following content:

Code: Select all

#!/bin/sh
"$PWD/firefox/firefox" -no-remote -profile "$PWD/profilordner"
Make the loader.sh file executable: chmod +x ~/firefox-portable/loader.sh

To start the portable Firefox, execute the loader.sh script.

You can move the firefox-portable folder to any location, even a USB stick.

Important notes: Do not run ~/firefox-portable/firefox/firefox directly.

Firefox updates itself if configured to do so in the settings.
All settings, bookmarks, etc., are preserved.
Bookmarks and settings are stored in the profile folder, ensuring persistence.

Using this same principle, derivatives can also be made portable.
Works for forks like Librewolf (privacy-focused Firefox) as they share the same core structure.
The loader.sh script and profile folder method remain identical.
Portable versions inherit the parent project’s update behavior (manual/auto).

This page served as the basis: https://wiki.ubuntuusers.de/Portable_Firefox/

nanZor
Shogun
Shogun
Posts: 489
Joined: 09 Apr 2019, 03:27
Distribution: Porteus 5.1 Alpha OpenBox

How to create a portable version of Firefox

Post#2 by nanZor » 28 Mar 2025, 12:07

Kulle, that is GREAT! I just tried it and your great doc worked fantastic! Thank You!

What is interesting is that it seems like it might be self-updating capable - that is, when one does an "Help > About" you can see it checks itself for updates (or I guess will happen if you have that set internally.) I'll be interested to see if that self-update works in this portable mode.

Check this out - I'm in Nemesis right now, and although I've Pmodd'ed browsers and so forth, Netsurf comes with the distribution. So I fired up Netsurf and went to mozilla.org. Yeah, not the best display, but it was easy enough to navigate to the special Linux download area, and Netsurf worked downloading Firefox. Sometimes downloading was a problem in earlier versions.

Now just do the portable version as you described here. I suppose one can make it a launcher or command prompt.. I usually follow loader.sh with an ampersand to free up the terminal... usual stuff.

What a treat man! Really great for all the Porteus family, and elsewhere. Thank you for sharing.

Update: This works in the same way for Thunderbird too! Danke my friend!
That's a UNIX book - cool. -Garth

nanZor
Shogun
Shogun
Posts: 489
Joined: 09 Apr 2019, 03:27
Distribution: Porteus 5.1 Alpha OpenBox

How to create a portable version of Firefox

Post#3 by nanZor » 24 May 2025, 23:10

Aside from being portable, this could be a hardware/disk saver.

Given that most hardware these days don't run from spinning hard drives, but from SSD's, emmc, thumbdrives etc, and writing little files over and over is eventually detrimental. Of course Porteus and family reduce that with things like EXIT: and copy2ram etc.

BUT, for sharing the browser amongst various installation types, (ie scatter disk) which is mostly ssd's and so forth, perhaps the great thing about this portable setup for Firefox is that you can put it on a DEDICATED "sacrificial" good usb stick. USB3 preferred, AND format it with a filesystem appropriate for small files. EXT2 of course comes to mind, but there are other modern types to consider too.

Many larger distros have automated installations which just slam EXT4 across the SSD, but if you create the portable Firefox version as a separate entity, on a sacrificial stick, this would help keep the writes down on internal drives you can't get to. Soldered-on internal emmc drives in particular!

Thanks again Kulle, this may be significant to keep cheaper boxes a little bit more healthy in a super-easy way to implement. In fact, I might make it a combo "tmp" and "portable firefox" thing.
That's a UNIX book - cool. -Garth

Post Reply