When Puppeteer creates PDFs locally but fails after deployment, the PDF code is usually not the first problem. Production may be missing Chrome for Testing, shared libraries, the Puppeteer browser cache, a writable temporary directory, or a usable Chrome sandbox. First prove that the deployed process can launch the expected browser; only then debug page readiness and PDF options.
This guide separates launch failures from rendering failures and gives fixes for Node deployments, Linux servers, Docker, serverless-style hosts, and managed alternatives.
Identify the failing layer before changing your PDF code
Collect the complete server-side error, including Chrome’s stderr. A message such as Could not find Chrome points to installation or discovery; Failed to launch the browser process usually needs the underlying Chrome output; No usable sandbox! is a host-policy problem; a timeout after a successful launch is a page or PDF-readiness problem.
- Record the Puppeteer version, Node version, operating system, CPU architecture, deployment image and whether the process runs as root.
- Run a browser-only smoke test in the same deployed environment. Do not test on your laptop and assume the image is equivalent.
- Enable browser diagnostics with
dumpio: true, but remove credentials, cookies and other secrets before sharing logs. - Confirm whether the failure occurs at browser launch, page navigation, content readiness or
page.pdf().
Puppeteer’s troubleshooting guide documents protocol logging and browser diagnostics; it warns that logs can contain sensitive information.
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.
Check version and browser compatibility
Requirements change with Puppeteer releases. The current system-requirements page documents Node 22.12 or newer for that release and lists Chrome for Testing support for Windows x64, macOS x64/arm64, Debian/Ubuntu Linux x64/arm64, and openSUSE/Fedora Linux. Verify the requirements for the version actually installed in your application at Puppeteer system requirements.
Each Puppeteer release is tightly bundled with a specific browser release for compatibility with the Chrome DevTools Protocol and WebDriver BiDi. The bundled browser is the compatibility baseline; an externally installed Chrome may work, but Puppeteer does not guarantee every arbitrary browser version. Keep the package and browser paired, or deliberately pin both when using a system browser.
Useful checks in the deployed shell
node --version
npm ls puppeteer puppeteer-core
npx puppeteer browsers list
printf 'PUPPETEER_SKIP_DOWNLOAD=%sn' "$PUPPETEER_SKIP_DOWNLOAD"
printf 'PUPPETEER_EXECUTABLE_PATH=%sn' "$PUPPETEER_EXECUTABLE_PATH"
printf 'PUPPETEER_CACHE_DIR=%sn' "$PUPPETEER_CACHE_DIR"
If your package manager blocked lifecycle scripts or the build set PUPPETEER_SKIP_DOWNLOAD, install a compatible browser explicitly during the image build using Puppeteer’s browser installer, then verify that the resulting files are present in the final runtime image.
Make browser discovery deterministic
Puppeteer configuration controls browser downloads, the executable path, the cache directory and the temporary directory. Environment variables can override configuration, including PUPPETEER_SKIP_DOWNLOAD, PUPPETEER_EXECUTABLE_PATH and PUPPETEER_CACHE_DIR; see the configuration interface.
| Symptom | What to verify | Typical correction |
|---|---|---|
| Chrome executable not found | Download step, cache contents and executable path in the final image | Run the browser installer during build or set a valid executablePath |
| Works during build, fails at runtime | Whether the cache directory was copied into the runtime stage | Copy the browser cache or install it in the runtime image |
| Package install completed without a browser | Whether lifecycle scripts were disabled | Remove the skip setting where appropriate, or perform an explicit browser install |
| Permission denied in cache or temp | Directory ownership and write permissions for the service user | Use a writable cache/temp directory and run the process as that user |
Do not guess an executable path copied from another image. Print the path in the deployed environment and test that file directly.
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.
Install Linux libraries and inspect missing shared objects
A browser binary can exist and still fail immediately because the base image lacks native libraries. Minimal Debian, Ubuntu, Alpine or enterprise images commonly omit fonts, NSS, X11, graphics and audio-related libraries Chrome expects. The exact package names vary by distribution and image release.
Use ldd against the actual Chrome executable and look for lines ending in not found:
ldd /path/to/chrome | grep 'not found' || true
Install the dependencies recommended for your Puppeteer release and distribution, then repeat the check in the final image. A browser that launches on a developer workstation proves only that workstation has the required libraries; it says nothing about the production image.
Recommended Free Tools
Treat sandbox errors as a security and host-configuration issue
Chrome uses sandbox layers. If no usable sandbox is available, it can terminate with No usable sandbox!. Puppeteer’s documentation says running without a sandbox is strongly discouraged. Do not make --no-sandbox the routine fix.
Preferred order of fixes
- Run under a supported, non-root service account and preserve Chrome’s sandbox files and permissions.
- Check whether the host, container runtime or security profile blocks the sandbox.
- Use the deployment’s documented capability and namespace settings to provide a working sandbox.
- Only in an isolated environment where every opened page is trusted, consider
--no-sandboxas a conscious risk decision. Document the exception and restrict navigation; it removes an important browser isolation boundary.
If the error disappears only when the flag is added, the underlying host policy is still unresolved.
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.
Build Docker images with the browser, libraries and process model included
Puppeteer publishes a Docker image containing Chrome for Testing and its required dependencies. The Docker guide says that image is intended to run Chrome sandboxed and therefore requires the SYS_ADMIN capability. It also recommends an init process so child processes started by Puppeteer are reaped and managed correctly.
Production image checklist
- Install Puppeteer and its browser during the image build, not on first request.
- Ensure the browser cache or executable is present in the final runtime stage.
- Install all libraries required by the Chrome executable in that same stage.
- Run a launch-and-close smoke test while building or starting the deployed image.
- Provide the sandbox capability required by your chosen image, or fix the host policy rather than defaulting to
--no-sandbox. - Use an init process and set a writable temporary directory with enough space.
- Keep the Puppeteer package and bundled browser from the same release line.
If you build your own image, compare its installed packages and user permissions with the published image, then test the exact image that will serve traffic.
Apply platform-specific fixes only when they match your host
Google App Engine and Cloud Functions
Puppeteer’s troubleshooting guidance describes cache-path caveats for Google runtimes. In some deployments, placing the cache under node_modules helps when cached dependencies prevent the browser-install step from running. Use the path and runtime guidance for your specific generation of the platform; it is not a universal fix for other hosts.
Cloud Run
Cloud Run generally needs a custom Dockerfile that includes Chrome and its system packages. Add the browser to the image and run the smoke test there rather than relying on a buildpack that does not carry the executable into runtime.
Heroku
Use a Puppeteer-compatible buildpack or explicitly install the browser and libraries in the slug. Confirm the resulting executable and cache are available to the dyno process.
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
Once Chrome launches, debug PDF generation separately
A successful puppeteer.launch() shifts the investigation to navigation, page readiness, fonts, output permissions and PDF options. The PDFOptions reference documents a default timeout of 30 seconds; increasing it cannot repair a browser that never launched.
Free tools Windows power users keep installed
One-click scans. No signup required.
- Output path: a relative
pathis resolved from the Node process’s current working directory. Use an absolute path or printprocess.cwd(), and ensure the service user can write it. - Readiness: wait for the required selector, application data and fonts. Network idle alone may be unreliable for pages with analytics or long-lived connections.
- Fonts: make required fonts available in the image and use
waitForFontswhere supported by your installed version. - Layout: choose paper size, margins, orientation, page ranges and CSS
@pagedeliberately. SetprintBackground: truewhen backgrounds are part of the design. - Content: authenticated pages need headers or cookies before navigation; client-rendered pages need their data-fetching step to finish.
- Resources: give the temporary directory enough space for large pages and images.
Use a hardened Node.js rendering flow
The following example keeps launch diagnostics enabled, waits for a page-specific selector, waits for fonts, uses an absolute output path and closes the browser in a finally block. Adjust the URL, selector and options to your application.
const puppeteer = require('puppeteer');
const path = require('node:path');
async function renderPdf() {
const browser = await puppeteer.launch({
// Set executablePath only when you intentionally use a system browser.
// executablePath: process.env.PUPPETEER_EXECUTABLE_PATH,
dumpio: true,
timeout: 30000
});
try {
const page = await browser.newPage();
await page.goto('https://example.com/invoice/123', {
waitUntil: 'networkidle2',
timeout: 60000
});
await page.waitForSelector('[data-pdf-ready]', { timeout: 30000 });
if (page.waitForFonts) await page.waitForFonts();
const output = path.resolve('/tmp/invoice-123.pdf');
await page.pdf({
path: output,
format: 'A4',
printBackground: true,
preferCSSPageSize: true,
margin: { top: '16mm', right: '16mm', bottom: '16mm', left: '16mm' },
timeout: 30000
});
console.log(`Wrote ${output}`);
} finally {
await browser.close();
}
}
renderPdf().catch(error => {
console.error(error);
process.exitCode = 1;
});
Run this smoke test against a page that does not require production secrets first. Then add your authentication headers or cookies and verify that the generated file is readable by the next service in your pipeline.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server for developers. One GET request returns a PNG, JPEG, WebP or PDF. Before capture it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers.
One-call examples
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' }); const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
The ScreenshotNeo documentation covers PDF settings, full-page capture, selectors, device and retina options, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, resizing, chosen cache TTLs, signed image links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage data and the OpenAPI specification. It also provides an MCP server with take_screenshot, get_page_info and capture_pdf tools for Claude, Cursor and other MCP clients.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Every feature is on every plan. The Free plan includes 1,000 shots per month with no card; paid plans are Starter $5 for 3,000, Growth $15 for 15,000, Pro $39 for 60,000, Scale $99 for 250,000 and Business $249 for 1,000,000. Yearly billing gives two months free. If your goal is a reliable capture endpoint rather than maintaining Chrome, sign up for the free 1,000-shot plan.
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.
Common errors and targeted fixes
| Error or symptom | Likely cause | Fix |
|---|---|---|
Could not find Chrome |
Download skipped, cache missing or path wrong | Install the compatible browser in the deployed image; inspect cache and executable-path variables. |
Failed to launch the browser process |
Missing shared library, bad permissions or incompatible binary | Run ldd, install distribution-specific libraries and execute the smoke test as the service user. |
No usable sandbox! |
Host or container policy prevents Chrome sandboxing | Restore a supported sandbox and capability; treat --no-sandbox only as a restricted, trusted-content exception. |
| Works locally, fails only in Docker | Browser or libraries absent from the final stage | Copy/install them in the runtime image, configure sandbox capability and use an init process. |
| PDF timeout after a successful launch | Selector, fonts, network request or rendering never becomes ready | Wait for an application-specific selector, verify data and fonts, and increase the timeout only after readiness is correct. |
| PDF file is missing or cannot be opened | Relative path, unwritable directory or insufficient temporary space | Use an absolute writable path, check ownership and monitor disk space. |
| Layout differs from local output | Different browser revision, fonts, paper settings or CSS | Pair Puppeteer with its expected browser, install the same fonts and set paper, margins and @page explicitly. |
Choose an architecture you can operate
| Approach | Control | Operational cost | Best fit |
|---|---|---|---|
| Custom image with self-managed Chrome | Maximum control over browser, network and data location | You maintain browser revisions, libraries, sandbox policy, image size and smoke tests | Teams with container expertise and strict infrastructure requirements |
| Prebuilt Puppeteer image | Standardized browser and dependencies | You still manage capabilities, process limits, updates and application integration | Docker services that want a documented baseline |
| Managed browser or PDF service | Less host and dependency management | Evaluate provider pricing, data handling, limits, compatibility and network access | Teams that cannot maintain Chrome in production |
No published failure-rate, cost or performance statistic establishes one approach as universally superior. Base the decision on your required data location, browser compatibility, runtime limits and maintenance capacity.
FAQ
Why does raising the PDF timeout not fix launch errors?
The PDF timeout applies after a browser and page exist. Missing executables, libraries or sandbox support must be fixed at the launch layer first.
Can I use a system-installed Chrome?
Yes, if you set and verify its executable path, but Puppeteer guarantees compatibility with the browser revision bundled for its release rather than every system Chrome version.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchShould every Docker deployment add --no-sandbox?
No. Restore a working sandbox and required container capability first. The flag weakens isolation and is discouraged except for narrowly controlled trusted content.
How do I know whether the page or browser is responsible?
Run a browser-only launch-and-close test, then a simple static page PDF, and finally your authenticated application page. The first failing test identifies the layer to investigate.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

