Last updated: March 16, 2026

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.

Table of Contents

Prerequisites

Before you begin, make sure you have the following ready:

Step 1 - Understand 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:

Step 2 - Create 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.

Step 3 - Create 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:

Step 4 - Automate 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.

Step 5 - 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.

Recommended Extension Strategy

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.

Step 6 - 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.

Step 7 - 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 |

Troubleshooting

Configuration changes not taking effect

Restart the relevant service or application after making changes. Some settings require a full system reboot. Verify the configuration file path is correct and the syntax is valid.

Permission denied errors

Run the command with sudo for system-level operations, or check that your user account has the necessary permissions. On macOS, you may need to grant terminal access in System Settings > Privacy & Security.

Connection or network-related failures

Check your internet connection and firewall settings. If using a VPN, try disconnecting temporarily to isolate the issue. Verify that the target server or service is accessible from your network.

Frequently Asked Questions

Who is this article written for?

This article is written for developers, technical professionals, and power users who want practical guidance. Whether you are evaluating options or implementing a solution, the information here focuses on real-world applicability rather than theoretical overviews.

How current is the information in this article?

We update articles regularly to reflect the latest changes. However, tools and platforms evolve quickly. Always verify specific feature availability and pricing directly on the official website before making purchasing decisions.

Are there free alternatives available?

Free alternatives exist for most tool categories, though they typically come with limitations on features, usage volume, or support. Open-source options can fill some gaps if you are willing to handle setup and maintenance yourself. Evaluate whether the time savings from a paid tool justify the cost for your situation.

Can I trust these tools with sensitive data?

Review each tool’s privacy policy, data handling practices, and security certifications before using it with sensitive data. Look for SOC 2 compliance, encryption in transit and at rest, and clear data retention policies. Enterprise tiers often include stronger privacy guarantees.

What is the learning curve like?

Most tools discussed here can be used productively within a few hours. Mastering advanced features takes 1-2 weeks of regular use. Focus on the 20% of features that cover 80% of your needs first, then explore advanced capabilities as specific needs arise.

Related Articles