How to Disable Private Browsing in Firefox
In this article
Disabling private browsing in Firefox is not a built-in feature, but you can effectively block it by using a policy file (for organizations) or by setting Firefox to never remember history and locking it with a master password. This guide shows you how to achieve a similar result on Windows, macOS, and Linux, depending on your needs.
What You'll Need
- Firefox installed (any recent version, e.g., Firefox 115 or later)
- Administrator or owner access to the computer (to modify system files)
- A text editor (like Notepad on Windows, TextEdit on macOS, or nano/vim on Linux)
- For the policy method: the ability to create a new file in the Firefox installation directory
Step-by-Step
Method 1: Using a Firefox Policy (Recommended for Administrators)
- Close Firefox completely. Make sure no Firefox windows are open.
- Locate the Firefox installation folder.
- On Windows: usually
C:\Program Files\Mozilla FirefoxorC:\Program Files (x86)\Mozilla Firefox. - On macOS: right-click the Firefox app in Applications, select "Show Package Contents", then go to
Contents/Resources. - On Linux: often
/usr/lib/firefoxor/usr/lib64/firefox, depending on your distribution.
- On Windows: usually
- Create a folder named
distributioninside the Firefox installation folder. If it already exists, skip this step. - Inside the
distributionfolder, create a new text file namedpolicies.json. Use your text editor to create this file. - Paste the following code into
policies.json:{ "policies": { "DisablePrivateBrowsing": true } } - Save the file. Ensure the file is named exactly
policies.json(notpolicies.json.txt). On Windows, you may need to enable "Show file extensions" in File Explorer to avoid this. - Restart Firefox. The private browsing option (Ctrl+Shift+P / Cmd+Shift+P) will now be disabled, and the "New Private Window" option will be grayed out.
Method 2: Using Firefox's "Never Remember History" Setting (For Single Users)
- Open Firefox.
- Click the menu button (three horizontal lines) in the top-right corner.
- Select "Settings" (or "Preferences" on macOS).
- Go to the "Privacy & Security" panel.
- Under "Firefox Will", click the dropdown menu and select "Use custom settings for history". (Do not choose "Never remember history" yet; that would just clear history automatically, not disable private browsing.)
- Uncheck the box that says "Always use private browsing mode". If it's checked, uncheck it.
- Close the Settings tab. Private browsing is now not the default, but the user can still open a private window manually. To prevent that, you need to use the policy method above or set a master password (see Tips).
Method 3: Using a Master Password (Alternative for Single Users)
- Open Firefox and go to Settings > Privacy & Security.
- Scroll down to the "Passwords" section.
- Check the box "Use a master password". You'll be prompted to set a master password. Choose a strong one.
- After setting it, Firefox will require this password to access saved logins. This doesn't directly disable private browsing, but it adds a barrier if you want to prevent others from using the browser without your permission. However, it does not stop someone from opening a private window; it only protects saved passwords.
Common Mistakes
- Placing the policies.json in the wrong location. It must be in the
distributionfolder inside the Firefox installation directory, not in the user profile folder. - Naming the file incorrectly. On Windows, if you create a text file, it may be saved as
policies.json.txt. Rename it topolicies.json(remove the .txt). - Not closing Firefox before editing. Firefox may overwrite the policies file or not read it correctly if it's running.
- Using the wrong JSON syntax. Even a missing comma or extra bracket can break the policy. Copy the code exactly as shown.
- Thinking "Never Remember History" disables private browsing. It only makes Firefox clear history automatically; it doesn't prevent private windows.
Tips
- Test the policy: After creating the policies.json, open Firefox and try to open a private window (Ctrl+Shift+P). If it doesn't open, the policy is working.
- For enterprise environments: You can also deploy this policy via Group Policy on Windows or configuration profiles on macOS, which is more scalable than editing each installation manually.
- Use a separate profile for strict restrictions: Create a Firefox profile with the policy applied and set it as the default for a specific user account.
- If you want to block private browsing on a shared computer: Create a standard user account without administrator rights, so the user cannot modify the policies.json file.
- Remember that the policy only affects the browser on that machine. Users could still use other browsers or portable versions of Firefox. For full control, consider system-level restrictions.
Troubleshooting
The policy doesn't seem to work.
- Double-check the file path. On Windows, if you installed Firefox in the default location, the path should be
C:\Program Files\Mozilla Firefox\distribution\policies.json. On 64-bit systems with 32-bit Firefox, it might beC:\Program Files (x86)\Mozilla Firefox\distribution\policies.json. - Verify the JSON is valid. Use an online JSON validator or check for extra spaces or missing brackets.
- Restart Firefox completely (close all windows, then reopen). Sometimes Firefox caches the policy.
- Check if Firefox is running in a different profile. The policy applies to all profiles, but if you have a portable version, the installation folder is different.
I get an error message about the policy file.
- Firefox may show a warning if the policy file is malformed. Open the file and ensure it's exactly as shown. If you used a text editor that adds rich formatting, save it as plain text with UTF-8 encoding.
The private browsing option is still available after applying the policy.
- Make sure you're not using Firefox Developer Edition or Firefox Nightly; they may have different policy names. The policy name
DisablePrivateBrowsingworks for the standard Firefox release. - If you're on Linux and Firefox is installed via Snap or Flatpak, the installation directory is different. For Snap, it's typically
/snap/firefox/current/usr/lib/firefox. For Flatpak, it's/var/lib/flatpak/app/org.mozilla.firefox/current/active/files/lib/firefox. Adjust the path accordingly.
I can't find the distribution folder.
- Create it manually if it doesn't exist. It's not created by default.
Frequently Asked Questions
Can I disable private browsing without using policies?
No, Firefox does not offer a built-in setting to completely disable private browsing. The policy file is the only reliable way to block it.
Will the policy affect existing private windows?
No, the policy only prevents new private windows from being opened. Any private windows that were open before the policy is applied will remain until closed.
Does this work on Firefox for Android or iOS?
No, the policies.json method is only for desktop versions of Firefox. Mobile versions do not support this policy.
Can I re-enable private browsing later?
Yes, simply delete the policies.json file or remove the DisablePrivateBrowsing line, then restart Firefox.
Will this also disable the "Forget This Site" feature?
No, the policy only disables private browsing. The "Forget This Site" feature in the history sidebar still works.
Is there a way to disable private browsing for a specific user only?
Yes, you can set up separate Firefox profiles for each user. Apply the policy to the system-wide installation, which affects all users, or use a portable version of Firefox for the specific user with the policy applied.