Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

How to Take a Puppeteer Screenshot with Chrome Installed on Ubuntu

A practical guide to using Puppeteer with system-installed Chrome on Ubuntu, including executable paths, screenshot options, Linux dependencies, and sandbox troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use Puppeteer’s Page.screenshot() method. If you want to use Chrome already installed on Ubuntu, launch Puppeteer with that installation’s verified executable path, navigate to the page, capture it, then close the browser. Ubuntu installations do not all put Chrome at the same path, so don’t copy a path without checking it on your machine.

Take a screenshot with installed Chrome

This example uses the puppeteer package and an explicit path to your installed browser. Replace the illustrative path with the actual Chrome or Chromium executable on your system.

As an Amazon Associate I earn from qualifying purchases.

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
  executablePath: '/path/to/installed/chrome',
});

try {
  const page = await browser.newPage();
  await page.goto('https://example.com', { waitUntil: 'networkidle2' });
  await page.screenshot({ path: 'screenshot.png' });
} finally {
  await browser.close();
}

Save this as an ES module, for example screenshot.mjs, and run it in a Node.js project where puppeteer is installed. Puppeteer documents Page.screenshot() with a file path and browser shutdown as the basic capture sequence (Puppeteer screenshots guide).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Find and verify the browser executable

Use the executable path provided by your own Chrome installation. Puppeteer’s official documentation does not establish one universal Ubuntu path for every installation method. Confirm the path using the installation method you used, and make sure the file exists and is executable before passing it to executablePath.

#1 Best Overall
Panasonic Toughbook CF-31 MK5 Rugged Laptop, 13.1in i5, 8GB 256GB (Renewed) | Touch, 4G LTE, Backlit Keyboard, Linux Ubuntu OS
  • [ULTRA-RUGGED DESIGN] MIL-STD-810G and IP65 certified. Built to survive 6-foot drops, heavy rain, and extreme vibrations. Features a magnesium alloy chassis with an integrated carry handle for maximum portability
  • [4G LTE - WORK ANYWHERE] Integrated 4G LTE Multi-Carrier Mobile Broadband. Stay connected to the internet in remote areas or on the road without relying on Wi-Fi or phone hotspots. True mobile freedom for field professionals
  • [1200-NIT SUNLIGHT READABLE] 13.1" XGA Touchscreen with CircuLumin technology. At 1200 nits, it is nearly 4x brighter than a standard laptop, ensuring perfect visibility under direct, intense sunlight
  • [LINUX UBUNTU PRE-INSTALLED] Fast, secure, and bloatware-free. Optimized for developers, network engineers, and diagnostic software that thrives in a stable, open-source environment
  • [LEGACY SERIAL PORT] Features a native RS-232 Serial Port, HDMI, and USB 3.0. Essential for connecting directly to industrial machinery, CNCs, and automotive diagnostic tools without unreliable adapter

Choose between system Chrome and Puppeteer’s browser

The package choice depends on who manages the browser. The regular puppeteer package normally downloads a compatible Chrome for Testing build; puppeteer-core does not download a browser and is intended for a browser you manage yourself or a remote browser. For a locally installed browser with either setup, specify a supported executablePath or channel as appropriate (Puppeteer installation guide, Puppeteer configuration).

Approach Browser source What to consider
puppeteer default Downloads Chrome for Testing intended to work with Puppeteer. The current installation guide estimates a Linux download of about 282 MB; this is approximate and may vary by release and configuration. Puppeteer’s compatibility guarantees apply to Chrome for Testing binaries, not every system browser build.
puppeteer-core with installed Chrome You manage the local browser. Pass the verified executable path or a supported channel. Check browser-version compatibility rather than assuming every installed Chrome or Chromium build is guaranteed to work.

If package installation scripts are blocked by your package manager, Puppeteer’s installation guide says to install the browser manually with npx puppeteer browsers install. See the live guide for current installation details and compatibility notes (Puppeteer installation guide, Puppeteer browser API).

Set the right capture and page-readiness behavior

The sample waits for networkidle2, matching Puppeteer’s documented basic example. It is not the right readiness signal for every site: pages with persistent connections or delayed client-side rendering may not be ready when that condition occurs, or may never satisfy it in the way you expect. Use an application-specific condition, such as waiting for a selector that appears when the content is ready, if the captured page is incomplete.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For a full-page image, pass fullPage: true to page.screenshot(). To capture a single element, select it and use the element handle’s screenshot method:

Rank #2
HP 17 Business Laptop - Linux Mint Cinnamon - Intel Quad-Core i5-10210U, 32GB RAM, 1TB PCIe NVMe SSD + 1TB Storage HDD, 17.3" Inch HD+ (1600x900) Display
  • Intel Core i5-10210U (up to 4.2GHz) - 1TB PCIe NVMe + 1TB HDD - 32GB DDR4 SDRAM
  • 17.3" HD+ (1600x900) Display, Intel UHD Graphics 620
  • Built in HD 720p Webcam with Microphone - Bluetooth Version4.2
  • I/O Ports: 2x USB 3.1 (Data Only), 1x USB 2.0, 1x HDMI, 1x Headphone/Microphone Combo Jack
  • Linux Mint Cinnamon 64-Bit - 6-Row Keyboard w/ Full Numberpad
const card = await page.waitForSelector('.report-card');
if (!card) throw new Error('Report card was not found');
await card.screenshot({ path: 'report-card.png' });

Puppeteer documents ElementHandle.screenshot(); by default it attempts to scroll the element into view when hidden (Puppeteer screenshots guide).

Resolve Chrome launch failures on Ubuntu

Check missing shared libraries first

If Chrome exits before a page opens, check whether its Linux shared-library dependencies are present. Puppeteer’s troubleshooting guide suggests inspecting unresolved libraries with ldd chrome | grep not (run it against the actual browser executable). Its Debian/Ubuntu dependency guidance covers certificates and fonts, audio and accessibility libraries, GTK and NSS, graphics libraries, and X11 libraries. Follow the current dependency list rather than relying on an old copied package list, because requirements can change (Puppeteer troubleshooting guide).

Puppeteer documents this browser-installation option for Chrome on Ubuntu/Debian:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
npx puppeteer browsers install chrome --install-deps

This command installs Chrome through Puppeteer’s browser installation path and requires root privileges. If you are using a separately managed system Chrome, you may instead need to install the operating-system dependencies required by that binary.

Rank #3
Lenovo IdeaPad Slim 3 Linux Laptop, 15.6" FHD Touchscreen Laptop, 8-Core AMD Ryzen 7 5825U, 16GB RAM, 512GB SSD, Keypad, SD Card Reader, Stylus Pen + External Portable SSD + USB Hub, Linux Ubuntu OS
  • Powerful Linux Laptop: This IdeaPad Slim 3 Laptop comes pre-installed with Ubuntu Linux, offering fast performance, robust security, and a clean, user-friendly experience. Enjoy full customization, seamless hardware compatibility, and access to thousands of open-source apps. Whether you're working, creating, or coding, it's built to keep up with everything you do.
  • A Multitasking Master: The latest AMD Ryzen 7 5825U processor (up to 4.5 GHz) delivers powerful performance with 8 cores and 16 threads for smooth multitasking. Integrated AMD Radeon Graphics provide crisp visuals for streaming, browsing, photo editing, and casual gaming. With smart machine intelligence, it adapts to your needs for a fast, responsive experience.
  • 15.6" Full HD Display: The IdeaPad Slim 3 boasts an 88% screen-to-body ratio for a floating, edge-to-edge visual experience. TÜV Low Blue Light certification reduces eye strain, making it perfect for long work or study sessions.
  • Military-Grade Durability: The smart IdeaPad Slim 3 combines portability and durability, letting you work, study, and play on the go. With a profile 10% slimmer than the previous generation, it's lightweight yet military-grade rugged, ready for anything, anywhere.
  • Versatile Connectivity: Enjoy the security of a built-in webcam with a privacy shutter. Connect effortlessly with multiple ports: 2x USB A, 1x USB C, 1x HDMI, 1x SD Card Reader, 1x Headphone/Microphone combo. Bundle comes with Stylus Pen, 256GB Portable SSD and 5-in-1 Docking Station.

Keep the sandbox enabled where possible

Do not make --no-sandbox a default fix. Puppeteer says running without a sandbox is strongly discouraged and recommends sandboxed Chrome (Puppeteer troubleshooting guide). Diagnose the launch error and retain the sandbox unless your environment has a deliberate, supported reason to use another approach.

There is a version- and configuration-sensitive Ubuntu/AppArmor issue to check when the error is No usable sandbox!: Puppeteer’s troubleshooting guide reports that Ubuntu 23.10 and later ship an AppArmor profile applying to stable Chrome binaries at /opt/google/chrome/chrome. That policy can prevent Puppeteer-downloaded Chrome for Testing binaries from using user namespaces. Consult the current Puppeteer troubleshooting page and its linked Chromium security guidance before applying a workaround; the right action depends on the installed Ubuntu and browser configuration.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo provides a screenshot API and MCP server. Its one-call API request can return an image or PDF without configuring Puppeteer and Chrome on your machine. Before capture, it accepts the cookie or consent banner like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing status.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Sign up for free.

Frequently Asked Questions

Can I use Puppeteer with Chromium instead of Google Chrome?

Yes. Pass the verified Chromium executable path with executablePath; check compatibility with your Puppeteer version rather than assuming every browser build is guaranteed.

Why does my screenshot miss content that appears later?

The navigation wait condition may not match when the page’s content is actually ready. Wait for an application-specific selector or readiness condition before calling screenshot().

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.