Privacy Tools Guide

Create separate browser profiles in Firefox and Chrome to compartmentalize identities, preventing cross-site tracking, cookie leakage, and accidental logins between accounts—using -P flag for Firefox or --profile-directory in Chrome with shell aliases and scripting for automation. This foundational privacy practice stops browsers from correlating your multiple online identities.

Managing multiple online identities has become essential for privacy-conscious developers and power users. Whether you’re separating work from personal browsing, testing applications, or maintaining strict privacy boundaries, browser profiles provide the foundation for effective identity compartmentalization.

This guide covers practical methods for creating, managing, and automating separate browser profiles across major browsers.

Understanding Browser Profile Compartmentalization

Browser profiles store cookies, local storage, extensions, bookmarks, and browsing history in isolated directories. When you create separate profiles, you effectively create separate browser identities that share nothing by default.

This isolation prevents:

Creating Profiles in Firefox

Firefox offers the most developer-friendly profile management through both GUI and CLI.

Using the Profile Manager

Launch the profile manager with this command:

firefox -P

This opens an interactive dialog where you can create new profiles, rename existing ones, and select which profile to launch.

Creating Profiles via Command Line

Create a new profile named “work” directly:

firefox -CreateProfile "work"

The profile gets created in your default profile directory (typically ~/.mozilla/firefox/ on Linux, ~/Library/Application Support/Firefox/Profiles/ on macOS).

Launching Specific Profiles

Start Firefox with a specific profile:

firefox -P "work" -no-remote

The -no-remote flag prevents this instance from connecting to an existing Firefox process, allowing multiple profile instances simultaneously.

Creating Profiles in Chrome/Chromium

Chrome uses a different profile mechanism based on directory paths.

Using CLI Flags

Create and launch a profile using the --profile-directory flag:

google-chrome --profile-directory="ProfileWork"

To create a new profile, simply specify a new directory name that doesn’t exist. Chrome automatically creates it.

Managing Multiple Profiles

List available profiles by checking the profile directory:

ls ~/.config/google-chrome/

Common profile locations:

Automating Profile Management

For developers who frequently switch between profiles, automation saves significant time.

Bash Aliases for Quick Switching

Add these to your ~/.bashrc or ~/.zshrc:

alias ff-work='firefox -P "work" -no-remote'
alias ff-personal='firefox -P "personal" -no-remote'
alias ff-dev='firefox -P "development" -no-remote'

alias chrome-work='google-chrome --profile-directory="ProfileWork"'
alias chrome-personal='google-chrome --profile-directory="ProfilePersonal"'

Source your config and use ff-work or chrome-work to launch specific profiles instantly.

Launching Specific Profiles by Default

Create desktop entries or shell scripts for each identity. Example chrome-work.sh:

#!/bin/bash
google-chrome --profile-directory="ProfileWork" --new-window "$@"

Make it executable and place it in your PATH for convenient access.

Advanced: Temporary Profiles with incognito Mode

For quick identity switching without permanent profiles, use temporary browsing contexts.

Firefox temporary profile:

firefox -P "temporary" -no-remote -private

Chrome ephemeral profile:

google-chrome --incognito --temp-profile

These create isolated sessions that discard all data after closing. Useful for testing or one-off browsing tasks.

Profile-Specific Browser Extensions

Extensions enhance profile isolation when configured correctly.

Installing Extensions via CLI

Firefox allows silent extension installation:

firefox -install-global-extension /path/to/extension.xpi

For profile-specific extensions, manually install them after launching each profile.

Install different extension sets per profile:

This prevents extension conflicts and reduces cross-profile data leakage.

Security Considerations

Browser profiles provide isolation but aren’t foolproof.

Network-Level Separation

For sensitive work, combine profiles with network-level measures:

Container Extensions

Firefox Multi-Account Containers add another isolation layer within a single profile:

# Install via Firefox Add-ons: "Multi-Account Containers"

Containers separate cookies and local storage within the same profile, useful for managing multiple accounts on the same service.

Regular Profile Maintenance

Periodically clean profiles you no longer need:

# Remove Firefox profile
rm -rf ~/.mozilla/firefox/*.work

# Remove Chrome profile directory
rm -rf ~/.config/google-chrome/ProfileWork

Always back up important data before deletion.

Use Cases for Developers

Browser profiles solve common developer scenarios:

  1. Multiple AWS accounts: Separate profiles for production, staging, and development AWS consoles
  2. GitHub organizations: Different profiles for personal and work GitHub accounts
  3. API testing: Isolated environments for testing webhooks and OAuth flows
  4. Browser automation: Separate profiles for Selenium/Puppeteer test accounts

Example Puppeteer configuration using specific Chrome profiles:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    args: ['--profile-directory=ProfileWork'],
    headless: false
  });

  const page = await browser.newPage();
  await page.goto('https://github.com');
  // You'll be logged into your work account
})();

This launches Puppeteer using your existing “work” profile, preserving your logged-in session.

Quick Reference Commands

Firefox

| Action | Command | |——–|———| | Open profile manager | firefox -P | | Create profile | firefox -CreateProfile "name" | | Launch profile | firefox -P "name" -no-remote | | Private window | firefox --private-window |

Chrome/Chromium

| Action | Command | |——–|———| | Launch profile | chrome --profile-directory="ProfileName" | | Incognito | chrome --incognito | | New profile | Use Chrome’s built-in “Add profile” feature |

Built by theluckystrike — More at zovo.one