Change Default Web Browser in Ubuntu [Beginner's Tip]

So you found yourself a perfect browser that you always wanted and now, you want to make it your default browser?

But the question is: how do you change your default web browser on Ubuntu?

Let us find out how to do that!

Changing the default web browser on Ubuntu and other Linux

Here, I will be sharing two ways to change your default browser to make it more accessible:

  1. Using GUI (easy and recommended)
  2. Using the terminal (only works with the Xorg session)
🚧
To switch to another browser, you need to have other browsers installed on your system. For example, install Chrome on Ubuntu first and then make it default (if you want to).

Use GUI to change the default browser

By far, this is the easiest way to change your default browser, and there’s a reason why.

Unlike the other method, it works with Wayland and Xorg desktop session. So regardless of what display server you are running, you can change your browser using this method.

The steps are similar for most desktop environments. Here, I give you pointers for GNOME, KDE Plasma, and Xfce:

For GNOME

If you’re using the default offering of Ubuntu, it runs GNOME. To change the default browser on GNOME, here’s what you have to do:

Search for the default applications in the search menu and open the first search result:

Change Default Web Browser in Ubuntu [Beginner's Tip]

It will bring the list of every default app configured for your system. From here, you can change your default browser:

Change Default Web Browser in Ubuntu [Beginner's Tip]

For KDE Plasma:

If you are using KDE, then the steps to change your default browser are just about similar to GNOME and can be done in two simple steps:

  1. Search for default applications in the application menu and choose the first result.
  2. Next, select your preferred default browser from the given options.
Change Default Web Browser in Ubuntu [Beginner's Tip]

For Xfce:

If you are using Xfce desktop, open the default applications from the app menu.

In the Internet section, you will see the option to configure the default web browser:

Change Default Web Browser in Ubuntu [Beginner's Tip]

Suggested Read 📖

10 Open Source Lightweight Web Browsers for Linux
Do you think your web browser consumes too much system resources? Try these light web browsers in Linux.
Change Default Web Browser in Ubuntu [Beginner's Tip]

Use the terminal to change the default browser (Xorg only)

If you’re using the Xorg display server and want to change your default web browser, you can use the xdg-settings command.

The first step is to find the .desktop file for your next default browser. For that purpose, use the ls command in the following manner:

ls /usr/share/applications/
Change Default Web Browser in Ubuntu [Beginner's Tip]

It will bring a long list of desktop files. Sure, you can scroll through the output and find the name of your browser, but that’s a hassle.

You can pipe the previous command with the grep command to filter the output as per your needs:

ls /usr/share/applications/ | grep -w "browser-name"

For example, I’m looking for the Microsoft Edge browser, so my command would look like this:

ls /usr/share/applications/ | grep -w "edge"
Change Default Web Browser in Ubuntu [Beginner's Tip]

Once you find the desktop file for the target browser, copy the output and save it somewhere (using note-taking apps, or the default text editor) as you’ll be using it shortly.

Next, use the xdg-settings command by appending the desktop file of your target web browser (output of the previous command) as shown here:

xdg-settings set default-web-browser <browser-name.desktop>

For example, I want Microsoft Edge to be my next default web browser, so I will be using the following:

xdg-settings set default-web-browser microsoft-edge.desktop
Change Default Web Browser in Ubuntu [Beginner's Tip]

That’s it!

Want browser suggestions?

Here are some of the best browsers for Ubuntu 👇

Top 10 Best Browsers for Ubuntu Linux
What are your options when it comes to web browsers for Linux? Here are the best web browsers you can pick for Ubuntu and other Linux distros.
Change Default Web Browser in Ubuntu [Beginner's Tip]

If you are cautious about your online privacy, I suggest you switch your regular browser to a privacy-focused one.

Here’s a list of the best privacy-focused browsers:

5 Most Privacy Focused Web Browsers
The best privacy-friendly web browsers that you can try!
Change Default Web Browser in Ubuntu [Beginner's Tip]

Want something unusual? Explore these.

7 Lesser Known but Unique Web Browsers For You to Explore
Looking for something different? These unique web browsers can help you make things interesting.
Change Default Web Browser in Ubuntu [Beginner's Tip]

💬 I hope you will find this tutorial helpful. What do you like to keep as your default web browser? Let me know in the comments below!

Leave a Comment