Install Firefox on Linux
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.
Table of Contents
Install Firefox .deb package for Debian-based distributions (recommended)
To install the.deb package through the APT repository, do the following:
- Create a directory to store APT repository keys if it doesn't exist:
sudo install -d -m 0755 /etc/apt/keyrings
- 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
wgetinstalled, you can install it with:sudo apt-get install wget
- The fingerprint should be35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3. 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"}'
- Next, add the Mozilla APT repository to your sources.list:
- For Debian Bookworm 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 and Newer
cat <<EOF | sudo tee /etc/apt/sources.list.d/mozilla.sourcesTypes: debURIs: https://packages.mozilla.org/aptSuites: mozillaComponents: mainSigned-By: /etc/apt/keyrings/packages.mozilla.org.ascEOF
- Configure APT to prioritize packages from the Mozilla repository:
echo 'Package: *Pin: origin packages.mozilla.orgPin-Priority: 1000' | sudo tee /etc/apt/preferences.d/mozilla
- Update your package list, and installfirefox (or one offirefox-esr,-beta,-nightly,-devedition):
sudo apt-get update && sudo apt-get install firefox
Set up different languages in Firefox with .deb files
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:
sudo apt-get install firefox-l10n-fr
To list all the available language packs, you can use this command after adding the Mozilla APT repository and runningsudo apt-get update:
apt-cache search firefox-l10n
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, seeHow 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/
- Flatpak:
In both cases, once you’ve moved the profiles, launch Firefox from the terminal with the commandfirefox -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 theESR.
Install from Flatpak
To install Firefox from Flatpak,install and configure Flatpak on your computer. Once Flatpak is installed, go to theFirefox Flathub's page, and click theInstall 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 onhow 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 theFirefox Snapcraft's Store page, click theInstall 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 onhow to use Firefox in another language.
Install Firefox from Mozilla builds
Before you install Firefox from a Mozilla build, make sure that your computer has therequired libraries installed. Missing or incompatible libraries may cause Firefox to be inoperable.
System Firefox installation (for advanced users)
To install Firefox with this method, youmust be able to log in as root or executesudo 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
- Go to theFirefox download page, and clickDownload for Linux 32-bit orDownload for Linux 64-bit.
- Open a terminal, and go to the folder where your download has been saved. For example:
cd ~/Downloads- Extract the contents of the downloaded file by typing:
tar xjf firefox-*.tar.bz2
The following commands must be executed as root or preceded bysudo.
- Move the uncompressed Firefox folder to/opt:
mv firefox /opt
- Create a symlink to the Firefox executable:
ln -s /opt/firefox/firefox /usr/local/bin/firefox
- 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, ifwget is not installed on your computer, go to the URL mentioned above, right-click on the page to open the contextual menu, and selectSave Page As. After you downloaded the file, move it to/usr/local/share/applications.
To verify that the installation was successful, you can open theTroubleshooting Information page. In theApplication Basics section, the value of the lineApplication Binary should be/opt/firefox/firefox-bin.
Local Firefox installation in user's account
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.- Go to theFirefox download page, and click theDownload Now button.
- You can also click theDownload a different platform or language link below that button to choose another build: Nightly, Beta, Developer or ESR.
- Open a terminal, and go to the folder where your download has been saved. For example:
cd ~/Downloads
- Extract the downloaded file contents. This will create a folder namedfirefox. After that, you can delete the archive:
tar xjf firefox-*.tar.bz2
rm firefox-*.tar.bz2
- If you downloaded a specific build, you may want to rename the uncompressed folder accordingly. For example:
mv firefox firefox-nightly
- You can leave the uncompressed folder into your download folder, or move it to another place in your account. For example:
mv firefox ~/firefox
- Firefox is now ready to be used. You can run it directly from the terminal:
~/firefox/firefox &
- Create a desktop shortcut. (It may be different in your Linux distribution.)
- Right-click on the desktop, and chooseCreate 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/
Security features warning
On some Linux distributions, you could see a notification thatsome of Firefox’s security features may offer less protection on your current operating system. To learn more, seeFirefox security features warning on Linux.
Related articles
Share this article:http://mzl.la/1xKrIV5
These fine people helped write this article:

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