How to Change the Default Web Browser in Ubuntu Linux

When you install Ubuntu Linux on a desktop or laptop, Mozilla Firefox is typically set as the default web browser right out of the box. While Firefox is an excellent, privacy-focused, open-source browser that many Linux enthusiasts love, you might prefer to use Google Chrome, Brave, Chromium, or Vivaldi for your daily tasks. However, simply installing a new browser does not automatically make it the default application for opening links across your operating system.

If you want all your web links from external applications—such as email clients, PDF documents, and chat applications like Slack or Discord—to seamlessly open in your preferred browser, you must know how to change the default web browser in Ubuntu Linux. Fortunately, this configuration can be done quickly via the graphical user interface (GUI) or precisely through the command-line terminal.

Why Change Your Default Browser?

Changing your default browser is a fundamental step in customising your Linux environment. You might want to switch if:

  • You are heavily invested in the Google ecosystem and rely on Chrome’s profile syncing.
  • You require a specific browser for web development and testing.
  • You prefer the aggressive ad-blocking capabilities of a browser like Brave.
  • You find that Firefox consumes too many system resources on your specific hardware configuration.

Prerequisites and Requirements

Before attempting to change the default setting, ensure that:

  • You have successfully installed the alternative web browser you wish to use on your Ubuntu system.
  • You have basic familiarity with navigating the Ubuntu Settings menu (for GUI methods).
  • You have administrator (sudo) privileges on your user account if you plan to use the terminal method.

Method 1: Change the Default Browser Using the GUI (Settings)

For most desktop users running standard Ubuntu with the GNOME desktop environment, changing default applications through the Settings menu is the quickest and most straightforward method.

Step 1: Open System Settings

Click on the system menu in the very top-right corner of your screen (where your network connection, volume, and battery icons are located) and select Settings from the drop-down menu. Alternatively, you can press the Super key (Windows key) on your keyboard and type “Settings” to search for the application.

Step 2: Navigate to Default Applications

In the left-hand sidebar of the Settings window, scroll down to the bottom and click on Default Applications. (Note: If you are using an older version of Ubuntu, such as 18.04 or earlier, this might be located under Details > Default Applications).

Step 3: Select Your Preferred Web Browser

You will see a list of default applications for various system categories, including Web, Mail, Calendar, Music, and Video. Click the drop-down menu situated next to Web.

A list of all currently installed web browsers on your system will appear. Simply select your preferred browser (e.g., Google Chrome, Brave, or Opera) from the list. The change is saved automatically the moment you make the selection, and you can safely close the Settings window.

Method 2: Change the Default Browser via the Command Line

If you prefer working in the terminal, are using a different desktop environment (like XFCE or KDE), or are managing a remote Ubuntu system via SSH, you can update your system-wide default browser using the powerful update-alternatives command.

Step 1: Open the Terminal

Press Ctrl + Alt + T on your keyboard to quickly open a new terminal window.

Step 2: Run the Update Alternatives Command

Type the following command and press Enter:

sudo update-alternatives --config x-www-browser

You will be prompted to enter your administrator (sudo) password. Note that when typing your password in the Linux terminal, no characters or asterisks will appear on the screen for security reasons; simply type it and press Enter.

Step 3: Choose Your Browser from the List

The terminal will output a list of all installed web browsers on your system, each assigned a specific selection number. The currently active default browser is marked with an asterisk (*).

There are 4 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).

  Selection    Path                           Priority   Status
------------------------------------------------------------
* 0            /usr/bin/firefox                40        auto mode
  1            /usr/bin/brave-browser          30        manual mode
  2            /usr/bin/firefox                40        manual mode
  3            /usr/bin/google-chrome-stable   30        manual mode

Press <enter> to keep the current choice[*], or type selection number:

Type the specific selection number corresponding to the browser you want to use (for example, type 3 for Google Chrome) and press Enter.

Step 4: Verify the Change

To ensure the system successfully registered the change, you can test it by opening a website directly from the terminal using the generic default browser command:

x-www-browser https://digitash.com

Your newly chosen browser should instantly launch and open the specified URL.

Troubleshooting Common Issues

Links Still Open in Firefox

If you used the terminal method but links clicked in specific GUI applications still open in Firefox, it means the GNOME desktop environment is overriding the system-wide x-www-browser setting. In this case, you must run an additional command to update the MIME type configuration:

xdg-settings set default-web-browser google-chrome.desktop

(Replace google-chrome.desktop with the correct desktop file name for your chosen browser, such as brave-browser.desktop).

Frequently Asked Questions

Will changing the default browser delete my bookmarks in Firefox?

No. Changing the default application only tells the operating system which program to use to open web links. It does not uninstall Firefox, nor does it delete any of your bookmarks, history, or saved passwords.

Can I have multiple browsers installed on Ubuntu?

Yes, absolutely. You can install as many web browsers as you like on a Linux system. They will all function independently, but only one can act as the system-wide default for opening external links.

Whether you prefer clicking through the graphical Settings menu or executing commands in the terminal, learning how to change the default web browser in Ubuntu Linux takes only a few seconds. Customising your default applications is a critical step in building a Linux environment that ensures a smoother, more efficient workflow tailored exactly to your personal preferences.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.