Puppeteer "Failed to launch the browser process: No usable sandbox" in CI
Puppeteer launches Chromium, which tries to enable its sandbox. Running as root in a CI container without the SUID sandbox helper makes Chromium abort with "No usable sandbox!". Launching with the --no-sandbox flag lets it start.
What this error means
puppeteer.launch() throws "Error: Failed to launch the browser process!" with "Running as root without --no-sandbox is not supported" or "No usable sandbox!" in the captured output.
Error: Failed to launch the browser process!
[0610/120000.000000:FATAL:zygote_host_impl_linux.cc(127)] No usable sandbox!
Running as root without --no-sandbox is not supported. See https://crbug.com/638180.Common causes
Chromium runs as root in the container
Most CI containers run as root, and Chromium refuses to enable its sandbox there unless you explicitly opt out.
The SUID sandbox helper is unavailable
The minimal image lacks the setuid sandbox binary, so Chromium cannot fall back to a usable sandbox.
How to fix it
Launch with --no-sandbox
- Pass
--no-sandbox(and usually--disable-setuid-sandbox) in launch args. - Add
--disable-dev-shm-usageto avoid the small /dev/shm in containers. - Re-run so Chromium starts headless in the container.
const browser = await puppeteer.launch({
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage'],
});Or run the browser as a non-root user
If you control the image, create and switch to a non-root user so the sandbox can be enabled without disabling it.
RUN useradd -m pptruser
USER pptruserHow to prevent it
- Pass --no-sandbox for Puppeteer in root containers.
- Add --disable-dev-shm-usage to avoid /dev/shm crashes.
- Prefer a non-root user in custom images where feasible.