Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
To deploy Puppeteer on Google Cloud Compute Engine, create a Linux VM, install a supported Node.js runtime and your locked project dependencies, make sure the Chrome binary and Linux libraries Puppeteer needs are available, then run the app under a service manager. The steps below combine Google Cloud’s general Node.js VM deployment pattern with Puppeteer’s browser-installation and troubleshooting guidance; they are not a tested, one-size-fits-all VM recipe. Your Linux image, workload, and security needs determine the exact machine size, packages, and network configuration.
What you need before creating the VM
Plan for the workload rather than choosing a machine type from a generic Puppeteer recipe. Browser sessions can consume substantial memory, and the right VM depends on concurrency, pages, and scripts in your application. The sources do not establish a universal machine type, disk size, throughput, or monthly cost.
- A Google Cloud project with Compute Engine enabled and permission to create instances and configure networking.
- A currently supported Linux image and Node.js version compatible with your application and Puppeteer version.
- A project with a lockfile, so deployment installs the same dependency versions you developed against.
- A decision about browser ownership: let
puppeteerdownload its compatible Chrome for Testing, or install a browser separately and pointpuppeteer-coreat it. - A deployment plan: a service manager for a persistent worker or application, and only the inbound network access the workload actually needs.
Google Cloud’s Node.js Compute Engine guidance demonstrates a single-instance startup-script and process-supervisor approach. Treat that as a general VM pattern, not a Puppeteer-specific deployment tested for every Linux image or application.
Free tools Windows power users keep installed
One-click scans. No signup required.
Create and prepare a Compute Engine VM
In Google Cloud Console, create a Compute Engine VM using a currently supported Linux image. Select CPU, memory, and disk based on expected browser concurrency and the size of the browser cache and application. The reviewed guidance does not benchmark Puppeteer or recommend a universal configuration.
#1 Best Overall
For an initial setup, connect using SSH from the VM page in the Console, or use the Google Cloud CLI with the instance and zone you created:
gcloud compute ssh INSTANCE_NAME --zone=ZONE
Install a currently supported Node.js runtime using the method recommended for your selected Linux image, then verify the runtime:
node --version
npm --version
Do not copy old OS or runtime versions from illustrative cloud examples as current defaults. Keep your VM updated, and confirm compatibility among the selected Linux image, Node.js, Puppeteer, and Chrome versions.
Install the app and choose how Puppeteer gets Chrome
Puppeteer’s normal puppeteer package downloads a compatible Chrome for Testing browser during installation. Puppeteer’s installation guide displayed version 25.12.0 when consulted; versions and download details can change. The guide gives an approximate Linux browser download size of 282 MB, which is a download figure, not a disk-size recommendation. The default browser cache is under $HOME/.cache/puppeteer, so the user running the app must be able to access the relevant cache and profile paths.
Option A: let puppeteer manage Chrome
Copy the application to the VM using your normal deployment method. From the project directory, install the locked dependencies:
npm ci
If the project does not yet include Puppeteer, add it and commit the resulting manifest and lockfile as part of your normal development workflow:
npm install puppeteer
When installation scripts are allowed, this package normally obtains the compatible browser for you. If package-manager policy blocked install scripts, the package may exist without its browser. Install the managed browser explicitly:
npx puppeteer browsers install
Minimal example, saved as app.js:
const puppeteer = require('puppeteer');
async function main() {
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
console.log(await page.title());
} finally {
await browser.close();
}
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Option B: manage the browser separately
Use puppeteer-core when Chrome or another compatible browser is installed and versioned separately. This avoids Puppeteer’s automatic browser download, but you own browser installation, updates, compatibility, and the executable path. Configure the actual path for your image; do not assume a universal Chrome location.
npm install puppeteer-core
Example application code:
const puppeteer = require('puppeteer-core');
async function main() {
const browser = await puppeteer.launch({
executablePath: process.env.CHROME_EXECUTABLE_PATH,
headless: true
});
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
console.log(await page.title());
} finally {
await browser.close();
}
}
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Fix the driver behind crashes, sound loss and screen glitches3Repair Windows errors before they cause bigger problemsmain().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Set CHROME_EXECUTABLE_PATH in the service environment to the browser executable you installed. Puppeteer’s configuration also supports a channel when Chrome is installed in a standard location; consult the current Puppeteer documentation for the supported configuration.
| Choice | Who installs and manages the browser | Executable configuration |
|---|---|---|
puppeteer |
Puppeteer normally downloads its compatible Chrome during package installation; if scripts were blocked, run its browser-install command. | Usually no explicit path is needed for the managed browser. |
puppeteer-core |
You install and maintain a compatible browser separately. | Set executablePath to the real path, or configure a supported channel for a standard installation. |
Check Linux libraries and runtime paths
A Chrome download alone does not guarantee that Chrome can launch. A minimal Linux image may not have all required shared libraries. Puppeteer’s troubleshooting guidance includes Linux and container examples, but package names and requirements vary across distributions and can age. Start with the actual launch error and validate package names against your selected image; do not paste an old distribution-specific install recipe without checking it.
Also verify permissions for the identity that starts the process. Puppeteer’s default browser cache lives under the user’s home directory, which means an app launched as a service may use a different cache from the one populated during an SSH session.
Recommended Free Tools
Run the process persistently and collect logs
A foreground process in an SSH session stops being a reliable deployment when that session closes or the VM reboots. Run the Node.js app with a service unit or process supervisor configured to start at boot, restart on failure, and record logs. Google’s general Node.js Compute Engine guide demonstrates a startup script and Supervisor, and describes checking startup output and logs through Google Cloud Logs Explorer. Adapt the pattern to your current image and runtime rather than copying its older sample versions.
Before enabling automatic restarts, run the app manually under the same Linux user and environment the service will use. This catches missing browser paths, inaccessible cache directories, and configuration that exists only in an interactive shell. Ensure logs include startup errors, but avoid logging credentials, cookies, or page contents that should remain private.
Configure identity and network access
Use least-privilege Google Cloud credentials
If the application only visits public websites, it may not need Google Cloud API permissions. If it accesses Google Cloud services, attach an appropriate service account to the VM and grant only the IAM roles the workload requires. Google recommends using the cloud-platform access scope with IAM roles as the permission control; applications can obtain attached credentials through Google Cloud libraries instead of embedding service-account keys in code or on the VM. Confirm that the relevant API is enabled and that the VM’s access scopes do not restrict the intended request.
Expose only necessary ports
A screenshot or queue worker may need no public inbound port at all. If the app serves HTTP, configure its listen address and firewall rule for the actual use case, limiting source ranges where practical. Google’s sample opens TCP 8080 to all IPv4 sources for its example application; that is an example, not a safe default for every service. Use an intentional application front end and transport-security setup when exposing an endpoint.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Troubleshoot common deployment failures
“Could not find Chrome”
- Check whether npm installation scripts were blocked by package-manager policy.
- For the managed-browser path, run
npx puppeteer browsers installand verify the cache belongs to the service user. - For a separately managed browser, verify the executable exists and that
executablePathpoints to it.
Chrome exits immediately or fails to launch
- Read the complete Chrome/Puppeteer error output and identify missing shared libraries for the chosen Linux image.
- Check permissions on the executable, browser cache, temporary profile paths, and service user’s home directory.
- Compare the working SSH environment with the service environment, including
HOME, working directory, and environment variables. - Do not change sandbox settings as a first response to a missing-library or path error. Diagnose the reported failure and use security settings appropriate to the VM and workload.
It works over SSH but fails as a service
The service may run as another user, with a different HOME, cache, working directory, or environment. Set these deliberately in the service configuration, make sure the runtime account can access the browser cache and app files, then inspect the service logs after a restart.
Best Value
Google Cloud API requests are denied
- Confirm the VM has the intended attached service account.
- Check that the required API is enabled and IAM grants the role needed for the operation.
- Check VM access scopes as well as IAM; a restrictive scope can still block a request.
- Use attached credentials rather than placing long-lived service-account keys in the application.
The application is unreachable
- Check that the process is running and listening on the expected address and port.
- Check the VM’s network tags and firewall rules, including allowed source ranges and protocol.
- Inspect application and service logs for startup errors before changing firewall rules.
Performance, reliability, and cost considerations
Browser workloads are sensitive to concurrent sessions, page complexity, and memory demand. Start with a measured workload in your own environment, monitor memory, CPU, disk use, and failure rates, and scale based on observed behavior. The cited guidance does not establish expected throughput, a recommended VM size, or a Compute Engine price; region, machine type, storage, network use, and runtime duration affect cost.
Include browser installation and cache behavior in deployment planning. Puppeteer’s stated approximate 282 MB Linux download can affect initial provisioning and disk use, but it does not tell you how much disk your application requires. A locked dependency tree and a deliberate browser-version strategy make deployments more reproducible. A service manager improves recovery from process exit, but it does not make the VM or a remote website infallible; log failures and handle page timeouts and retries in application logic.
Or skip the browser setup
If your goal is to capture website screenshots rather than run a custom browser workload, ScreenshotNeo offers a screenshot API and MCP server. One GET request returns an image or PDF; its clean-shot flow accepts cookie and consent banners and removes supported consent platforms, newsletter popups, and chat widgets before capture. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers indicating the page verdict and billing status. Its MCP server gives AI agents tools to take screenshots, get page information, and capture PDFs.
Example cURL request (see the ScreenshotNeo API documentation for setup and parameters):
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo includes 1,000 screenshots a month on its free plan with no card; paid plans start at $5 for 3,000. Sign up for the free plan.
Frequently Asked Questions
Can I run Puppeteer on a Compute Engine VM without opening a firewall port?
Yes. A worker that makes outbound browser requests and does not serve inbound traffic does not need a public application port.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Should I use Puppeteer or puppeteer-core on Compute Engine?
Use puppeteer when you want its normal managed Chrome download; use puppeteer-core when you will install and maintain a compatible browser separately.
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.

