Where Does Playwright Store Its Browsers?
Playwright ms-playwright browser cache on every OS, the env var that moves it, and why it dwarfs node_modules.
Last updated
Playwright downloads its own Chromium, Firefox and WebKit builds into an ms-playwright folder outside your project, which keeps node_modules small and test runs hermetic. Each browser version gets a subfolder, so installing a new Playwright release adds hundreds of megabytes beside the old one.
The location follows OS cache conventions and moves with one environment variable. CI machines usually pin that variable to a cached directory, since redownloading browsers on every run wastes minutes. Old versions pile up silently, so pruning them is the usual disk space win.
Where Playwright stores this, by platform
%userprofile%\AppData\Local\ms-playwright
One subfolder per browser build, each a few hundred megabytes. Set PLAYWRIGHT_BROWSERS_PATH to move it, e.g. onto a larger drive on build agents.
~/Library/Caches/ms-playwright
Same versioned layout as other platforms. System cache cleaners sometimes flag it, so exclude the path if cleaners break your test runs.
~/.cache/ms-playwright
Follows the XDG cache home. Headless shell and full browsers sit side by side here. Point PLAYWRIGHT_BROWSERS_PATH at shared storage on CI to skip downloads.
Frequently asked questions
How do I change where Playwright stores browsers?
Set the PLAYWRIGHT_BROWSERS_PATH environment variable before running the install command. Playwright uses that directory for all browser downloads from then on, on every OS.
Why is the ms-playwright folder so big?
Each Playwright version pins its own browser builds, and old ones stay behind after upgrades. Run the uninstall command for versions you no longer test against, or delete their subfolders directly.
Notice an outdated path? Let us know.