Best 3 Ways To Install Mozilla Firefox in Ubuntu Using Terminal

This guide intends to teach you how to Install Mozilla Firefox in Ubuntu Using Terminal. Mozilla Firefox is one of the most popular web browsers among the users. You can easily use the terminal command line to install Firefox on Ubuntu including APT Repository, Flatpak, and Snapd. This guide from the Orcacore website covers the Firefox installation on all Ubuntu versions including Ubuntu 24.04, Ubuntu 22.04, and Ubuntu 20.04. Also, if you plan to remove Firefox the last step will cover this subject.

Note: Ubuntu uses Firefox ESR (Extended Support Release) as its default web browser. You can easily install Firefox and NOT affect the existing Firefox ESR in your Ubuntu system.

You can also find the Top 5 Free Web Browsers For Linux by visiting the guide and getting detailed information.

Step-by-Step Learn to Install Mozilla Firefox in Ubuntu Using Terminal

To install Mozilla Firefox in Ubuntu Using Terminal, you must access your Ubuntu server as a non-root user with sudo privileges. In this guide, we use the most recent version of Ubuntu which is Ubuntu 24.04 to show you the guide steps. For this purpose, you can easily Create a Sudo User on Ubuntu 24.04 From the Terminal.

Now you can proceed to the following steps and use one of the following methods to Install Mozilla Firefox in Ubuntu Using Terminal:

  • Method 1: APT Repository
  • Method 2: Flatpak
  • Method 3: Snap

Method 1 – Install Firefox directly from Mozilla with APT on Ubuntu

To Install Mozilla Firefox in Ubuntu Using Terminal, you can easily use the Firefox .deb package. To do this, you need to create a directory to store your APT repository keys:

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

Then, use the following commands to import and add Firefox GPG key and APT repository to Ubuntu:

# sudo apt install wget -y

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

# 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

Now you need to configure APT to prioritize packages from the Mozilla repository:

echo '
Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1000
' | sudo tee /etc/apt/preferences.d/mozilla

Finally, run the system update and use the following command to install Firefox on Ubuntu:

# sudo apt update 
# sudo apt install firefox -y

Note: If you want to use other languages in Firefox, you can search for the desired language pack and install it:

 # apt-cache search firefox-l10n
# sudo apt-get install firefox-l10n-desiredlanguagecode

Method 2 – Get Mozilla Firefox with Flatpak on Ubuntu

Another method to Install Mozilla Firefox in Ubuntu Using Terminal is to use the Flatpak package manager. In this method, you must install and enable Flatpak and then easily search for Firefox and install it.

First, you must install Flatpak and enable FlatHub with the following commands:

# sudp apt install flatpak -y
# sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Reboot your system to apply the changes.

Then, install the latest stable Firefox on Ubuntu by using the following Flatpak command:

sudo flatpak install flathub org.mozilla.firefox

When it is completed, you will get the following output:

Install Mozilla Firefox in Ubuntu Using Terminal - Use Flatpak

Next, you can run your Firefox by using the following command:

sudo flatpak run org.mozilla.firefox

Note: Also, you can create a desktop icon by using the command below:

sudo ln -s \ /var/lib/flatpak/exports/share/applications/org.mozilla.firefox.desktop \ .local/share/applications/firefox-flatpak.desktop

Method 3 – Use Snap To Install Firefox on Ubuntu Terminal

Also, you can easily use the Snap package manager to Install Mozilla Firefox in Ubuntu Using Terminal. To do this, you need to install and enable Snapd with the commands below:

# sudo apt install snapd -y
# sudo systemctl enable snapd
# sudo systemctl start snapd

Finally, use the following Snap command to install Firefox on your Ubuntu server:

sudo snap install firefox
Example Output
firefox 132.0-1 from Mozilla✓ installed

As you saw, you can easily use one of these methods to Install Mozilla Firefox in Ubuntu Using Terminal. For more information, you can check the Mozilla Firefox Official Support Page.

If you plan to uninstall Firefox, proceed to the next step.

Uninstall Firefox on Ubuntu Terminal Command Line

In this step, you can easily remove Firefox from your Ubuntu system. To do this, follow the steps below:

For the Flatpak Installation method, you can uninstall Firefox with the command below:

sudo flatpak uninstall --delete-data org.mozilla.firefox

For Snap installation method, you can remove Firefox with:

sudo snap remove --purge firefox

If you use the APT repository to install Firefox, you can remove it by using the command below:

sudo apt purge firefox -y

Also, make sure that the ~/.mozilla directory (which contains Firefox’s configuration files) is deleted:

rm -rf ~/.mozilla

Conclusion

At this point, you have learned to use various methods including APT repository, Flatpak, and Snap to Install Mozilla Firefox in Ubuntu Using Terminal. Also, you can easily uninstall Firefox anytime you don’t need it. Hope you enjoy using your web browser on Ubuntu.

Also, you may like to read the following articles:

Install Mozilla Firefox on Debian 12 Bookworm

Install Firefox on AlmaLinux 9 and RHEL 9

Installing Chrome in Linux Mint 21 Using Terminal

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!