The Mozilla source code can be obtained either by downloading a source archive, or by using a Mercurial (source control) client. If you are just starting out or you want to build a particular Mozilla product release, downloading a source archive is recommended. Otherwise, get the Mozilla Source Code Via Mercurial (for Firefox) or Comm-central Source Code via Mercurial (for Thunderbird, SeaMonkey and Firefox). If you want to browse the source instead of downloading it, read Viewing and searching Mozilla source code online.

Before attempting a build, please review the system requirements and build instructions.

License

Licensing information for the source code is on our licensing page.

Download

Releases

The source code for a release can be found on the FTP server in the "source" subdirectory of the release you want to acquire. The directory structure on the FTP server is as follows:

ftp.mozilla.org/pub/mozilla.org/PROJECT/releases/RELEASE/source/

where the names in italics mean the following:

  • PROJECT - The project name, such as firefox or thunderbird.

  • RELEASE - The release, such as 1.5.0.3 or bonecho.

For example, the source code for Firefox release 2.0.0.4 can be found at the following URL:

ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.4/source/

The easiest way to find the source code of the release you want is to start at ftp://ftp.mozilla.org/pub/mozilla.org/ and navigate your way to it, bearing in mind the directory structure described above. To navigate the FTP server, use either a browser like Firefox or an FTP client like FileZilla.

Note: Some projects do not provide source code using FTP, for example bonsai. In this case, you should use CVS (if possible). Specific versions of the applications are accessible with specific CVS Tags.

The entire source tree is not available for download over FTP.

Should the ftp links fail, try the HTTP server (Only for recent releases).

Nightlies

At the moment, source tarballs of the nightly snapshots are not provided.

Unpack

Source code is packaged as bzipped tarballs. This means that you must have tar along with bzip2 installed, since the -j flag in the commands listed below means the archive is first being unpacked with bzip2. To unpack a tarball from a unix-like shell (or the cygwin shell), type:

tar -xjf <source-file.tar.bz2>

Or, if you want to see the files extracted,

tar -xjvf <source-file.tar.bz2>
Note for Windows users: using WinRAR or WinZip to unpack source archives will not work. WinZip does not support *.bz2 files, and the archive contains zero-length files which are not unpacked properly. For windows, try 7-zip software.