Simple Firefox build

This page covers the basic steps needed to build a bleeding-edge, development version of Firefox. For additional, more detailed information, see the build documentation.

Install build prerequisites

Before you can build Firefox, you'll need the build tools listed below and a few gigabytes of free disk space. Builds will be slow unless you have at least 2GB of RAM.

One-Line Bootstrapping

If you are using Windows then please start working from the Windows header below. This bootstrap process does not seem to work for Windows, Mozilla provides an executable that will install requirements like python and other tools automatically and easiliy.

On every platform except Windows, you can attempt running our system bootstrapping script to install all system dependencies:

wget --no-check-certificate && python

If this works, great! If not, see the appropriate section below. If you encounter an error, consider filing a bug saying that the bootstrapper didn't work. Please include output and relevant operating system details.

Common Bootstrapper Failures

Missing wget
wget: command not found

If you see the above, you don't have wget installed. Try curl:

curl > && python

If you don't have curl, download the file in your browser and run it by hand:



The above bootstrap scripts supports popular Linux distributions. If it doesn't work for you, see Linux build prerequisites for more.


The above bootstrap script should work on OS X 10.6 and newer. If it doesn't, see Mac OS X build prerequisites.


  • Make sure your system is up-to-date through Windows Update. (Windows XP needs at least Service Pack 2 and .NET Framework 2.0.)
  • Install a version of Visual Studio that supports C++ development: VS 2012 for Windows Desktop Pro or Express (free), or VC++ 2010 Pro or Express (free), or VC++ 2008 Pro or Express with SP1 (free) (Warning ! From Firefox 10, the compilator is Visual Studio 2010; if you want to use it, you must use a previous version of it !), or 2005 Professional.
  • You may need to install one or more Windows SDKs. See Windows SDK versions for a quick guide.
  • Install the June 2010 DirectX SDK (even VS 2012 requires this).
  • Install MozillaBuild, a package of additional build tools. (If you see a Windows error dialog giving you the option to re-install with the 'correct settings', choose that option and after that all should be well.)

The rest of the build steps are done from the MSYS shell installed with MozillaBuild (the MINGW32 shell).

(NOTE that this is not the same as an MS-DOS CMD.EXE Shell.)

Use the shortcuts on your desktop, or run c:\mozilla-build\start-msvcX.bat (where X is 8 for VS 2005, 9 for VS 2008, 10 for VS 2010, and 11 for VS 2012). Even if you're on 64-bit Windows, do not use the start-msvcX-x64.bat files (unless you know what you're doing), since they are experimental and unsupported. See the Build:MozillaBuild For x64 wiki page.

Problems? See Windows build prerequisites.

Get the source

Note: On Windows, you won't be able to build the Firefox source code if it's under a directory with spaces in the path (e.g. don't use "Documents and Settings"). You can pick any other location, such as a new directory C:\mozilla-central

Get the latest source code from Mozilla's Mercurial code repository. This may take a while; it's a lot of code!

hg clone
On some types of network connections, "hg clone" might fail because it gets interrupted.  If your "hg clone" command won't finish, try using a Mercurial bundle instead.

Build configuration (optional)

By default, the build system creates a release build of Firefox roughly equivalent to the official Firefox release builds. If that's not exactly what you want, there are many build configuration options to choose from, although it's strongly recommended that you only use options that you fully understand. The normal way to specify build options is to place them in a file named '.mozconfig' at the root of your mozilla source tree. For example, to create a debug build instead of a release build, that file would contain:

ac_add_options --enable-debug

For more on configuration options, see the page on configuring build options.


To start the build, cd into the mozilla-central subdirectory (created automatically by the hg clone command), and run:

./mach build

Building can take a significant amount of time, depending on your system, OS and chosen build options. Linux builds on a fast box may take under 15 minutes, but Windows builds on a slow box may take several hours. See tips for making builds faster.

Various compiled files, libraries, and the Firefox executable will be found in your object directory (under mozilla-central/), which is prefixed with obj-. The exact name depends on your system and OS. For example, a Mac user may get an object directory name of obj-x86_64-apple-darwin10.7.3/.

From the object directory, Windows users should run dist/bin/firefox.exe, Linux users should run dist/bin/firefox, and OS X users should run dist/

How to update and build again

To pull the latest changes and update the code in your mozilla-central working directory, run the command:

hg pull -u

Then just re-run the mach command above. This will only recompile files that changed, but it's still a long haul. An incremental build can be faster.