Born Geek

Firefox Profile Tutorial

This tutorial aims to describe the profile system used in Firefox. We will learn what a profile is, what one is good for, how to create new profiles, and how to make use of them. That being said, take note:

Profiles are an advanced feature in Firefox. They are primarily geared towards those who wish to test nightly builds, those who develop extensions, or other similar scenarios. Typical users do not need to make use of this system, though alternate profiles can be useful in troubleshooting problems with your web browser.

Much of the content of this tutorial was adapted from the Firefox help section on managing profiles. If you find an error in this tutorial, or if you simply have a comment or suggestion, please let me know.

What is a Profile and Why Do I Need One?

A profile in Firefox is a collection of bookmarks, browser settings, extensions, passwords, and history; in short, all of your personal settings. These items are stored as a collection of files in a special folder on your hard drive. Shortly, we will find out where this folder is located. In case you didn’t already know, Firefox uses a default profile to store all of your personal settings.

So why would you ever want more than one profile? Two scenarios spring to mind: for testing nightly Firefox builds and for those who develop extensions. If you use a separate profile for testing or development purposes, and something goes horribly wrong (e.g., all your data gets lost), you still have your “default” profile to fall back on (the data there is still safe).

Finding Your Profile Folder

Your profile folder’s location depends on the operating system you use. The following table shows the typical location of the default profile:

Operating System Profile Folder Path
Windows %AppData%\Mozilla\Firefox\Profiles\xxxxxxxx.default\
Linux ~/.mozilla/firefox/xxxxxxxx.default/
Mac OS X ~/Library/Application Support/Firefox/Profiles/xxxxxxxx.default/

There are two points of interest in this table. The first is the xxxxxxxx string preceding each profile name. This string is simply a collection of 8 random numbers and characters, used to ensure that each profile is unique. Firefox automatically prepends a randomized string to any new profile for you, so you never need to worry about creating this portion of the name.

The second point of interest lies in the Windows path. The %AppData% string is actually a special Windows variable, pointing to your “Application Data” path. This is typically of the form:
C:\Documents and Settings\{User Name}\Application Data.

The Five-Minute Profile Creation Guide

If you want to get a new profile up and running quickly, use this quick “five-minute” guide. This guide assumes use of the Windows operating system, but these steps will generally work on any platform:

  1. Make sure all instances of Firefox are closed.
  2. Select Start » Run from the Windows Start menu.
  3. Type the following command and click OK: firefox -ProfileManager
  4. In the resulting Profile Manager window, click the Create Profile button.
  5. Click the Next button in the profile creation wizard.
  6. In the second step of the wizard, provide a name for the new profile and click the Finish button. Make sure that the name you choose does not contain any spaces.
  7. Back in the Profile Manager, click the Exit button.

We now need to create a shortcut that will use our new profile instead of the default. Here’s how:

  1. First and foremost, don’t ever use the “Don’t ask at startup” option in the Profile Manager. By checking this checkbox, any instance of Firefox you run on your computer will make use of the selected profile. In essence, this option allows you to change which profile is your default. This is counter-productive if you are testing nightly builds where you might want to have a new profile for each build.
  2. Create a shortcut to the Firefox instance you want to use with your custom profile. I typically just copy the existing Firefox shortcut and paste it somewhere, renaming it appropriately (i.e. “Development Sandbox”).
  3. In Windows, right click this shortcut and select Properties.
  4. In the Target field, append the following text to the end of the command (replace the {Profile_Name} portion with the actual name you gave your profile): -P "{Profile_Name}"
  5. Click the OK button.

Now when you double click the shortcut you just created, and no other Firefox instances are running, Firefox will start using your custom profile.

Detailed Instructions

Step 1: Close All Firefox Instances

In order to successfully create a new profile, all Firefox instances need to be closed. The profile manager, which we will use to create our profiles, is only accessible when Firefox starts. As such, we need to "start clean" so to speak.

Step 2: Start the Firefox Profile Manager

In order to start the profile manager, we need to pass a particular command line option to the Firefox executable. The simplest way to do this in Windows is to go to the Start » Run dialog. Enter the following command in the dialog, and then click OK:
firefox -ProfileManager

Starting the Profile Manager

Step 3: Launch the Create Profile Wizard

After issuing the command given in the previous step, the Firefox profile manager window will be displayed:

Firefox Profile Manager

This dialog displays the current profiles, provides options for creating and removing profiles, and more. For now, click the Create Profile… button to launch the profile creation wizard. On the first page of the wizard, simply click the Next button.

Step 4: Name Your Profile

The second step of the wizard looks like the following:

Profile Creation Wizard

In this step of the wizard, you simply need to provide the name of the profile you wish to create. I recommend that you make it descriptive, so that you will remember what the profile is used for. For the purposes of this tutorial, I’ve chosen the name “TestProfile”. It is recommended not to place spaces in the profile name, to avoid any strange problems. After you’ve chosen a suitable name, click the Finish button. Then click the Exit button in the Firefox profile manager (the dialog that opened up in step 3).

Step 5: Create a New Shortcut to Firefox

Instead of using the profile manager to select what profile to use, we will instead create a shortcut to Firefox that will launch our new profile for us (so we can use this profile any time we want). Create a shortcut to the Firefox executable, and edit the target like so: <path_to_Firefox>\Firefox.exe -P "TestProfile"

All we need to do is add the -P command line option after the executable name, followed by the name of the profile we created (surrounded by double quotes). Here’s a screenshot of the shortcut properties dialog, showing the changes I made (look in the Target field of the screenshot):

Firefox Shortcut Properties Dialog

Step 6: Start Firefox Using Your Profile

Now that you have a shortcut to start Firefox using your new profile, you simply need to double click it to begin using your new profile. Make sure that all instances of Firefox are closed before you launch this shortcut; otherwise your newly created profile won’t be used. By default, only one Firefox profile can run at a given time.

Backing Up Your Profiles

To back up a profile you have created, you simply need to copy the profile folder to a safe location (CD-RW, USB flash disk, etc). However, there are a few things you should be aware of before you begin:

  • It’s a good idea to clear your browser cache before you back up your profile (you’ll save a fair amount of file space when backing things up).
  • Before you back up your profile, make sure that all Firefox instances have been shut down. This will prevent Firefox from locking specific files that you’ll want to be backed up.

With these points in mind, you simply need to copy your profile folder to a standard back-up medium: CD-RW, another hard drive, a USB flash disk, etc.