How to install Firefox 3.6 and 4.0+ in parallel?

Up until last week, I had both Firefox 3.6 and Firefox 4.0 installed, which was good for testing web applications.

But now the nightly channel contains Firefox 6 instead of Firefox 4. I tried using the stable channel, but that replaced Firefox 3.6.


in the answer below, "Firefox 3.6" is the installed version, "Firefox 4" is another version you want to use

The Firefox package from Mozilla can be extracted to any directory, like /opt or your home directory. I'm using separate profiles for Firefox 3.6 and 4 for optimal compatibility.

  1. Download Firefox from mozilla.com to your home directory. (note that these packages are built for 32-bit systems, 64-bit systems may encounter strange issues like missing icons)
  2. Open a terminal and extract the archive to ~/firefox by running:

    tar xjf firefox-4.0.tar.bz2
    

    (replace the filename accordingly)

  3. Create the directory ~/bin if non-existent and make a link named firefox4 to the Firefox 4 executable:

    mkdir ~/bin
    ln -s ~/firefox/firefox ~/bin/firefox4
    

    If you ~/bin was previously non-existent, you need to re-login to update your the path in which Ubuntu searches for applications. From now on, you can run Firefox 4 by executing firefox4. If you wish to use Firefox 4 instead of the Firefox version installed on the system, run:

    ln -s ~/bin/firefox ~/bin/firefox4
    

Important: if you download Firefox from Mozilla, the auto-update feature of Firefox is enabled. The package manager (apt) does not take care of updating the Firefox package from Mozilla. To check for updates manually, go to Help => Check for updates.

Optional steps if you'd like to run Firefox 3.6 and 4 simultaneously with a single command:

  1. Create new profile for Firefox 4 by starting the Profile Manager:

    firefox4 -ProfileManager
    
  2. Press Create Profile and enter firefox4 as profile name. Press Finish when done.
  3. Create the file ~/bin/fx4, containing:

    #!/bin/sh
    firefox4 --no-remote -P firefox4 "$@"
    
  4. Create the file ~/bin/fx, containing:

    #!/bin/sh
    firefox --no-remote -P default "$@"
    

    (replace default by your profile name for Firefox 3.6)
    It's assumed that the Firefox executable is Firefox 3.6 which is the case on Maverick (10.10), but not Natty (11.04).

  5. Make it executable:

    chmod +x ~/bin/fx4 ~/bin/fx
    
  6. From now on, you can run the Firefox 4 profile by executing fx4 and Firefox 3.6 by running fx.

Here is what I did for checking out firefox 4 along with pre-installed firefox 3.6 in ubuntu 10.10. You can run only one version at a time and some extensions may not work.

  • Download firefox4
  • extract it somewhere with file-roller or you can use tar command
  • create a symlink in system path

    sudo ln -s /path/to/firefox4/firefox /usr/local/bin/firefox4

  • run firefox with firefox4 command from terminal or you can create a launcher on the panel as well.


If you download the packages of firefox 4 or later, you can extract the folder, and run the script in the folder named firefox: firefox will open up, with your addons, setting, and bookmarks in place.

NOTE: but in this way the two browsers cannot be used at the same time: one has to be closed (check task manager) for the other to start.


To be able to start both at the same time and to avoid searching for compatibility with addons and so on, you might consider using modified versions of Mozilla Firefox ('clones', re-branded browsers) that do not interfere with each other, like Icecat instead of Firefox 4+ (sudo add-apt-repository ppa:gnuzilla-team/ppa && sudo apt-get update && sudo apt-get install icecat -y) or (if you want to have latest Firefox) Swiftweasel instead of Firefox 3.6.