Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk6 min

How to Launch and Manage a Browser with Puppeteer’s Browsers API

A practical guide to managing browser binaries with @puppeteer/browsers and launching, isolating, connecting to, or closing browsers with Puppeteer.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use @puppeteer/browsers to install and manage browser binaries; use Puppeteer’s puppeteer.launch() and returned Browser object to run automation. They are related but distinct APIs. A common workflow is to install or locate a browser with @puppeteer/browsers, launch it, isolate tasks in browser contexts, then close it—or disconnect and reconnect if another process owns it.

Choose the right Puppeteer browser API

@puppeteer/browsers is a CLI and programmatic package for managing browser builds and drivers. It can install a browser, compute its executable path, list managed installations, uninstall them, and launch supported browser binaries. Puppeteer’s puppeteer.launch(), by contrast, starts an automation session and returns a Browser object that controls pages and contexts.

As an Amazon Associate I earn from qualifying purchases.

  • Use @puppeteer/browsers when you need to manage browser installations or select a specific build or channel.
  • Use puppeteer.launch() when your application needs to start a browser and automate it.
  • Use puppeteer.connect() when a browser process is already running and you have its WebSocket endpoint.

The package’s system-browser launch path is documented for Chrome and Chromium only; do not assume that it launches system installations of every browser family. Consult the @puppeteer/browsers guide for current command syntax and platform prerequisites.

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

Install and locate a managed browser

The package provides CLI commands including install, list, and clear, along with programmatic install, launch, and executable-path helpers. The official guide includes version- and channel-oriented installation examples. Use its current syntax for the browser and platform you need rather than assuming a command or cache location that may differ by package version.

#1 Best Overall
Samsung 14" Galaxy Chromebook Go Laptop PC Computer, Intel Celeron N4500 Processor, 4GB RAM, 64GB Storage, ChromeOS, XE340XDA-KA2US, Student Laptop, Silver
  • SLIM. LIGHTWEIGHT. READY TO GO: The all-new slim design is perfect for busy lives on the go.
  • SKILLFULLY DESIGNED. MILITARY TOUGH: Built with premium craftsmanship to withstand the occasional drop or ding.
  • ALL-DAY, ALL-IN-ONE CHARGING: Power through your school day – and beyond – with a long-lasting 12-hour battery.¹
  • 3X FASTER THAN THE PREVIOUS GENERATION OF WIFI: Crush your schoolwork in record time with Wi-Fi that’s three times faster than the previous generation of Wi-Fi.
  • YOUR PHONE AND CHROMEBOOK WORK BETTER TOGETHER: Easily transfer files between devices, and control your phone right from your Chromebook.

For browser management in code, the package exposes functions such as install, canInstall, and executable-path helpers. Use the managed executable path when you want a downloaded browser build under package management; use a system executable or channel only when that is the intended deployment choice and is supported by the API you are calling.

Launch Puppeteer and automate a page

With Puppeteer, the basic lifecycle is to launch a browser, create a page, navigate or interact, and close the browser when finished. This runnable example uses Puppeteer’s downloaded browser:

import puppeteer from 'puppeteer';

const browser = await puppeteer.launch();
try {
  const page = await browser.newPage();
  await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
  console.log(await page.title());
} finally {
  await browser.close();
}

If your project uses puppeteer-core, provide an executablePath or a channel; the core package does not select its own downloaded browser for you. Puppeteer says it works best with its downloaded Chrome for Testing version and does not guarantee compatibility with other Chrome versions. See the official launch reference and the installation guide matching your installed version.

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

Set launch options deliberately

Puppeteer’s launch options cover the browser or channel, headless mode, executable path, browser arguments, environment, user-data directory, pipe transport, signal handling, and startup timeout. The available fields and defaults depend on the installed package version.

Rank #2
HP Chromebook 14 Laptop, Intel Celeron N4120, 4 GB RAM, 64 GB eMMC, 14" HD Display, Chrome OS, Thin Design, 4K Graphics, Long Battery Life, Ash Gray Keyboard (14a-na0226nr, 2022, Mineral Silver)
  • FOR HOME, WORK, & SCHOOL – With an Intel processor, 14-inch display, custom-tuned stereo speakers, and long battery life, this Chromebook laptop lets you knock out any assignment or binge-watch your favorite shows..Voltage:5.0 volts
  • HD DISPLAY, PORTABLE DESIGN – See every bit of detail on this micro-edge, anti-glare, 14-inch HD (1366 x 768) display (1); easily take this thin and lightweight laptop PC from room to room, on trips, or in a backpack.
  • ALL-DAY PERFORMANCE – Reliably tackle all your assignments at once with the quad-core, Intel Celeron N4120—the perfect processor for performance, power consumption, and value (2).
  • 4K READY – Smoothly stream 4K content and play your favorite next-gen games with Intel UHD Graphics 600 (3) (4).
  • MEMORY AND STORAGE – Enjoy a boost to your system’s performance with 4 GB of RAM while saving more of your favorite memories with 64 GB of reliable flash-based eMMC storage (5).
  • headless controls headless operation; devtools: true forces headful mode.
  • executablePath points at a specific browser binary. For puppeteer-core, supply it or a channel.
  • args adds browser command-line arguments. ignoreDefaultArgs changes Puppeteer’s normal arguments and should be used cautiously.
  • userDataDir selects a browser profile directory; avoid sharing a mutable profile between concurrent processes.
  • pipe selects pipe communication instead of the usual WebSocket connection model where supported.
  • Signal and timeout options affect startup and shutdown behavior; check the versioned reference before relying on their defaults.

The @puppeteer/browsers package has its own launch options, including process-oriented settings such as detached, dumpio, environment, signal handlers, and onExit. Those are not interchangeable with Puppeteer’s LaunchOptions. Check the relevant reference pages rather than copying options between the APIs.

Isolate tasks with browser contexts

A newly launched browser has a default context. Create a separate BrowserContext for an independent task or session: cookies and local storage are not shared across contexts, while pages within the same context share that session.

const context = await browser.createBrowserContext();
try {
  const page = await context.newPage();
  await page.goto('https://example.com');
  // Work within this isolated session.
} finally {
  await context.close(); // Also closes pages in this context.
}

You cannot close the default context. Closing a non-default context closes its pages, so close the context rather than leaving its pages behind when the isolated task is complete. See Puppeteer’s browser management guide.

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

Connect, disconnect, or shut down

These methods express different process ownership choices:

  • browser.close() shuts down the browser and closes its associated pages. Use it when this code owns the browser lifecycle.
  • browser.disconnect() detaches the Puppeteer client but leaves the browser process running. The process owner must arrange its eventual shutdown.
  • puppeteer.connect() attaches Puppeteer to an already-running browser. Retain the endpoint returned by browser.wsEndpoint() if you need to reconnect later.

As Puppeteer’s Browser management guide puts it: “Unlike browser.close(), browser.disconnect() does not shut down the browser or close any pages.” A disconnect is therefore not cleanup of the process; it is only detachment of that client.

const endpoint = browser.wsEndpoint();

// Later, from a client that can reach the running browser:
const connectedBrowser = await puppeteer.connect({ browserWSEndpoint: endpoint });
try {
  const pages = await connectedBrowser.pages();
  console.log(`Connected; open pages: ${pages.length}`);
} finally {
  await connectedBrowser.disconnect(); // Leaves the browser running.
}

Connection requires a reachable browser WebSocket endpoint. If you do not intend to leave a browser running, close it through the process that owns it.

Troubleshoot common launch and management problems

  • puppeteer-core cannot find a browser: supply a valid executablePath or channel, and verify the binary exists and is executable on the target host.
  • A manually selected Chrome version behaves unexpectedly: Puppeteer does not guarantee compatibility with arbitrary Chrome versions. Prefer the Chrome for Testing version downloaded for your Puppeteer release or verify that the selected browser is supported.
  • A system browser will not launch through @puppeteer/browsers: that package’s documented system-browser launch support is limited to Chrome and Chromium. Use a supported managed build or the relevant Puppeteer launch path for your setup.
  • Browser download or extraction fails: platform prerequisites differ. Follow the package guide for operating-system utilities needed to unpack downloads; do not assume every host has the same dependencies.
  • Downloads fail behind a proxy: the package documentation describes proxy environment variables when proxy-agent is installed. Confirm the documented setup for your package version and environment.
  • You need more detail about cache, install, or launcher activity: the package guide documents NODE_DEBUG channels for cache, file utilities, installation, and launcher operations. Enable the relevant channel as described there.
  • A browser remains after your script exits: check whether the code called disconnect() instead of close(), or whether a detached process was launched. Ensure the owning process has an explicit shutdown plan.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If your task is simply to capture a website, ScreenshotNeo provides a screenshot API and MCP server, so you do not need to install and manage a browser process yourself. One GET request returns an image or PDF. The following cURL request saves a WebP screenshot:

Free tools Windows power users keep installed

One-click scans. No signup required.

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://stripe.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie banners, newsletter popups, and chat widgets are removed before the shot; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Rank #4
HP 14" HD Chromebook Laptop for Students, Intel Quad-Core N4120(> N4020), 4GB RAM, 64GB eMMC, WiFi, Webcam, HDMI, USB-A&C, 14 Hours Battery Life, Zoom, Chrome OS, CUE Accessories
  • Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.

Check documentation against your installed version

The cited official Puppeteer reference pages are largely labeled 25.12.0; the individual Browser.disconnect() page is labeled 25.10.0, and the browser-management guide is labeled “Next.” These labels describe the documentation pages, not your local installation. Before copying options or commands, check the official pages for the version installed in your project.

Frequently Asked Questions

Can I close Puppeteer’s default browser context?

No. The default context cannot be closed; create and close a separate context for isolated work.

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

Does browser.disconnect() close browser pages?

No. It detaches Puppeteer while leaving the browser process and its pages running.

Which browsers can @puppeteer/browsers launch as system browsers?

Its documented system-browser launch support is for Chrome and Chromium.

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.

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
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.