Sun
Explore guidesWatch episodes on YouTube

How to configure Firefox for privacy and security

Caveats

  • When copy/pasting commands that start with $, strip out $ as this character is not part of the command

Setup guide

Step 1: install Firefox

Go to https://www.mozilla.org/en-US/firefox/new/, download and install Firefox.

Step 2: add arkenfox/user.js to profile

Heads-up: see user.js to learn more about settings.

Start Firefox, paste “about:profiles” in address bar and press Enter.

Find default profile root directory and copy path to clipboard.

Download user.js to default profile root directory.

Heads-up: replace /Users/sunknudsen/Library/Application Support/Firefox/Profiles/rzrw17yo.default-release with default profile root directory copied to clipboard.

$ cd "/Users/sunknudsen/Library/Application Support/Firefox/Profiles/rzrw17yo.default-release"
$ curl --fail --remote-name https://raw.githubusercontent.com/arkenfox/user.js/refs/heads/master/user.js

Step 3: append user-overrides.js to user.js

Heads-up: enables Mullvad DNS over HTTPS.

$ curl --fail --remote-name https://sunknudsen.com/guides/how-to-configure-firefox-for-privacy-and-security/user-overrides.js
$ cat user-overrides.js >> user.js

Step 4 (optional): enable Mullvad SOCKS5 proxy kill switch (disabled by default, Mullvad app and subscription required)

Open user.js and user-overrides.js using text editor and set network.proxy.type to 1.

Step 5: restart Firefox

Step 6: install Firefox Multi-Account Containers and Privacy Badger extensions

Go to https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/ and click “Add to Firefox”.

Go to https://addons.mozilla.org/en-US/firefox/addon/privacy-badger17/ and click “Add to Firefox”.

Heads-up: when asked to allow extension to run in private windows, check box and click “Okay”.

Step 7: set default search engine to DuckDuckGo

Paste “about:preferences#search” in address bar, press Enter and set default search engine to “DuckDuckGo”.

Step 8: uncheck all search shortcuts

Paste “about:preferences#search” in address bar, press Enter and uncheck all search shortcuts.

Step 9: configure containers (see episode)

Step 10: check for DNS and WebRTC leaks

Go to https://mullvad.net/en/check.

Connection checkConnection check

No DNS leaks

No WebRTC leaks

👍

Usage guide

Temporarily disable cookie and site data deletion (useful when Firefox is restarted to install update or one wishes to reboot computer while persisting Firefox sessions)

Heads-up: “Delete cookies and site data when Firefox is closed” will be enabled again next time Firefox starts.

Start Firefox, paste “about:preferences#privacy” in address bar and press Enter.

Uncheck “Delete cookies and site data when Firefox is closed”.

Want things back the way they were before following this guide?

Delete user.js and user-overrides.js and set Firefox settings as they were before following guide.

Copyright (c) Sun Knudsen
Get in touch