LinuxMint: Run Two Instances of Firefox Simultaneously (for Zotero)

Advanced users of Zotero, the amazing, free bibliography management software, may have run into the problem that you have two separate Zotero databases and want to access them at the same time.  I used to manage multiple databases simultaneously by using a really cool Firefox extension: Foxtester.  Alas, that extension is no longer working with the latest versions of Firefox, so I had to find another way of running two instances of Firefox simultaneously (this makes it much easier to transfer references between databases).  Luckily, built into Firefox is the ability to run multiple instances simultaneously, but it’s a bit trickier to set up (thus this tutorial).

First, you need to have Firefox installed, which is generally the case with most versions of Linux.  If not, use your software manager or Synaptic to install it.

Next, you’ll need to access the Profile Manager that comes with Firefox.  To do this, close any Firefox windows you have running then open a terminal and type:

/usr/bin/firefox -profilemanager

That will launch the Profile Manager:

firefoxX2-01

 

As you can see, I’ve already set up one extra profile (default is the one you normally use), but I’ll set up another to show that it works.

To add another profile, simple select the “Create Profile” button.  It will ask you for some information in a new window:

firefoxX2-02

You’ll need a name for the new profile.  Since I’m using these exclusively to run alternative instances of Zotero, I’m calling them “Zotero1”, “Zotero2”, and “Zotero3”.  By default, Firefox will create the new profiles in the default folder where it stores the default profile (on Linux machines, this is in: /home/USER/.mozilla  (Replace “USER” with your user directory.  Also, the “.” before the “mozilla” in the name of that folder makes it a hidden directory; you can view hidden directories in Linux if you tell your file manager to show you those folders.)  You can use that location, or choose a different folder.  Then select “Finish”.

Once you’ve created your profiles, you’ll now need a way to launch them.  This is a little tricky as it requires adding some code to the launch command in order to launch a SEPARATE instance of Firefox.  If you don’t use the code, then all that will launch is a new Firefox window, and what you want is a completely separate instance of Firefox.  You can launch the separate profile as an independent instance of Firefox from the command line using this command:

/usr/bin/firefox -P “Zotero1” -no-remote

Of course, replace “Zotero1” with whatever you named your profile.  The key is the “-no-remote” code which tells Firefox to run a separate instance rather than launch a new window.  Go ahead and try it to see that it works.  Of course, you’ll need to install Zotero in the new profile if that’s why you want a separate instance running.

And if you want to make this even easier to launch in the future, you can add a new application launcher for your alternate profile.  Doing this is window manager specific (e.g., Unity, Gnome, KDE, XFCE, etc.).  Since I’m running KDE, I’ll show you how to do this in KDE.

First, right-click the Kick-Off Application Launcher (bottom left corner in most installs) and select “Edit Applications.”

firefoxX2-05

You’ll get this window:

firefoxX2-03

 

Select “New Item”.  In the fields under the “General” tab, add a name in the “Name” field, e.g., “Zotero1”.  In the “Command” field add the same command that we used earlier to launch the separate profile: /usr/bin/firefox -P “Zotero1” -no-remote.  Once you “Save” this, it will add the New Item to the Application Launcher menu.  If you want to get fancy, you can add an icon for the launcher.  I created three Zotero icons that have little numbers so I know which profile I’m launching.  You’re welcome to use them: icon 1, icon 2, icon 3.  And if you want to make it even easier to launch the profiles, you can drag your new application launcher to your quick launch bar, so a single-click will launch your separate instance of Firefox, like this:

firefoxX2-04

 

 

———————————————————————————————————

Update 2014-12-21:

I’ve recently started using a slightly different approach.  I follow the directions above to create multiple profiles.  But rather than set specific icons to launch those profiles, I use the following code to choose which profile I want to launch when I start Firefox:

/usr/bin/firefox -P -no-remote

Once you’ve created multiple profiles, this code will simply ask you which profile you want to launch and will launch it as a remote session, so you can have multiple Firefox profiles open at once.

 

Loading


Posted

in

by

Comments

4 responses to “LinuxMint: Run Two Instances of Firefox Simultaneously (for Zotero)”

  1. ryan Avatar

    @adam.smith
    Good to know. That will be a useful caveat for anyone trying this on Windows.

  2. adam.smith Avatar
    adam.smith

    just as an addition – if you do this on a Windows machine it will break Word and LibreOffice integration with Zotero:
    afaik that’s not the case on *nix machines.

  3. SRoy Avatar
    SRoy

    Using code to choose which profile I want to launch when I start Firefox: /usr/bin/firefox -P -no-remote

    I would think one should use this approach with one instance of FF (with the default profile, without the -no-remote option) already running

    Reference: http://kb.mozillazine.org/Opening_a_new_instance_of_Firefox_with_another_profile

    If you could confirm please ?

    1. ryan Avatar

      If I understand your comment correctly, that should be fine. Basically, the “-P” flag tells Firefox that you want to select a profile. The “-no-remote” flag tells Firefox to open a new session, not a new window of an existing session. If you have one instance of FF running and want to start another, the command you gave would work. You’ll just need to select a profile upon starting that instance of FF.

Leave a Reply

Your email address will not be published. Required fields are marked *