How to Install Latest Firefox on Ubuntu Linux

This step-by-step tutorial shows how to install Firefox on Ubuntu or any other Linux distribution you use.
Warp Terminal

Firefox is the default web browser in many Linux distributions, and Ubuntu is one of them. Firefox comes preinstalled on Ubuntu unless you are using Ubuntu's minimal version.

In this tutorial, I am going to show you how to install the latest version of Firefox on Ubuntu or any other Linux distribution.

Firefox is available for almost all the Linux distributions out there. It is also preinstalled in most of them.

If that’s not the case, you should stick to the official package manager provided by your distribution for installing Firefox. That’s the easiest and best method. It will be updated automatically to newer versions with system updates.

Open the software center and search for Firefox. You should see it there and just click on the installation button.

Install Firefox by clicking on the Install button corresponding to Firefox in Software Center
Firefox in Software Center
🚧
In Ubuntu, Firefox is a Snap. So installing it via APT package manager won't work. If you need that version of Firefox, you may follow our separate tutorial on how to remove snap from Ubuntu.

If you prefer the command line, open a terminal and use the following command in Debian, and other distributions based on Ubuntu and Debian such as Linux Mint, elementary OS etc.

sudo apt install firefox

Similarly, Fedora users can use dnf command, Arch users can use pacman and other package managers provided by the distribution.

sudo dnf install firefox
sudo pacman -Syu firefox

Once installed, just look for it in the menu and launch it.

Open Firefox by searching for its name in Ubuntu Activities overview
Open Firefox from Overview

Installing Firefox using Snap or Flatpak

Firefox listed in fedora gnome software center
Firefox as a Flatpak via GNOME Software on Fedora Linux

Mozilla Firefox maintains both Snap and Flatpak packages. So, you can pick any of them in any Linux distribution.

If your software center supports Flatpak/Snap integration, you do not need to use the commands. If it does not, follow the commands for quick installation.

To install the Snap package, make sure that you have snap installed. Once done, enter the following command in the terminal (or search for it in your software center):

sudo snap install firefox

Similarly, you will have to install and configure Flatpak first. Once done, enter the following command to get it installed (or search for it in your software center):

flatpak install flathub org.mozilla.firefox

Suggested Read 📖

Flatpak vs. Snap: 10 Differences You Should Know
Flatpak vs Snap, know the differences and gain insights as a Linux user to pick the best.

Installing Firefox from the Official Website

Another method that would work in any Linux distribution is to download the binary from the Firefox website and then use it for running Firefox.

It will take more time, but if it is something you prefer, you can follow the steps below:

  1. Remove Existing Firefox

Before installing another Firefox, it is good to make sure that you don't have any Firefox already installed. So, on Debian and other similar systems, use:

sudo apt purge firefox
How to Clear the Firefox Cache [With Screenshots]
Learn to clear the Firefox cache with this simple screenshot guide. You’ll also learn about dedicated extensions and automatic cache clear.

Similarly, if you have Firefox Flatpak, it can be removed by using:

flatpak uninstall org.mozilla.firefox

On Ubuntu snap, first remove the snap version. Also remove any Firefox transitional packages.

sudo snap remove firefox
sudo apt purge firefox
  1. Download and Extract Firefox

Once the existing Firefox is removed, you can now download the Firefox files from the official website.

This will download the Firefox Tar file. To extract, open a terminal and use the following command on the directory where you downloaded it:

tar xjf firefox-*
  1. Setup Firefox

It’s a standard practice to use the /opt directory for keeping application files.

So, just to make sure that you don’t have a Firefox directory already in there, run the command below:

sudo rm -r /opt/firefox

Now, copy the extracted directory to /opt. For this, open a terminal on the location where you have the extracted Firefox directory and run:

sudo mv firefox /opt

To make it work, you need to create a symbolic link to the Firefox in /usr/local/bin.

ln -s /opt/firefox/firefox /usr/local/bin/firefox
  1. Create a Desktop File to Get an Icon on the System Menu

To access Firefox from your system menu, you need a desktop file. You can use the official format from Firefox.

🚧
You should have a directory called 'applications' in /usr/local/share/. If it's not there, first create one using sudo mkdir -p /usr/local/share/applications.

Open a terminal and run:

wget https://raw.githubusercontent.com/mozilla/sumo-kb/main/install-firefox-linux/firefox.desktop -P /usr/local/share/applications

Alternatively, you can download the desktop file by clicking on the button below. On the page, right click and select the “Save Page As” option. Save it as firefox.desktop.

Right-click on the page and select "Save Page As" option to save the Firefox Desktop File
Save the Page

Paste this firefox.desktop file to /usr/local/share/applications/.

That's it. You can now launch Firefox from the system menu.

Suggested Read 📖

How to Install Firefox ESR in Ubuntu
Want a more stable and streamlined experience with Firefox? Use Firefox-ESR, which is trusted by Debian stable.

Updating Firefox

If you have a new version, Firefox will notify you about the same on the About page. For this, click on the menu button on the top right and then go to Help ⇾ About Firefox.

From the top-right hamburger menu, go to Help and then About Firefox
Go to About Firefox

Click on the “Restart to update Firefox” button to update Firefox.

In the About Firefox window, click on "Restart to Update Firefox" button to update Firefox
Restart to Update Firefox

This will show a progress dialog box.

A small progress window will appear, notifying you about the progress of the Firefox update
Firefox Update Progress

Once completed, it will launch the updated Firefox for you.

When Firefox is restarted, it will greet you with a message, stating that the app has been updated
Firefox Updated

You can check the About page for more.

On the About Firefox page, it will display a "Firefox is up to date" message, if you are running the latest version
Firefox is Up-to-date

Uninstall Firefox

Uninstalling Firefox installed through the website is pretty straightforward. Just retrace the path you have used. First remove the Desktop file and the symlink from their respective location.

sudo rm /usr/local/bin/firefox
sudo rm /usr/local/share/applications/firefox.desktop

Now, remove the Firefox directory from /opt.

sudo rm -r /opt/firefox

You have uninstalled Firefox.

Bonus: Install Firefox Nightly Version

If you want to experience the latest features before its final release, you can install the nightly version by downloading the respective binaries from the official website.

🚧
Nightly builds are supposed to be unstable and for testing purposes only.

You can follow the same method detailed in the previous section to install it.

For Debian and its derived distributions like Linux Mint, Pop!OS etc., Mozilla provides a PPA to install Firefox Nightly version. The major advantage is that, you will get a better performance, automatic updates and also a preconfigured desktop integration.

First, you need to create a directory to store APT repository keys if it doesn't exist, and then import the Mozilla APT repository signing key.

sudo install -d -m 0755 /etc/apt/keyrings

wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null

Now, import the GPG key and add the Mozilla APT repository to your sources list.

gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); print "\n"$0"\n"}'

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

Once done, you can now update your package list and install the Firefox Nightly.

sudo apt update
sudo apt install firefox-nightly

Suggested Read 📖

9 Open Source Add-Ons to Improve Your Firefox Experience
Here are the best open-source add-ons for the Firefox web browser that will help you improve your browsing experience.

Wrapping Up

Firefox is available in various formats to install in Linux. In most cases, Firefox should come baked in with the distribution of your choice.

If it is not there, you can search for it in the software manager or get the Snap/Flatpak builds.

If you are an Ubuntu user, sticking with the default Snap version, using the pre-built binary from Firefox or Firefox Flatpak is recommended.

You can also follow our dedicated guide on removing Firefox Snap if you want to get rid of it and want to install it differently:

Uninstall Snap Packages from Ubuntu and Other Linux Distros
Here’s how you can remove Snap packages from your system. Also learn about uninstalling snap altogether.

💬 What is your preferred way of installing Firefox on Linux? Share your experiences in the comments below!

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries 🕵️‍♂️

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

It's FOSS

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.