What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
When a Playwright persistent context will not launch in Docker, check profile-directory ownership and reuse first: give each browser process its own automation-only user data directory, then make sure the Playwright package and container image versions match. After that, check Docker’s process and shared-memory settings, whether headed mode has a display, and browser launch logs.
What a persistent context changes
browserType.launchPersistentContext(userDataDir, options) launches a browser that keeps profile data—such as cookies and local storage—in a directory on disk. The call returns the browser’s only context, not a new context alongside other contexts. Closing that context also closes the browser. See the Playwright BrowserType API.
This persistence is useful when a workflow needs profile state to survive browser restarts. It also makes the directory a resource that must be isolated: two browser processes cannot use the same user data directory. Do not point automation at your everyday Chrome profile. Start with a separate, automation-only directory instead.
Use a unique profile directory for each browser process
A common failure is two containers, workers, or test runs attempting to launch against the same mounted profile directory. The browser may refuse to start or exit because its profile is already in use. A persistent profile is not a shared database for concurrent browser processes.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errors#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
- Choose a dedicated path. Use an empty directory created for automation, such as
/profiles/run-001. Do not target Chrome’s normal user profile. - Assign a distinct path to every concurrent process. For example, use a unique run or worker identifier:
/profiles/worker-0,/profiles/worker-1. - Close the persistent context before relaunching against its directory. Closing the context closes the browser and releases its use of the profile.
- Check mount permissions. Ensure the container user can create, read, and write the chosen directory. If the directory is mounted from the host, its ownership and permissions must allow that user access.
If the profile must retain state between runs, keep the directory for sequential reuse, but do not run two browser processes against it at once. If a run ended abnormally, first make sure no browser process is still using the directory before retrying.
Keep Chrome’s default profile out of automation
Use a separate user data directory rather than mounting or targeting Chrome’s normal default profile. Playwright’s API documentation warns that automating Chrome’s default profile is unsupported under recent Chrome policy changes and can cause pages not to load or the browser to exit.
Playwright’s test generator documentation specifically says that, as of Chrome 136, the default user data directory cannot be accessed through automation and a separate directory must be created. That cutoff is a Chrome-specific note; it should not be applied to Firefox or WebKit. For all engines, a clean automation-only profile is the safer setup.
Align the Playwright package and Docker image
The Playwright package installed in your project must match the Playwright version in the container image. The official image includes browser binaries and system dependencies, but it does not install your project’s Playwright package for you. A mismatch can leave Playwright unable to locate the browser executable it expects. See the Playwright Docker documentation.
Recommended Free Tools
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
- Check the Playwright version declared in your project’s dependency file or lockfile.
- Check the image tag used by Docker and make its Playwright version match the project dependency.
- Pin a versioned image tag rather than relying on a floating tag, so the browser environment does not change unexpectedly.
- When upgrading Playwright, update the image and package together, then rebuild the image.
Image tags change over time. Verify the currently supported tag in the Docker documentation when selecting or updating one; do not assume an example version remains current.
Use Docker settings that support browser processes
Playwright recommends two Docker runtime options that address general browser stability, not persistent-profile behavior specifically:
--initlets an init process handle container process lifecycle details and helps avoid zombie processes.--ipc=hostis recommended for Chromium. Without it, Chromium can run out of memory and crash.
For example, a local run can add both options to the container command:
docker run --init --ipc=host your-playwright-image
Use your actual image name and any required mounts or command arguments. Treat --cap-add=SYS_ADMIN differently: Playwright lists it as a local development diagnostic for unusual Chromium launch errors. It is not a default deployment setting, and adding a capability should be evaluated against the container’s security requirements.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Choose the user and sandbox configuration for the sites you visit
The documented Playwright Docker image runs as root by default, which disables Chromium’s sandbox. Playwright says this may be acceptable for trusted end-to-end tests. For scraping or crawling untrusted sites, its guidance is to use a separate user and the supplied seccomp approach, which allows the user-namespace operations needed by sandboxed Chromium.
Do not treat disabling the sandbox as a universal launch fix. Decide based on what pages the browser can reach and the isolation your workload needs. Consult the Docker guidance for its user and seccomp configuration before adapting it to a production container.
For headed Linux runs, provide Xvfb
Playwright runs headless by default, so a visible display is not needed for the usual headless container run. If you explicitly launch a headed browser on Linux, a display server is required. Playwright’s CI documentation says headed execution on Linux requires Xvfb and shows xvfb-run as a command prefix; the Playwright Docker image and GitHub Action have Xvfb installed. See Playwright Continuous Integration.
For a headed command in an environment with Xvfb installed, use the documented pattern:
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
xvfb-run your-test-command
Use the actual test command for your project. If you do not need to inspect a visible browser window, use headless mode rather than adding display infrastructure.
Enable launch logs before changing more settings
When the browser still fails to launch, capture the actual failure rather than guessing at the cause. Playwright explicitly recommends browser-level logs for “Failed to launch browser” errors:
DEBUG=pw:browser your-test-command
For more verbose Playwright API-level logs, the debugging guide documents DEBUG=pw:api. Begin with pw:browser for a launch problem, and include the full container command, image tag, Playwright package version, browser engine, profile mount, and error output when investigating it. The logging guidance is in the CI documentation.
Troubleshoot by symptom
| Symptom | Likely check | Action |
|---|---|---|
| Browser exits immediately or says the profile is in use | Another process uses the same user data directory, or a previous browser has not closed. | Stop competing processes, close the persistent context, and launch with a unique automation directory. |
| Pages fail to load with Chrome profile errors | Automation is targeting Chrome’s default user data directory. | Use a separate profile directory. Chrome 136 and later explicitly disallow automation access to the default directory in Playwright’s codegen documentation. |
| Playwright cannot find a browser executable | The project package and container image versions differ, or the expected browser is absent. | Align the versions and rebuild using a matching Playwright image; confirm the selected image tag in the Docker documentation. |
| Chromium crashes or reports memory-related failures | Container shared-memory configuration may be inadequate. | Try the documented --ipc=host recommendation for Chromium. Check container resource limits as well. |
| Headed launch fails in Linux with no display | No X server is available in the container. | Install or use Xvfb and prefix the command with xvfb-run, or switch to headless mode. |
| Unusual Chromium launch error in local development | Container configuration or permissions may be involved. | Enable DEBUG=pw:browser first. Playwright documents --cap-add=SYS_ADMIN as a local diagnostic experiment, not a general deployment fix. |
| Profile works locally but not in the container | The mounted directory may not be writable by the container user. | Check directory ownership and permissions for the effective container user; use a dedicated writable mount. |
Keep persistent runs reliable and controlled
- Make profile ownership explicit. Associate one profile directory with one active browser process. Avoid a shared directory across parallel jobs.
- Clean up deliberately. Close the persistent context when a run ends so the browser releases the profile. Decide whether to retain the directory for sequential state reuse or remove it for a fresh run.
- Pin and upgrade together. Treat the package and container image as a matched pair and update both intentionally.
- Separate trusted and untrusted workloads. A test suite against controlled sites and a crawler visiting arbitrary pages have different sandbox requirements.
- Capture useful failure context. Keep launch logs and the exact image, package, engine, runtime flags, and profile path with the error report.
The official guidance does not establish a universal memory limit, startup time, or failure rate for persistent contexts. Those depend on the page, browser engine, workload, container limits, and profile state; diagnose the specific run rather than assuming one resource number will fix every crash.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Or skip the browser setup
If your goal is to capture a website rather than run an interactive browser workflow, ScreenshotNeo offers a screenshot API and MCP server. A single GET request can return an image or PDF, without configuring Playwright and a browser container. The options and response details are in the ScreenshotNeo documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots, and 1,000 screenshots per month are free with no card; paid plans start at $5 for 3,000. For a persistent Playwright workflow or custom browser interaction, the Docker setup above remains the relevant approach.
Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.
Frequently asked questions
Can two Playwright browsers use the same persistent profile if they run in separate containers?
No. Separate containers do not make concurrent access to the same user data directory safe. Give each active browser process a different directory, or run them sequentially with the context closed between runs.
Does Firefox or WebKit have the Chrome 136 profile restriction?
The Chrome 136 cutoff cited by Playwright applies to Chrome’s default user data directory. It is not a stated version cutoff for Firefox or WebKit. A separate automation profile is still the appropriate choice for persistent automation.
Does --ipc=host fix every persistent-context crash?
No. It addresses a Chromium shared-memory stability concern; it does not resolve profile conflicts, version mismatches, missing displays, permissions, or every other launch failure.

