Translation(s): none


The default web browser in Debian's GNOME environment is Firefox.

The default web browser in Debian's KDE environment is Konqueror.

These can be changed to fit your needs. If you prefer a different browser (e.g. Chromium), read below to find out how to change it in your preferred desktop.

It is similar to setting DefaultPrograms, but has some specifics.

Security Updates

Choosing a browser, pay attention if the package gets security updates.

https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.html#browser-security - 5.2.1.1. Security status of web browsers and their rendering engines in Release Notes for Debian 12 (bookworm)

For general web browser use we recommend Firefox or Chromium. They will be kept up-to-date by rebuilding the current ESR releases for stable.

Browsers using webkit2gtk are covered by security support, applications based on qtwebkit are not.

GNOME

Default for GNOME sessions (user-specific)

In the Default Applications section of the GNOME Settings, you can set your default web browser for your user in the "Web" dropdown.

Default for GNOME sessions (system-wide)

The default GNOME browser can be changed for the whole system by reconfiguring the alternative.

# update-alternatives --config gnome-www-browser


KDE

Default for KDE sessions (user-specific)

Under System Settings > Applications > Default Applications > Web Browser, change the "Open http and https URLs" setting to "in the following application" and choose your preferred browser from the dropdown list, then apply the change.

To change how htm or html files are handled when they are clicked in your file manager, change the preference under System Settings > Applications > File Associations, then search for "html" in the filetype search bar at the top. Under the "text" category, the "html" item lets you set the application preference in order. Move your favorite browser to the top.


Foreign applications

Default for foreign programs (system-wide)

Programs which are not designed for the user's desktop environment do not obey the browser settings of the desktop environment (GNOME or KDE). For example, Thunderbird ignores desktop environment-specific browser settings. The default browser for generic applications can be changed for the whole system by reconfiguring the x-www-browser alternative.

# update-alternatives --config x-www-browser

GUI Applications

A browser is started when other applications either open HTTP, HTTPS, etc. links or HTML, XHTML and similar files. It is necessary to configure handlers for these protocols and file types.

GUI applications mostly respect settings from mimeapps.list files residing in ~/.config/, /etc/xdg/, and some other locations. Some applications parses these files directly, others, e.g. Chromium use xdg-open(1). Configuration dialogs provided by desktop environment update these files. See GUI Applications in DefaultPrograms for more details.

For example, a KDE user may have installed more than one browser: chromium and firefox-esr, and would like to have firefox-esr as the default handler. Depending on whether your are going to change preference system-wide or for a specific user, The following entries should be added to the [Default Applications] section of /etc/xdg/mimeapps.list or ~/.config/mimeapps.list accordingly.

[Default Applications]
x-scheme-handler/http=firefox-esr.desktop;
x-scheme-handler/https=firefox-esr.desktop;
text/html=firefox-esr.desktop;
application/xhtml+xml=firefox-esr.desktop;
application/xhtml_xml=firefox-esr.desktop;

An alternative to editing files directly is to use xdg-settings(1) or xdg-mime(1) command line tools. Despite xdg-settings has dedicated subcommands

$ xdg-settings get default-web-browser
chromium.desktop

$ xdg-settings set default-web-browser firefox-esr.desktop

not all associations may be updated by this command. It may set x-scheme-handler/http protocol handler while e.g. KDE queries for text/html MIME type. As a result additional commands like the following one may be necessary

xdg-mime default firefox-esr.desktop text/html

Desktop environments may have non-standard configuration options overriding mimeapps.list settings, for example KDE ~/.config/kdeglobals may have BrowserApplication specified in the [General] section. The following command however has a fallback to mimeapps.list:

kreadconfig5 --file kdeglobals --group General --key BrowserApplication

BROWSER environment variable

Some tools use value of the $BROWSER environment variable when they are going to open a file or a URL in browser. See EnvironmentVariables if you are unsure how to set its value. There are 2 variants how to interpret the value.

At least urlview(1) implements extended variant, but has a fallback to the simple one.

The extended variant has not gained wide support. A possible issue with it that it is unspecified how to escape special characters in file names and URLs. Just wrapping %s into double or even single quote would cause a security vulnerability since file name or URL may contain quote characters as well.

The BROWSER project, Eric S. Raymond, 2002.


Removing alternative browsers from the system

This method involves removing all the other browsers installed on the system, so that the desired one remains the only one. Sometimes this is not feasable (multiuser system, dependencies) and is the least elegant.

Any of the previous methods is preferred to this one, but this method can be useful for lightweight systems.


Opening the default browser from a script

If you're writing a script or application for Debian that needs to be able to open the default browser, your best option is to use thesensible-browser wrapper from the sensible-utils package. This tests the common symlinks (x-www-browser, gnome-www-browser, www-browser, etc.) and chooses the most "sensible" browser out of them.

The environment variable BROWSER can be set to override its selection and force it to always choose your desired browser.


CategoryNetwork CategorySoftware CategoryRedundant: merge with WebBrowsers