Install Firefox on Linux

Firefox Firefox Last updated: 5 days ago 60% of users voted this helpful

Many Linux distributions come with Firefox pre-installed and set as the default browser. However, if you need to install Firefox on Linux using a different method, the following guide will show you how to install Firefox on Ubuntu, Debian, Fedora, openSUSE and other Linux distributions.

This article only applies to Linux. For instructions to install Firefox on Mac, see How to download and install Firefox on Mac.For instructions to install Firefox on Windows, see How to install Firefox on Windows.

Install Firefox DEB package for Debian-based and Ubuntu-based distributions (recommended)

To install the DEB package through the APT repository, do the following:

  1. Create a directory to store APT repository keys if it doesn't exist:
    sudo install -d -m 0755 /etc/apt/keyrings
  2. Import the Mozilla APT repository signing key:
    wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
    If you do not have wget installed, you can install it with: sudo apt-get install wget
  3. The fingerprint should be 35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3. You may check it with the following command:
    gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); if($0 == "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3") print "\nThe key fingerprint matches ("$0").\n"; else print "\nVerification failed: the fingerprint ("$0") does not match the expected one.\n"}'
  4. Next, add the Mozilla APT repository to your sources.list:
    • For Debian Bookworm/Ubuntu Noble and Older:
    echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
    • For Debian Trixie/Ubuntu Resolute and Newer
    sudo tee /etc/apt/sources.list.d/mozilla.sources > /dev/null << EOF
    Types: deb
    URIs: https://packages.mozilla.org/apt
    Suites: mozilla
    Components: main
    Signed-By: /etc/apt/keyrings/packages.mozilla.org.asc
    EOF
  5. Configure APT to prioritize packages from the Mozilla repository:
    sudo tee /etc/apt/preferences.d/mozilla > /dev/null << EOF
    Package: *
    Pin: origin packages.mozilla.org
    Pin-Priority: 1000
    EOF
  6. Update your package list, and install firefox (or one of firefox-esr, -beta, -nightly, -devedition):
    sudo apt-get update
    sudo apt-get install firefox

Use different languages on Firefox DEB package

For those of you who would like to use Firefox in a different language than American English, we have also created DEB packages containing the Firefox language packs. To install a specific language pack, replace fr in the example below with the desired language code. In this example, we are installing the French language pack of Firefox.

sudo apt-get install firefox-l10n-fr

To list all the available language packs, you can use this command after adding the Mozilla repository and running sudo apt-get update:

apt-cache search firefox-l10n

Localization are also available as firefox-esr-l10n, -beta-l10n, -nightly-l10n, -devedition-l10n packages for other release/edition

Install Firefox RPM package for Fedora-based, RHEL and its derivations (recommended)

Add Firefox RPM repository through the dnf5 package manager (Fedora 41+, RHEL/Rocky/Alma 10+)

sudo dnf config-manager addrepo --id=mozilla --set=baseurl=https://packages.mozilla.org/rpm/firefox --set=gpgkey=https://packages.mozilla.org/rpm/firefox/signing-key.gpg --set=gpgcheck=1 --set=repo_gpgcheck=0 --set=priority=10
sudo dnf makecache --refresh
sudo dnf install firefox

Add Firefox RPM repository for older dnf package manager (Fedora <41, RHEL/Rocky/Alma <10)

sudo tee /etc/yum.repos.d/mozilla.repo > /dev/null << EOF
[mozilla]
name=Mozilla Packages
baseurl=https://packages.mozilla.org/rpm/firefox
enabled=1
gpgcheck=1
repo_gpgcheck=0
gpgkey=https://packages.mozilla.org/rpm/firefox/signing-key.gpg
priority=10
EOF
Note: repo_gpgcheck=0 deactivates the signature of metadata with GPG. However, this is safeguarded instead by HTTPS and package signatures (gpgcheck=1).

To install firefox from mozilla repository (or one of firefox-esr, -beta, -nightly, -devedition), do:

sudo dnf makecache --refresh
sudo dnf install firefox

To upgrade firefox from distribution repository version to mozilla version, do:

sudo dnf makecache --refresh
sudo dnf upgrade firefox

To replace firefox from distribution repository version to mozilla version, do:

sudo dnf makecache --refresh
sudo dnf swap firefox firefox --allowerasing
Note: When replacing firefox from distribution repository version to mozilla version, firefox may create a new profile and set it as default. To keep your old settings/configuration, please head to about:profiles, look for your old profiles, and set it again as default profiles.

Use different languages on Firefox RPM package

For those of you who would like to use Firefox in a different language than American English, we have also created RPM packages containing the Firefox language packs. To install a specific language pack, replace fr in the example below with the desired language code. In this example, we are installing the French language pack of Firefox.

sudo dnf install firefox-l10n-fr

To list all the available language packs, you can use this command after adding the Mozilla repository and running sudo dnf makecache --refresh:

dnf search firefox-l10n

Localization are also available as firefox-esr-l10n, -beta-l10n, -nightly-l10n, -devedition-l10n packages for other release/edition

Install Firefox RPM package for openSUSE and SUSE Linux (recommended)

Add Firefox RPM repository through the zypper package manager

sudo rpm --import https://packages.mozilla.org/rpm/firefox/signing-key.gpg
sudo zypper ar --gpgcheck-allow-unsigned-repo -p 10 https://packages.mozilla.org/rpm/firefox mozilla
sudo zypper refresh
sudo zypper install firefox

To install or update firefox from mozilla repository (or one of firefox-esr, -beta, -nightly, -devedition), do:

sudo zypper refresh
sudo zypper install firefox

To replace firefox from distribution repository version to mozilla version, do:

sudo zypper refresh
sudo zypper remove firefox
sudo zypper install firefox
Note: When replacing firefox from distribution repository version to mozilla version, firefox may create a new profile and set it as default. To keep your old settings/configuration, please head to about:profiles, look for your old profiles, and set it again as default profiles.

Use different languages on Firefox RPM package

For those of you who would like to use Firefox in a different language than American English, we have also created RPM packages containing the Firefox language packs. To install a specific language pack, replace fr in the example below with the desired language code. In this example, we are installing the French language pack of Firefox.

sudo zypper install firefox-l10n-fr

To list all the available language packs, you can use this command after adding the Mozilla repository and running sudo zypper refresh:

zypper search firefox-l10n

Localization are also available as firefox-esr-l10n, -beta-l10n, -nightly-l10n, -devedition-l10n packages for other release/edition

Data migration

If you were using Snap or Flatpak before, you are required to import your profile. There are two ways to do this. You can use either of these methods:

  • Method 1: Set up Sync. For instruction, see How do I set up Sync on my computer?
  • Method 2: Copy the existing files on your computer. Make sure that all copies of Firefox on your computer are completely closed before doing this:
    • Flatpak:
      mkdir -p ~/.mozilla/firefox/ && cp -a ~/.var/app/org.mozilla.firefox/.mozilla/firefox/* ~/.mozilla/firefox/
    • Snap:
      mkdir -p ~/.mozilla/firefox/ && cp -a ~/snap/firefox/common/.mozilla/firefox/* ~/.mozilla/firefox/

In both cases, once you’ve moved the profiles, launch Firefox from the terminal with the command firefox -P. Select your desired profile. After this initial setup, the -P command will no longer be necessary.

Install from your distribution package manager

To install Firefox using your distribution package manager, please refer to your Linux distribution's documentation.

This method is recommended because it ensures Firefox and all the required libraries are installed and configured optimally for your distribution. However, there may be a small delay between the official release of a new version of Firefox and the moment when your distribution updates the version it distributes. Your distribution may also distribute it without the Firefox branding or only distribute the ESR.

Install from Flatpak

To install Firefox from Flatpak, install and configure Flatpak on your computer. Once Flatpak is installed, go to the Firefox Flathub's page, and click the Install button. Alternatively, you can type the following command in a terminal:

flatpak install flathub org.mozilla.firefox

By default, Flatpak installs Firefox in the same locale as your operating system. To use a different language, please follow the instructions on how to use Firefox in another language.

Install from Snap

To install Firefox from Snap, install Snap on your computer. Once Snap is installed, go to the Firefox Snapcraft's Store page, click the Install button, and follow the instructions. Alternatively, you can type the following command in a terminal:

sudo snap install firefox

Firefox Beta, Nightly and ESR Release Channel is also available as snap package

  • Beta Channel:
sudo snap install firefox --beta
  • Nightly Channel
sudo snap install firefox --edge
  • ESR Channel
sudo snap install firefox --channel=esr/stable

If available, Snap installs Firefox in the same locale as your operating system. To use a different language, please follow the instructions on how to use Firefox in another language.

Install Firefox from Mozilla Tarball builds

Before you install Firefox from a Mozilla Tarball build, make sure that your computer has the required libraries installed. Missing or incompatible libraries may cause Firefox to be inoperable.

System Firefox installation (for advanced users)

To install Firefox with this method, you must be able to log in as root or execute sudo commands.

This installation will have priority over the Firefox version installed through your package manager. To run the version installed with your package manager, you will need to execute the binary from a terminal. To do so in most distributions, open a terminal and type:
/usr/bin/firefox

  1. Go to the Firefox download page, and click Download for Linux 64-bit or Download for Linux ARM64.
    • You can also click the All Firefox Downloads link to choose another release/edition: Nightly, Beta, Developer or Extended Support Release (ESR).
  2. Open a terminal, and go to the folder where your download has been saved. For example:
    cd ~/Downloads
  3. Extract the contents of the downloaded file by typing:
    tar xJf firefox-*.tar.xz
    rm firefox-*.tar.xz
  4. If you downloaded a specific build, you may want to rename the uncompressed folder accordingly. For example:
    mv firefox firefox-nightly

    The following commands must be executed as root or preceded by sudo.
  5. Move the uncompressed Firefox folder to /opt:
    mv firefox /opt
  6. Create a symlink to the Firefox executable:
    ln -s /opt/firefox/firefox /usr/local/bin/firefox
  7. Download a copy of the desktop file:
    wget https://raw.githubusercontent.com/mozilla/sumo-kb/main/install-firefox-linux/firefox.desktop -P /usr/local/share/applications

Alternatively, if wget is not installed on your computer, go to the URL mentioned above, right-click on the page to open the contextual menu, and select Save Page As. After you downloaded the file, move it to /usr/local/share/applications.

To verify that the installation was successful, you can open the Troubleshooting Information page. In the Application Basics section, the value of the line Application Binary should be /opt/firefox/firefox-bin.

Local Firefox installation in user's account

If you don't have access to login as root or execute sudo commands, or just prefer to use a local Firefox in your account, you can make a local installation. You can also do this to have multiple Firefox installations for different builds.
  1. Go to the Firefox download page, and click Download for Linux 64-bit or Download for Linux ARM64.
    • You can also click the All Firefox Downloads link to choose another release/edition: Nightly, Beta, Developer or Extended Support Release (ESR).
  2. Open a terminal, and go to the folder where your download has been saved. For example:
    cd ~/Downloads
  3. Extract the downloaded file contents. This will create a folder named firefox. After that, you can delete the archive:
    tar xJf firefox-*.tar.xz
    rm firefox-*.tar.xz
  4. If you downloaded a specific build, you may want to rename the uncompressed folder accordingly. For example:
    mv firefox firefox-nightly
  5. You can leave the uncompressed folder into your download folder, or move it to another place in your account. For example:
    mv firefox ~/firefox
  6. Firefox is now ready to be used. You can run it directly from the terminal:
    ~/firefox/firefox &
  7. Create a desktop shortcut. (It may be different in your Linux distribution.)
    • Right-click on the desktop, and choose Create launcher from the context menu.
    • You can also type this on the terminal:
      ln -s ~/firefox/firefox ~/Desktop/
    • An icon for the desktop shortcut will be found in ~/firefox/browser/chrome/icons/default/
Note: This method doesn't change file types binding on the system, so links from other applications will not open in the local installation. You will need to copy the link and paste it in the Firefox address bar.

Security features warning

On some Linux distributions using AppArmor such like Debian-based, Ubuntu-based, openSUSE, and SUSE Linux, you could see a notification that some of Firefox’s security features may offer less protection on your current operating system. To learn more, see Firefox security features warning on Linux.

Related articles

These fine people helped write this article:

Illustration of hands

Volunteer

Grow and share your expertise with others. Answer questions and improve our knowledge base.

Learn More