You can set a default browser on Linux in a few clicks, and you can do it from the desktop settings, from the browser itself, or from a terminal. The desktop route is the most reliable because it updates the system-wide setting that most apps read. The browser route works for most modern browsers because they register themselves with the desktop environment. The terminal route (xdg-settings) is the fallback when the graphical route fails or when you are on a minimal desktop. Below are the steps for each, plus what to do when the change does not stick.
What You'll Need
- A Linux desktop session (GNOME, KDE Plasma, XFCE, Cinnamon, or similar) with a browser already installed.
- Access to your user account. You do not need root for a per-user default.
- Optional: a terminal, for the xdg-settings method. This is useful on minimal or headless setups.
Step-by-Step
Menu labels differ slightly between desktop versions, distributions, and regions. Where a label is not certain, the step describes what to look for rather than an exact name.
Method 1: Set the default from your desktop settings
- Open your desktop's main Settings app. On GNOME, click the system menu in the top-right corner and choose Settings. On KDE Plasma, open the application launcher and choose System Settings. On XFCE, open the application menu and choose Settings.
- Look for a section named Default Applications, Applications, or Preferred Applications. On GNOME it is usually under Default Applications; on KDE it is under Applications > Default Applications; on XFCE it is Preferred Applications.
- Find the Web Browser entry.
- Open the dropdown and select the browser you want. Only browsers that have registered themselves with the desktop will appear.
- Close the settings window. The change applies to new launches of apps that read the default; already-open apps may keep the old browser until restarted.
Method 2: Set the default from the browser itself
- Open the browser you want to make default.
- Open its settings. In Firefox, open the menu and choose Settings. In Chrome or Chromium, open the three-dot menu and choose Settings. In Edge, open the three-dot menu and choose Settings.
- Look for a Default browser section. In Firefox it is near the top of the General panel; in Chrome and Edge it is under Default browser in the sidebar or on the main settings page.
- Click the button that sets this browser as default. The browser will call the desktop's default-app mechanism for you.
- If a dialog appears asking you to confirm, accept it. Some desktops show a confirmation prompt the first time a browser tries to claim the default.
Method 3: Set the default from a terminal with xdg-settings
- Open a terminal.
- Find the desktop file name for your browser. Run
ls /usr/share/applications | grep -i firefox(replace firefox with the browser name). The result is usually something likefirefox.desktoporgoogle-chrome.desktop. - Set the default with
xdg-settings set default-web-browser firefox.desktop, using the exact file name from the previous step. - Verify with
xdg-settings get default-web-browser. It should print the desktop file you set.
Method 4: Set the default for a specific app that ignores the system setting
- Some apps (chat clients, email clients, PDF readers) keep their own browser preference. Open that app's settings and look for a Web browser or Open links in option.
- Choose the browser you want. If the app has no such option, it will use the system default, so make sure Method 1 or 3 is set correctly.
Common Mistakes
- Setting the default in the browser but not in the desktop, or the reverse. On most desktops these are the same setting, but on some minimal setups they are separate, so set both if the change does not stick.
- Choosing a browser that is installed as a Flatpak or Snap and expecting it to appear in the desktop dropdown. Some desktops only list browsers that registered a desktop file in the system path; check the app's own settings instead.
- Using the wrong desktop file name in xdg-settings. The name must match the file in
/usr/share/applicationsexactly, including the.desktopextension. - Expecting already-open apps to switch. Most apps read the default at launch, so restart the app or log out and back in.
Tips
- If you use multiple browsers for different tasks, set the one you use for links from other apps as the default, and open the others manually when needed.
- On GNOME, the Default Applications panel is the most reliable place to change this; on KDE, the Default Applications page in System Settings is the equivalent.
- After changing the default, test it by clicking a link in an email client or chat app to confirm the correct browser opens.
- If you use a browser installed only for your user (not system-wide), its desktop file may live in
~/.local/share/applications; xdg-settings can still use it if the file name is correct.
Troubleshooting
If the change did not work, try these in order, simplest first.
- Restart the app or log out and back in. Many apps cache the default at startup.
- Re-check the desktop setting and the browser's own setting; set both to the same browser.
- Run
xdg-settings get default-web-browserin a terminal to see what the system thinks the default is. If it is wrong, set it again with the exact desktop file name. - If the browser does not appear in the desktop dropdown, check that its desktop file exists in
/usr/share/applicationsor~/.local/share/applications. If it is missing, reinstall the browser from your distribution's software center or the browser's official download page. - If a specific app still opens the wrong browser, check that app's own settings for a browser preference and change it there.
- As a last resort, log out and back in, or reboot. This clears stale session state without deleting any data.
Frequently Asked Questions
Does changing the default browser affect all users on the computer?
No. The desktop setting and xdg-settings change the default for your user account only. Other users keep their own default.
Why does my browser not show up in the Default Applications list?
Most desktops only list browsers that have registered a desktop file. If yours is missing, the browser may be installed in a way the desktop does not detect, or its desktop file may be in a nonstandard location. Check the browser's own settings for a default-browser option, or reinstall it from your distribution's software center.
Can I set a different default browser for different apps?
Only if the app has its own browser preference. The system default is one browser per user; apps that ignore it and offer their own setting can use a different one.
Do I need root to change the default browser?
No. The default browser is a per-user setting, so you can change it with your normal account. Root is only needed to install or remove browsers system-wide.
Will changing the default browser affect my bookmarks or history?
No. Setting a default only changes which browser opens links. Bookmarks, history, and passwords stay in each browser and are not moved or deleted.
What if I uninstall the browser I set as default?
The system will usually fall back to another installed browser, but the default entry may point to a missing app until you set a new default. Set a new default after uninstalling.