Install Brave Browser in Debian 12 to Block Ads & Trackers

This is a step by step beginner’s guide shows how to install Brave web browser in Debian 12 Stable, though it should also work for Ubuntu.

Brave is a free open-source web browser based on Chromium. It features out-of-the-box support for blocking advertisements and website trackers.

The browser is available to install in Linux through 3 official ways. They include:

  • Native .deb/.rpm package, for Debian/Fedora based systems.
  • Flatpak package, runs in sandbox environment.
  • Snap package, runs in sandbox environment.

Choose any one of them that you prefer. If you want to build the browser package by yourself, then go to github page for the source code.

Option 1: Install Brave browser .deb package

The software developer team provides an official apt repository, which keeps updating with the most recent browser package in .deb format for Debian and its based systems.

1. Add Brave apt repository

To add the software repository, first open up a terminal window either from start menu or by pressing Ctrl+Alt+T on keyboard.

Then, download & install the key file by running the single command below in terminal window:

sudo curl -fsSLo /etc/apt/keyrings/brave-browser-beta-archive-keyring.gpg

This command uses curl command line tool to download the .gpg key file, and saves it to /etc/apt/keyrings directory.

In case curl command not found, run command sudo apt install curl to install it. Also, run sudo mkdir -p /etc/apt/keyrings if the directory does not exist.

Next, add the apt repository to your system by running command:

echo "deb [signed-by=/etc/apt/keyrings/brave-browser-archive-keyring.gpg] stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list

This command creates a .list file under /etc/apt/sources.list.d directory, and writes the content under quotes into that file. Thus, your system can find the packages from that repository.

To verify, run cat /etc/apt/sources.list.d/brave-browser-release.list to print the file content in terminal window.

2. Install Brave from the apt repository

After that, refresh your system package cache by using the command below in a terminal window:

sudo apt update

In the terminal window, there should be a output line says something “Hit/Get …“.

Finally, install the web browser package by running command:

sudo apt install brave-browser

For choice, you may use “Synaptic” package manager, and use it to search & install brave-browser package after “Reload” to refresh cache.

Option 2: Install Brave Flatpak package

For choice, the browser can be also installed as Flatpak package in amd64 and arm64 platforms.

The package runs in sandbox environment, which may be safer and easy for permission control (i.e., using Flatseal). However, it needs separate daemon, as well as run-time libraries that take more disk spaces.

1. First, open terminal (Ctrl+Alt+T) and run command to enable Flatpak support:

sudo apt install flatpak

2. Then, install Brave flatpak package by running the command below in terminal:

flatpak install

NOTE: If this is the first app installed as Flatpak package, then you may need to log out and back in for the app icon visible!

And, to check updates for the package use command:

flatpak update com.brave.Browser

Option 3: Install Brave Browser Snap package

Like Flatpak, the browser is also available to install as Snap package that runs in sandbox.

  • Enable snap support by running command:
    sudo apt install snapd
  • Then, install the browser as Snap package by using command:
    sudo snap install brave

Also, you may need to log out and back in to apply the PATH for snap applications.

Uninstall Brave Web Browser

  • For the native .deb package, run the command below in a terminal window to uninstall the browser package:
    sudo apt remove --autoremove brave-browser

    Also, delete the source repository and key file by running command:

    sudo rm /etc/apt/keyrings/brave-browser-archive-keyring.gpg /etc/apt/sources.list.d/brave-browser-release.list

    Finally, run sudo apt update command to refresh system package cache.

  • If you installed the package via Flatpak, then run the command below instead in terminal to uninstall:
    flatpak uninstall --delete-data com.brave.Browser

    Then, run flatpak uninstall --unused to clean up useless run-time libraries. If you don’t have any other Flatpak apps in system, you may also remove the daemon package by running command:

    sudo apt remove --autoremove flatpak
  • And, to remove the Snap package, use command:
    sudo snap remove --purge brave

    Also run sudo apt remove --autoremove snapd will remove the daemon, as well as other Snap apps (if any).

Hi, I'm Merilyn Ne, a computer geek working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.