October 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 ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Run Puppeteer on an Azure Virtual Machine

A practical guide to installing Puppeteer and its Chrome browser on an Azure Linux VM, validating the setup, and fixing common launch failures.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To run Puppeteer on an Azure Linux virtual machine, install a supported Node.js version, install Puppeteer and its compatible Chrome browser, add the browser’s Linux dependencies, then verify that the VM can launch Chrome and reach the page you need. Puppeteer’s current requirements list Node.js 22.12 or newer and Chrome for Testing support on Debian and Ubuntu for x64 and arm64; check those requirements against your VM image and architecture before installing.

Choose a Linux VM and connect

This guide covers Azure Virtual Machines, where you manage the operating system and can install packages directly. Azure App Service is a different hosting environment and does not follow this VM setup path.

As an Amazon Associate I earn from qualifying purchases.

Connect to a Linux VM with SSH when it has a public IP. If it has no public IP, Microsoft documents Azure Bastion as an access option. See Microsoft’s Linux VM connection guidance. Confirm the distribution and CPU architecture first: Chrome’s available builds and required system libraries depend on both.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

Install Node.js and Puppeteer

Install Node.js 22.12 or newer using a method appropriate for your Linux distribution, then create or enter your application directory. Verify the runtime before installing dependencies:

node --version
npm --version

For a project that lets Puppeteer manage its compatible browser, install the puppeteer package:

mkdir puppeteer-vm
cd puppeteer-vm
npm init -y
npm install puppeteer

The puppeteer package normally downloads a compatible Chrome for Testing browser during installation. That means installation needs outbound access to the browser download host as well as the npm registry, and the VM needs sufficient disk space for the browser and its dependencies. Consult the Puppeteer installation guide for current installation behavior.

If install scripts are disabled

Some package-manager policies suppress dependency install scripts. If Puppeteer installs but cannot find Chrome, install the browser explicitly:

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

If you manage the browser separately

Use puppeteer-core when the browser is managed by you or hosted remotely. Unlike puppeteer, it does not download Chrome. Configure the executable path or remote connection details explicitly, and ensure the chosen browser is compatible with the Puppeteer version.

Install Chrome’s Linux dependencies

Installing the npm package does not necessarily install the operating-system libraries Chrome needs. On Debian or Ubuntu, use the current dependency list in Puppeteer’s troubleshooting guide as the authority for the VM image you selected. It covers certificate and font support, GTK/ATK, NSS, GBM, X11, and sound libraries. Package names can change as distributions evolve, so do not assume one dependency command is correct for every image.

If Chrome reports a missing shared library, locate the Chrome executable Puppeteer is using and inspect its dependencies:

ldd /path/to/chrome | grep "not found"

Replace /path/to/chrome with the actual executable path. Install the missing libraries from the VM distribution’s supported repositories, then retry the launch. The Puppeteer troubleshooting guide explains how to identify the browser executable and diagnose missing dependencies.

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

Check outbound networking before debugging code

The VM must be able to reach the endpoints needed for OS package installation, npm packages, and Puppeteer’s browser download. If apt update, npm install, or the browser download fails, first determine which request cannot get out. Azure documents package-manager failures caused by outbound network configuration, blocked ports or URLs, firewalls, and network security groups. Review the VM’s network design, including its NSG, firewall or virtual appliance, NAT gateway, and load-balancer outbound rules where applicable. See Microsoft’s guidance for APT failures on Azure Linux VMs.

Run a launch smoke test

Save this as check.js. It launches the browser, opens a page, navigates to a URL, prints the page title, and closes the browser even if navigation fails:

const puppeteer = require('puppeteer');

(async () => {
  let browser;
  try {
    browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
    console.log(await page.title());
  } catch (error) {
    console.error('Puppeteer launch or navigation failed:', error);
    process.exitCode = 1;
  } finally {
    if (browser) await browser.close();
  }
})();

Run it from the project directory with node check.js. The expected output is the page title. This is a basic validation pattern, not a claim that the script has been run on a particular Azure VM. For the documented launch, page creation, navigation, and close flow, see Puppeteer’s getting-started guide.

Choose headless or headful execution

Headless

Headless mode is appropriate for automation that does not need a visible desktop. It still requires Chrome’s native libraries and a working sandbox configuration; “headless” does not eliminate operating-system requirements.

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

Headful

A visible browser needs a display environment. For headful use in CI-like environments, Puppeteer’s troubleshooting guidance discusses Xvfb as a virtual display option. Account for the additional display setup rather than treating headful and headless launches as interchangeable.

Keep Chrome’s sandbox enabled where possible

Chrome uses Linux sandbox layers to isolate browser processes. Prefer a correctly configured, unprivileged runtime that allows the sandbox to work. If launch reports “No usable sandbox!”, inspect the VM’s sandbox prerequisites and security policy; on some Ubuntu configurations, AppArmor or user-namespace policy can affect Chrome’s launch.

Puppeteer’s troubleshooting guidance says that --no-sandbox is an option only if you absolutely trust the content opened in Chrome, and strongly discourages running without a sandbox. Do not add the flag as a routine fix for an unexplained launch failure. If you consider it at all, understand the security exposure and restrict the browser to content you trust.

Troubleshoot common failures

Symptom Likely cause What to check
“Could not find Chrome” The browser download did not run, often because install scripts were skipped. Run npx puppeteer browsers install and check access to the browser download endpoint.
“error while loading shared libraries” or a missing .so A required Linux shared library is absent. Run ldd on the Chrome executable, identify entries marked “not found,” and install the matching packages for the VM distribution.
“No usable sandbox!” Sandbox prerequisites or distribution security policy prevent launch. Check the Puppeteer troubleshooting guidance and the VM’s security configuration; avoid reflexively disabling the sandbox.
APT, npm, or Chrome download times out Outbound traffic is blocked or not configured for the VM’s network design. Check NSG and firewall rules, outbound routing, NAT or load-balancer configuration, and access to the relevant repository or download host.
Custom executable path fails The path may not exist or may not be readable by the service account, or the browser may be incompatible. Check the path as the actual runtime user, file permissions, and Puppeteer/browser compatibility.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Operational and cost considerations

Browser processes consume VM memory, CPU, and disk, but an appropriate VM size cannot be determined without workload details such as page complexity and concurrent sessions. Measure your own workload under representative conditions. Close pages and browser instances after use, capture launch errors in logs, and distinguish browser startup problems from page navigation failures.

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

There is no single Azure VM cost or performance figure that applies to every Puppeteer workload. Compute size, region, runtime, concurrency, and page behavior affect both resource use and cost; select and monitor the VM based on your actual workload rather than assuming a minimum size.

Or skip the browser setup

If you only need website screenshots or PDFs, ScreenshotNeo provides a screenshot API and MCP server for developers. Its one-request API can return a PNG, JPEG, WebP, or PDF. For example, this cURL request saves a WebP screenshot of https://stripe.com:

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. ScreenshotNeo removes cookie and consent banners, newsletter popups, and chat widgets before the shot; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server lets AI agents use screenshot tools. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots. Learn more at ScreenshotNeo and sign up free.

Frequently Asked Questions

Does this guide apply to Azure App Service?

No. It covers an Azure Linux Virtual Machine, where you manage OS packages directly; App Service has a different deployment environment.

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

Can I use Puppeteer on an ARM64 Azure VM?

Puppeteer lists Chrome for Testing support for Debian and Ubuntu on both x64 and arm64, but confirm the selected VM image and browser build meet current requirements.

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
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.