Last updated: March 15, 2026

Firefox Multi-Account Containers transform how you manage identity and session isolation across websites. Originally developed as an extension, containers are now deeply integrated into Firefox, offering developers and power users a mechanism to separate contexts without launching multiple browser instances. This guide walks you through practical setup, automation strategies, and real-world applications for your development workflow.

Prerequisites

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

Step 1 - Understand Firefox Containers

Firefox containers create isolated browsing contexts that persist cookies, local storage, and site data separately. Unlike incognito mode, containers maintain state across sessions, your logged-in state remains when you reopen the container. Each container has its own cookie jar, meaning you can be simultaneously logged into the same service with different accounts.

The Multi-Account Containers extension (or built-in container support in newer Firefox versions) enables you to:

Step 2 - Install and Configuring Containers

If you’re running Firefox 115 or later, container support is built in. For earlier versions or additional features, install the Multi-Account Containers extension from Mozilla Add-ons:

No direct install via CLI, use Firefox to navigate to:
https://addons.mozilla.org/en-US/firefox/addon/multi-account-containers/

After installation, configure default containers in the extension settings. The default setup includes Personal, Work, Banking, and Shopping containers, but you should customize these for your workflow.

To create a custom container programmatically or configure it for your team:

// Firefox container configuration via about:config
// Navigate to: about:config

// Set container names (comma-separated)
pref("privacy.userContext.enabled", true);
pref("privacy.userContext.containerDefaults", "Development,Personal,Work,Testing");

// Customize container colors (hex values)
pref("privacy.userContext.personal.color", "#0078d4");
pref("privacy.userContext.work.color", "#107c10");
pref("privacy.userContext.development.color", "#d83b01");

Step 3 - Practical Development Workflows

Isolating Development Environments

When building web applications, you often need to test against different authentication states, logged out, regular user, admin user. Containers solve this elegantly:

  1. Create containers for each environment: Dev-Local, Dev-Staging, Dev-Production
  2. Log into each service with the appropriate test accounts
  3. Switch between environments instantly without clearing cookies or using private windows
// Automate container-based testing with Playwright
const { firefox } = require('playwright');

// Launch with specific container context
async function testInContainer(containerName) {
  const context = await firefox.newContext({
    containerScript: `
      // This runs in Firefox context to assign container
      let identity = Container.getIdentity('${containerName}');
      identity.assignToCurrentDocument();
    `
  });

  const page = await context.newPage();
  await page.goto('https://your-app.dev');
  return { page, context };
}

// Run tests across containers
async function runTests() {
  await testInContainer('Dev-Local');
  await testInContainer('Dev-Staging');
  await testInContainer('Dev-Production');
}

Managing Multiple GitHub Accounts

Developers frequently maintain personal and work GitHub accounts. Containers let you stay logged into both simultaneously:

This eliminates constant log-out-log-in cycles when switching between repositories.

Testing Browser Fingerprinting

Privacy-conscious developers should test how their applications handle different container environments. Containers can help verify that your tracking protection works correctly:

// Test fingerprint consistency across containers
async function checkFingerprintIsolation() {
  const containers = ['Personal', 'Work', 'Development'];
  const fingerprints = [];

  for (const container of containers) {
    const context = await createContainerContext(container);
    const page = await context.newPage();

    // Collect fingerprintable attributes
    const fp = await page.evaluate(() => ({
      userAgent: navigator.userAgent,
      language: navigator.language,
      platform: navigator.platform,
      timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
      screen: `${window.screen.width}x${window.screen.height}`
    }));

    fingerprints.push({ container, fp });
    await context.close();
  }

  // Verify isolation, if containers work correctly,
  // fingerprints should show container-specific settings
  console.table(fingerprints);
}

Advanced Container Management

Container Keyboard Shortcuts

Master these shortcuts for rapid container switching:

Organizing Containers with Labels

Use consistent naming conventions across your team or organization:

Recommended container naming pattern
{Service}-{AccountType}
GitHub-Personal
GitHub-Work
AWS-Dev
AWS-Prod
Slack-TeamAlpha
Slack-TeamBeta

Container Synchronization

Firefox Sync can synchronize container tabs across devices, but be selective about what you sync:

// Configure about:config for container sync preferences
pref("services.sync.engine.tabs", true);  // Enable tab sync
pref("privacy.userContext.ui.enabled", true);  // Show container UI

Be cautious about syncing containers that contain sensitive credentials. Consider using local containers for high-security accounts rather than syncing them across devices.

Security Considerations

While containers provide excellent session isolation, they are not a replacement for proper security practices:

For high-security workflows, combine containers with:

Step 4 - Automate Container Tasks

You can script container operations using the Firefox Container API or browser automation tools:

// Using Firefox's container-script API
// Create a userChrome.css or userScript to auto-assign containers

// ==UserScript==
// @name Auto-assign GitHub to Work container
// @match https://github.com/*
// @container Work
// ==/UserScript==

// This automatically opens GitHub in your Work container
// every time you navigate to it

Best Practices for Container Organization

  1. Name containers consistently using a predictable pattern
  2. Color-code containers by context type (green for development, blue for personal, red for sensitive)
  3. Limit container count to what you can actively manage, typically 6-8 maximum
  4. Regularly audit containers and remove ones you no longer use
  5. Document your setup so you can recreate it on new machines

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

How long does it take to 2026?

For a straightforward setup, expect 30 minutes to 2 hours depending on your familiarity with the tools involved. Complex configurations with custom requirements may take longer. Having your credentials and environment ready before starting saves significant time.

What are the most common mistakes to avoid?

The most frequent issues are skipping prerequisite steps, using outdated package versions, and not reading error messages carefully. Follow the steps in order, verify each one works before moving on, and check the official documentation if something behaves unexpectedly.

Do I need prior experience to follow this guide?

Basic familiarity with the relevant tools and command line is helpful but not strictly required. Each step is explained with context. If you get stuck, the official documentation for each tool covers fundamentals that may fill in knowledge gaps.

Is this approach secure enough for production?

The patterns shown here follow standard practices, but production deployments need additional hardening. Add rate limiting, input validation, proper secret management, and monitoring before going live. Consider a security review if your application handles sensitive user data.

Where can I get help if I run into issues?

Start with the official documentation for each tool mentioned. Stack Overflow and GitHub Issues are good next steps for specific error messages. Community forums and Discord servers for the relevant tools often have active members who can help with setup problems.

Related Articles