4 Ways to Install Mozilla Firefox in Ubuntu

Mozilla Firefox is the official Internet browser for Ubuntu. Therefore, most Ubuntu distros have it installed by default. If your system lacks this browser for any reason or you accidentally deleted it, we will tell you how to install it on your Ubuntu. This article will describe the following ways to install Mozilla Firefox on your system. You can choose based on the source from which you want to install Firefox and if you want to use the UI or the command line.

  • From the Snap Store through the Ubuntu Software Manager
  • From the Official Ubuntu Repository-through the command line
  • From the Mozilla PPA repository through the command line
  • From Mozilla.org website-through, the command line

We have run and tested the commands and procedures mentioned in this article on various Ubuntu versions incl., including an Ubuntu 22.04 LTS system.

Method 1: From the Snap Store through the Ubuntu Software Manager

Installing software present in the Ubuntu repository through the UI is very simple for a person who does not want to open the Command Line much. On your Ubuntu desktop Activities toolbar, click the Ubuntu Software icon.

Open the Ubuntu software center

Click the search icon and enter Firefox in the search bar. The search results will list the Firefox entry as follows:

Search for Firefox in the application list

This is the package maintained by the snap store. Click on the Firefox search entry to open the following view:

Click on the Install button

Click the Install button to begin the installation process. The following authentication dialog will display for you to provide your authentication details, as only an authorized user can install software on Ubuntu.

Authenticate yourself as admin user

Enter your password and click the Authenticate button. After that, the installation process will begin, displaying a progress bar as follows:

Installing Firefox

Mozilla Firefox will then be installed on your system, and you will get the following message after a successful installation:

Mozilla Firefox has been successfully installed

Through the above dialog, you can launch Firefox directly and remove it immediately for whatever reason.

Launch Firefox

Ideally, Firefox should now be available in your system Dock/Activities panel. You can also access it from the Ubuntu application launcher bar as follows or directly access it from the applications listing:

Launch Firefox

Remove

If you want to remove Firefox that was installed using the above method, you can remove it from your system as follows:

Open the Ubuntu Software Manager and search for Firefox as follows:

Uninstall Firefox

You will see the Installed status in the search entry as shown above. Click this entry and then click Remove from the following view:

Are you sure you want to remove Firefox?

The system will prompt you with an Authentication dialog. The software will be removed when you provide the password for sudo user and click Authenticate on the dialog.

Method 2: From the Official Ubuntu Repository through the Command Line

Firefox being the official Ubuntu browser, is also available on the Official Ubuntu repository. It can be easily installed through the command line as follows:

Open the Terminal either through the Ctrl+Alt+T shortcut or the Ubuntu Application Launcher search.

Enter the following command to update your system’s repository index with that of the internet repositories:

$ sudo apt-get update

Update Ubuntu repository list

This way, you can install the latest available software version on your system.

Then enter the following command to install Mozilla Firefox from the official Ubuntu repository:

$ sudo apt install firefox

Please note that only an authorized user( sudo) can add, remove and configure software on Ubuntu. Enter the password for sudo after which the installation procedure will begin.

Install Firefox with apt

Depending on your Internet speed, this might take some time, after which Firefox will be installed on your system.

Launch Firefox

Run the following command in your Terminal to launch Firefox:

$ firefox

Remove

You can remove Firefox completely, along with any configurations you might have made, through the following command:

$ sudo apt-get purge firefox

Removing Firefox with apt

Otherwise, you can use the following command in order to uninstall Firefox:

$ sudo apt-get remove firefox

Method 3: From the Mozilla PPA repository through the command line

The Mozilla PPA repository includes the latest version of Firefox. Follow these steps to install Firefox through this PPA repository:

First, please open the Terminal either through the system Dash or the Ctrl+Alt +T shortcut

Then, enter the following command to add the signing key for Mozilla PPA:

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A6DCF7707EBC211F

Add Mozilla PPA key

Now, enter the following command to add the Mozilla PPA repository to your Ubuntu:

$ sudo apt-add-repository "deb http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu bionic main"

Add Mozilla PPA Repository

Please note that only an authorized user can add, remove and configure software on Ubuntu. Enter the password for sudo, after which the PPA repository will be added to your system.

Tip: Instead of typing the command, you can copy it from here and paste in the Terminal by using the Ctrl+Shift+V, or by using the Paste option from the right-click menu.

The next step is to update your system’s repository index through the following command:

$ sudo apt-get update

This helps you install the latest available version of the software from the Internet.

Update packages

Now that you are done with all the prerequisites required to install Firefox use the following command as sudo to install Mozilla Firefox on your system:

$ sudo apt-get install firefox

Install latest Firefox from Mozilla PPA

Launch Firefox

Run the following command in your Terminal to launch Firefox:

$ firefox

Remove

You can remove Firefox completely, along with any configurations you might have made, through the following command:

$ sudo apt-get purge firefox

Otherwise, you can use the following command in order to uninstall Firefox:

$ sudo apt-get remove firefox

Method 4: From the official website through the command line

If you do not have, or do not want to use any other existing browser on your system, here is how to install Firefox from the official Mozilla.org website using the command line.

Open the Terminal either through the system Dash or the Ctrl+Alt+T shortcut. Enter the following command to download the Firefox Setup tar.bz2 file from Mozilla.org:

$ wget -O ~/FirefoxSetup.tar.bz2 "https://download.mozilla.org/?product=firefox-latest&os=linux64"

Download Firefox with wget command

The file is, by default, saved in the current user’s home folder.

Extract the file to the /opt folder of your Ubuntu by using the following command as sudo:

$ sudo tar xjf ~/FirefoxSetup.tar.bz2 -C /opt/

Unpack the Firefox Archive

Now, create a Firefox executable in /usr/lib/ that points to the location where you extracted the .tar.bz2 file (the /opt folder). Use the following command to do so:

$ sudo ln -s /opt/firefox/firefox /usr/lib/firefox/firefox

Create Symlink to Firefox binary

Launch Firefox

Run the following command in your Terminal to launch Firefox:

$ firefox

Remove

In order to remove Firefox installed through this method, run the following command as sudo in your Terminal:

$ sudo rm -fr /opt/firefox

You can also delete the .tar.bz2 file you initially downloaded from the Mozilla website.

So, this was not one but four ways to install Mozilla Firefox on your Ubuntu. Enjoy browsing!