How to create a portable version of Firefox

Post tutorials, HOWTO's and other useful resources here.
Kulle
Warlord
Warlord
Posts: 728
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
Warlord
Warlord
Posts: 547
Joined: 09 Apr 2019, 03:27
Distribution: Porteus / PorteuX on f2fs usb

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
Warlord
Warlord
Posts: 547
Joined: 09 Apr 2019, 03:27
Distribution: Porteus / PorteuX on f2fs usb

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

Kulle
Warlord
Warlord
Posts: 728
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

How to create a portable version of Firefox

Post#4 by Kulle » 17 Jun 2025, 13:28

Following the above principle, you can also create a portable Firedragon
(About Firedragon look here: https://flathub.org/apps/org.garudalinux.firedragon)

Download the Firedragon AppImage from the official Garuda Linux releases page:
https://gitlab.com/garuda-linux/firedra ... v11.26.1-1

Extract the AppImage to obtain the squashfs-root folder by running:

Code: Select all

./firedragon-*.AppImage --appimage-extract
Create a new folder, for example, firedragon-portable.
Inside the firedragon-portable folder, create a subfolder named profilordner to hold the profile data.

Move the extracted squashfs-root folder into firedragon-portable and rename it to firedragon for clarity.

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

Code: Select all

#!/bin/sh
"$PWD/firedragon/firedragon" -no-remote -profile "$PWD/profilordner"
Make the loader.sh script executable:

Code: Select all

chmod +x firedragon-portable/loader.sh
To run the portable Firedragon browser, execute the loader.sh script.
You can move the firedragon-portable folder to any location, including a USB stick.
All your settings, bookmarks, and extensions are saved inside the profilordner folder.

User avatar
Triatominae
White ninja
White ninja
Posts: 21
Joined: 30 Jun 2025, 16:29
Distribution: Calculate Linux
Location: Third rock from the sun

How to create a portable version of Firefox

Post#5 by Triatominae » 11 Jul 2025, 23:19

Kulle,
Great Job! :beer:
"The best teachers :book: are students :coffee: first!" :smart:

nanZor
Warlord
Warlord
Posts: 547
Joined: 09 Apr 2019, 03:27
Distribution: Porteus / PorteuX on f2fs usb

How to create a portable version of Firefox

Post#6 by nanZor » 19 May 2026, 09:02

Tip: If you are using this portable version on a usb-stick especially, I've confirmed what I've read elsewhere about disabling the FF disk-cache and just streaming directly instead.

The usual warning applies after initiating this in the url bar:

Code: Select all

about:config
Search for "browser.cache.disk.enable"

Toggle that to "false".

I've noticed that by default, Librewolf sets this to false. When I run FF, I double-check this option. After testing, I think it's a keeper.
That's a UNIX book - cool. -Garth

rych
Warlord
Warlord
Posts: 874
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

How to create a portable version of Firefox

Post#7 by rych » 20 May 2026, 08:49

nanZor wrote:
19 May 2026, 09:02
by default, Librewolf sets this to false
Doesn't it results in frequent re-downloading of images, scripts, and media? Or are they going to be stored in RAM instead? Do we need to increase the browser.cache.memory.capacity beyond it's typical 256/512MB in this scenario? I remember when I wanted to minimize Firefox writing on my USB all the time I went 2 ways: making a tmp folder on the fast system SSD (a red flag with administrators as they'd rather my USB Porteus didn't have write access to the Windows system disks at all) ... or eventually upgrading my USB stick to the equally fast SSD inside a USB3 enclosure.

nanZor
Warlord
Warlord
Posts: 547
Joined: 09 Apr 2019, 03:27
Distribution: Porteus / PorteuX on f2fs usb

How to create a portable version of Firefox

Post#8 by nanZor » 20 May 2026, 22:58

Yes, I want the cache, but only in ram, not being stored and retrieved on a slow usb stick. This seems to be slower than any possible re-downloading of media, and maybe even the reduction of write-amplification on sticks and ssd's.

Librewolf might be disabling it for privacy reasons, but it so happens it might be additionally useful for us using slow media.

I saw a mozilla reference here:
https://support.mozilla.org/en-US/questions/1313570

There might be other tweaks beneficial, but I see those confusing disabling cache vs disabling it just on disk with a thousand knob turns. I avoid those, so for now, just this alone seems ok. I'll let others turn more knobs - it would be great to find out.

Also you can check the cache with:

Code: Select all

about:cache
in the url bar.
That's a UNIX book - cool. -Garth

Kulle
Warlord
Warlord
Posts: 728
Joined: 28 Jan 2017, 10:39
Distribution: v4.0 64bit Xfce
Location: Berlin

How to create a portable version of Firefox

Post#9 by Kulle » 21 May 2026, 11:55

Hi,
I used the following settings:

Code: Select all

browser.cache.disk.enable → false
browser.cache.memory.enable →  true
browser.cache.memory.capacity →  -1  (automatic)
browser.sessionstore.interval → 60000

User avatar
M. Eerie
Moderator
Moderator
Posts: 746
Joined: 31 Aug 2017, 21:18
Distribution: Nemesis/Porteux XFCE4

How to create a portable version of Firefox

Post#10 by M. Eerie » 22 May 2026, 14:17

nanZor wrote:
20 May 2026, 22:58
I want the cache, but only in ram, not being stored and retrieved on a slow usb stick.
If like me, you happen to be using the great method described in this thread by Kulle, you might find this script useful. I use it to keep Firefox updated along with your settings in a single module. It doesn't prevent the cache from being used while it's active, but it does prevent it from being stored. If you use it in combination with zram, it can be a good way to save write operations to the USB drive.

* Please note that my portable Firefox is located in /home/guest/firefox-portable and the target module is saved in porteus/base/005-fx-portable-YYYY-MM-DD.xzm (lz4 compressed)

Code: Select all

#!/usr/bin/env bash
#
# update-fx-portable v.2025-03
#

set -e

profile="firefox-portable"
#comp_method="-comp xz -Xbcj x86"
#comp_method="-comp zstd" ### -Xcompression-level 22
comp_method="-comp lz4"
module="/tmp/005-fx-portable-$(date +%Y%m%d).xzm"

exclude_patterns=(
    "*backups"
    "cache*"
    "data.safe.bin"
    "*dumps"
    "*popen*"
    "*rash*"
    "*report*"
    "staged/*"
    "*storage"
)

cmd="sudo mksquashfs $HOME/$profile $module $comp_method -b 1M -noappend -no-strip -wildcards"
cmd+=$(printf " -e '... %s'" "${exclude_patterns[@]}")

if eval $cmd; then
    tput bold
    cp -a "$module" "$PORTDIR/base" 2>/dev/null
    tput setaf 2; echo "Module copied and ready to be activated at next boot"
else
    tput setaf 1; echo "Something went wrong"
    exit 1
fi

exit 0

> Does not compute_ 🖖

https://forum.porteus.org/viewtopic.php?p=94310#p94310
https://forum.porteus.org/viewtopic.php?p=102066#p102066
https://forum.porteus.org/viewtopic.php?p=102306#p102306
https://forum.porteus.org/viewtopic.php?p=72741#p72741

User avatar
dreadbird
Shogun
Shogun
Posts: 264
Joined: 08 Dec 2024, 04:30
Distribution: porteus5

How to create a portable version of Firefox

Post#11 by dreadbird » 12 Jul 2026, 08:28

Will give this a go I usually use chromium ungoogled with neverdecafe to install extensions. But do use firefox as it seems to have a better video popout (opera I had to abandon because it wouldnt popout on my tv provider browser). its convenient how they have a release you can just download.

firedragon is a cool name what if they named it flydragon which is a play on dragonfly

Post Reply