Skip to content
Tutorial emka
Menu
  • Home
  • Debian Linux
  • Ubuntu Linux
  • Red Hat Linux
Menu

How to Sandboxing Browser on Linux Desktop with Flatpak

Posted on June 23, 2026

Browser is the biggest place where bad hackers can attack your desktop computer because you open many different websites every day and you do not know if they have some dangerous exploit. If you use Fedora Linux, the default Firefox they give you is very fast and nice, but it does not have a real sandbox boundary, so it can see all your private files in your home folder. If a hacker find a zero-day exploit in your browser, he can steal your school homework, your private photos, and your passwords very easily. This tutorial show you how to delete that browser and install the Flatpak version which uses Bubblewrap and portals to keep your files safe in a strong jail.

Step 1: Delete the normal Firefox from your Fedora system

First, we must delete the old Firefox that comes with your Fedora system because that version can look at your entire home directory. Open your terminal application and type this command to remove it:

sudo dnf5 remove -y firefox

This command use the new dnf5 package manager to uninstall the native Firefox browser. The sudo word means you must write your admin password because you are changing system files, and the -y option means you say yes automatically so the terminal does not stop to ask you if you are sure. After you press enter, the terminal will delete the old browser and now your system is ready for the safe sandbox version.

Step 2: Install Flatpak Firefox and Flatseal tool

Now your computer does not have Firefox, so we need to install the safe Flatpak version from the Flathub store. We also need to install a helper app called Flatseal which has a simple window with buttons where you can see and change what permission each Flatpak app has. Run this command in your terminal:

flatpak install -y flathub org.mozilla.firefox
flatpak install -y flathub com.github.tchx84.Flatseal

This command will download the browser and the tool. Flatpak is very cool because it bundles all the libraries inside its own box so it does not make your system dirty. It can take some minutes to download if your internet connection is slow like mine, so please wait until it finish.

Step 3: Block home folder access with override commands

By default, the Flatpak Firefox still has permission to look at your home folder because the creators want to make it easy for you to upload files. But this is very dangerous because a bad script can still read your private keys. We want to tell the computer that Firefox can only see the Downloads folder, so if you download a file it works, but it cannot touch anything else. Run these two commands in your terminal:

flatpak override --user --nofilesystem=home org.mozilla.firefox
flatpak override --user --filesystem=~/Downloads org.mozilla.firefox

The first command uses the override option to say no filesystem access to the home directory. The second command says okay, you can only have access to the Downloads folder in your home directory. Now, if a hacker gets into your browser, he is trapped in a small empty box and cannot see your other folders.

Step 4: Check your new settings inside Flatseal app

It is always a good idea to verify if the commands worked correctly because sometimes we make a small typo. Open your application menu on your desktop and search for Flatseal, then open it. On the left side of the Flatseal window, you will see a list of your installed Flatpak apps. Click on the Firefox icon, and then scroll down on the right side until you see the section named Filesystem. Here, you must see that the toggle for All user files is turned off, and under the other files list, you will see only the ~/Downloads folder is written there. This means your sandbox is configured correctly.

Step 5: Do the same safe settings for Chrome or Chromium

Maybe you do not like Firefox because you prefer to use Google Chrome or Chromium for your school work or video watching. You can do the exact same security steps for them too. First, you must install them from Flatpak, and then you run the same override commands but you change the name of the application at the end.

If you use Google Chrome, write these commands:

flatpak override --user --nofilesystem=home com.google.Chrome
flatpak override --user --filesystem=~/Downloads com.google.Chrome

If you use the open source Chromium browser, write these commands:

flatpak override --user --nofilesystem=home org.chromium.Chromium
flatpak override --user --filesystem=~/Downloads org.chromium.Chromium

This works exactly the same way, so your Google Chrome is also locked inside the safe sandbox jail and cannot steal your personal files.

Step 6: Test if your sandbox is actually working

To prove that the browser is really locked up and we did not do all this for nothing, you can perform a very simple test. Open your new Flatpak Firefox and press the keys Ctrl and O together on your keyboard. This will open the file picker window where you can choose a file to open in the browser. Try to click on your Documents folder or your Desktop folder. You will see that you cannot see any files there, or the system will show an error because the browser do not have permission to open those folders. Then, click on your Downloads folder, and you will see all your downloaded files are visible. This means the sandbox is working.

Step 7: How to reset the settings if you have problems

Sometimes you might need to upload a file from your Documents folder for your school website and you are too lazy to copy it to the Downloads folder first. If you want to delete all the security rules we made and make the browser normal again, you do not need to delete the app. You can just run this simple command to reset everything:

flatpak override --user --reset org.mozilla.firefox

This command will wipe out all the custom rules we wrote for Firefox and it will go back to the default Flathub settings. It is very easy to do and you do not need to worry about breaking your system.

Step 8: Extra safe setup with Firejail or Distrobox for paranoid users

If you are very scared because you think super smart hackers are trying to target your computer, you can make the security level even higher. One way is to use a program called Firejail which is like a second cage around your browser cage. Firejail uses special profiles to block even more system calls that the browser tries to make to your Linux kernel. Another cool way is to install a tool called Distrobox. Distrobox lets you create a small container with a completely different Linux operating system inside your terminal. You can run your browser inside this Distrobox container, so even if a hacker exploits your browser, they are trapped in a fake computer that has nothing inside it.

Conclusion

Setting up a sandbox for your browser on Linux is a very smart thing to do because the web browser is the most dangerous path for viruses to enter your PC. By removing the native Fedora Firefox and replacing it with the Flatpak version, and then restricting its access to only the Downloads folder, you make your personal files much safer from zero-day exploits. It is not extremely difficult to do and it gives you a much better peace of mind when you browse the internet.

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • How to Sandboxing Browser on Linux Desktop with Flatpak
  • How to Hardening Journald on Linux Server (Fedora/AlmaLinux)
  • Block Bad USB on Linux Server with USBGuard
  • How to Secure NetworkManager on Fedora/AlmaLinux
  • How to Secure DNS and NTP in Fedora Linux
  • How to Hardening DNF on Fedora/Almalinux
  • How to Masking & Secure Daemon in Linux Server
  • How to Hardening Mount Option in Linux Server
  • How to Secure Linux Server with AIDE
  • Auditd Custom Rules & Tips
  • Securing SSH Server with fail2ban
  • Fedora Linux Firewalld Drop Zone and Rich Rules
  • How to SSH Hardening 2026
  • How to Add Password Protection to GRUB
  • Linux Kernel Hardening: Command-line Lockdown
  • Make Linux Kernel More Safe and Hardening with Sysctl Easy Way
  • How to Lockdown Root & Wheel Group in Linux
  • How to Secure Sudo in Linux (Secure Sudo Logging & Timeout)
  • Make Fedora Login Safe with Authselect and Faillock
  • How Measure Linux Security Use OpenSCAP Lynis and Systemd
  • SELinux Make Nginx Break and How to Fix It Easy
  • How See Hidden SELinux Errors When Your Server Is Broken
  • How Fix SELinux Port Denied Error With Sealert Easy Guide
  • Read SELinux AVC Denial Log Simple Guide for Noob
  • How Check and Fix SELinux Block Things in Fedora Linux
  • Inilah Cara Mengatasi OneDrive yang Suka Mengubah atau Menghapus Metadata File Kalian
  • Inilah Cara Menonaktifkan Antivirus Pihak Ketiga di Windows 11 dengan Aman
  • Inilah Cara Mengatur Raspberry Pi 5 dengan Ubuntu Server untuk Python dan Desktop GUI Tanpa Ribet
  • Inilah Alasan Kenapa Galaxy Z Fold 8 Ultra Bisa Jadi Produk yang Mengecewakan
  • Inilah Alasan Intel Merilis Raptor Lake Next di Socket LGA 1700, Masih Setia dengan DDR4!
  • How to Automate Your Entire SEO Strategy Using a Swarm of 100 Free AI Agents Working in Parallel
  • How to create professional presentations easily using NotebookLM’s AI power for school projects and beyond
  • How to Master SEO Automation with Google Gemini 3.1 Flash-Lite in Google AI Studio
  • How to create viral AI video ads and complete brand assets using the Claude and Higgsfield MCP integration
  • How to Transform Your Mac Into a Supercharged AI Assistant with Perplexity Personal Computer
RSS Error: WP HTTP Error: A valid URL was not provided.
©2026 Tutorial emka | Design: Newspaperly WordPress Theme