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
Mountain View desk7 min

How to Run Puppeteer on Google Cloud Platform with Cloud Run

A practical guide to deploying Puppeteer on Google Cloud Run, including Chromium packaging, container deployment, access choices, validation, and troubleshooting.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run Puppeteer on Google Cloud by packaging your Node.js application, Chromium, and the operating-system libraries Chromium needs into a container, then deploying that image as a Cloud Run service. Cloud Run’s browser automation guidance specifically calls for Chromium in the container and identifies Puppeteer as a browser-control library. This gives you explicit control over the browser runtime rather than assuming a source deployment will supply it.

How Puppeteer, Chromium, and Cloud Run fit together

Puppeteer is the Node.js library your application uses to control a browser. Chromium is the browser executable it controls. Cloud Run runs your application in a container, so the container needs to include Chromium and compatible system libraries as well as your application code and dependencies. Google’s browser and OS automation guide describes this model for browser automation on Cloud Run.

As an Amazon Associate I earn from qualifying purchases.

Once deployed, the service can perform browser tasks such as scraping and data extraction, submitting forms, running UI checks, creating PDFs, or taking screenshots. Those tasks all share the same deployment requirement: the running environment must have a usable browser binary.

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

Choose a Cloud Run deployment shape

Path Best fit Browser packaging Build and deployment
Cloud Run service from a container image An application that needs explicit control over Chromium and operating-system packages. You build the image with your app, Puppeteer, Chromium, and compatible libraries. Build and push the image to Artifact Registry, then deploy it to Cloud Run. See Google’s container deployment guide.
Cloud Run function deployed from source A small, single-purpose HTTP or event-triggered handler. Source deployment builds a runtime image; it does not make Chromium unnecessary. Confirm the resulting runtime image includes a compatible browser. Google’s source workflow uses Cloud Build and Artifact Registry; see the function execution environment overview and deployment guide.

For a Puppeteer application where browser packages matter, a containerized Cloud Run service is the more direct choice: you control the browser and OS layer. Choose a function when the workload naturally is one HTTP or event-driven operation and its build/runtime setup can provide the browser dependencies you need.

#1 Best Overall
Spotelo Wallet Tracker Card Certifer by Apple Find My & Google’s Find Hub(Find My Device) Wallet Finder, 5 Years Battery Life Bluetooth Tracker, Smart Card for Passport, Luggage, Android Air Tracker
  • Universal Compatibility with Your Favorite Devices: No more choosing between ecosystems! This tracker works flawlessly with Apple Find My (iOS) and Google's Find Hub (Android), so you can use the native apps you already love and trust. Whether you're an iPhone loyalist or an Android enthusiast, simply pair it in seconds and start tracking—no complicated setup or extra accounts needed
  • Ultra-Slim Credit Card Design: Measuring just 1.7mm thin x 54mm x 85.6mm—exactly the size of a standard credit card—this tracker slips effortlessly into your wallet, passport holder, or even the pocket of your favorite jacket. It’s so slim you’ll forget it’s there until you need it, making it ideal for everyday carry (EDC) without adding bulk
  • 90dB Loud Alert & Find Items in Seconds: Misplaced your wallet under the couch cushions or your bag in a crowded room? The built-in high-performance speaker delivers up to 80dB of clear, loud sound—loud enough to cut through background noise but not overwhelming. Just tap "Play Sound" in your tracking app, and follow the beep to locate your item in no time
  • Never Forget Your Essentials (iOS Exclusive): For iOS users, the Left Behind Alert is a game-changer. If you accidentally leave your tracked item behind, your iPhone will send you a friendly reminder after about 5 minutes—perfect for busy mornings rushing out the door, travel days at the airport, or coffee runs where you might misplace your bag
  • Industry-Leading Battery Life: Years of Hassle-Free Use: Say goodbye to frequent battery changes! With up to 5 years of battery life on Android and up to 3 years on iOS, this tracker keeps working when you need it most. No charging cables, no monthly fees—just set it and forget it for years of reliable tracking

Prepare the application and container

1. Create a Node.js project

This minimal example uses Puppeteer’s browser download as part of the dependency installation. It is an implementation pattern, not a Google-provided Dockerfile; browser binaries and Linux package names can vary with the base image and Puppeteer version. Verify compatibility for the versions you choose.

mkdir puppeteer-cloud-run
cd puppeteer-cloud-run
npm init -y
npm install puppeteer

Create server.js:

const http = require('node:http');
const puppeteer = require('puppeteer');

const port = Number(process.env.PORT || 8080);

const server = http.createServer(async (req, res) => {
  if (req.url !== '/' || req.method !== 'GET') {
    res.writeHead(404, { 'content-type': 'text/plain' });
    res.end('Not found');
    return;
  }

  let browser;
  try {
    browser = await puppeteer.launch({
      headless: true,
      args: ['--no-sandbox', '--disable-setuid-sandbox'],
    });
    const page = await browser.newPage();
    await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
    const title = await page.title();
    res.writeHead(200, { 'content-type': 'application/json' });
    res.end(JSON.stringify({ title }));
  } catch (error) {
    console.error('Browser request failed:', error);
    res.writeHead(500, { 'content-type': 'application/json' });
    res.end(JSON.stringify({ error: 'Browser task failed' }));
  } finally {
    if (browser) await browser.close();
  }
});

server.listen(port, '0.0.0.0', () => {
  console.log(`Listening on ${port}`);
});

Set the package start command in package.json, preserving its other fields:

Rank #2
AIRWEE for Google Pixel 9 Wallet Case, RFID Blocking PU Leather Magnetic Closure Shockproof Case for Google Pixel 9, with Credit Card Slots & Wrist Strap for Women Girls, Dolphin Love Cloud
  • Premium PU Leather Wallet Case for Google Pixel 9: Crafted from top-quality PU leather, our premium Google Pixel 9 wallet case offers unparalleled strength, character, and grain. Specially designed for Google Pixel 9, Attention: This Wallet case is not compatibility with magnetic chargers and wireless charging
  • Convenience Practical Card Holders: Enjoy easy access to all buttons, the camera, speaker, and connector without removing Google Pixel 9 wallet case. With three card slots and a pocket, you can conveniently store your ID card, driver's license, credit cards, and cash. The strong magnet ensures your belongings stay securely in place. without taking purse to outdoor
  • Unique Design: Our slim Google Pixel 9 wallet case minimizes bulk while fully protecting your Google Pixel 9 from scratches. Convenient to Answer the phone without taking off the case,and you can make the conversation with the case closed
  • Stand Feature and Convenient Wrist Strap: Flip wallet Case for Google Pixel 9 opens like a book, fold into a built-in stand lets you make hands-free facetime video calls, read, or watch movies. Attached with a removable wristlet for women, convenient keep hold of you phone while walking you dog
  • 360°Full Protection: wallet case for Google Pixel 9 made of soft PU leather materia, flexible shockproof TPU inner case, strong magnetic closure to keeps your phone secure like a glove, anti-drop and shockproof design keeps safe from scratch accidents and perfect protects screen and camera
{
  "scripts": {
    "start": "node server.js"
  }
}

The example launches and closes a browser for each request to make lifecycle handling clear. For heavier traffic, consider how browser startup, memory use, concurrent requests, and cleanup behave for your workload; do not assume a particular concurrency or performance result without measuring your own service.

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.

2. Add a container image

A minimal starting Dockerfile can use a Node base image and the Chromium binary installed by Puppeteer. The package installation shown here does not establish a universal OS dependency list: confirm that the selected base image and downloaded browser have all required shared libraries, and adjust the image accordingly.

FROM node:22-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY server.js ./
ENV PORT=8080
CMD ["npm", "start"]

With Puppeteer’s default installation, the install step downloads a browser for its supported setup. If you instead install a system Chromium package or configure Puppeteer to use a separately managed executable, ensure the executable path, browser build, and required OS libraries are compatible. A missing library or mismatched browser is a runtime issue even if the Node image builds successfully.

Deploy the container to Cloud Run

  1. Select a Google Cloud project and enable billing. Use the project in which you intend to run the service. The required APIs and permissions depend on the deployment route and your organization’s policies.
  2. Build and push the image. Create an Artifact Registry repository if needed, then build and push your container image using the current Cloud Run deployment instructions. For example, after setting project and region values and creating a Docker repository named apps, a typical flow is:
    gcloud builds submit --tag REGION-docker.pkg.dev/PROJECT_ID/apps/puppeteer:latest
    gcloud run deploy puppeteer 
      --image REGION-docker.pkg.dev/PROJECT_ID/apps/puppeteer:latest 
      --region REGION
  3. Choose invocation access deliberately. Decide whether the service should be publicly invokable or require authentication. A public endpoint that launches a browser can be abused; expose it only if intended and add appropriate application-level safeguards for the operation it performs. Google documents public and authenticated invocation as separate deployment choices in its deployment guide.
  4. Choose a region. Cloud Run services are regional. Pick a region with your users’ latency and proximity to connected Google Cloud resources in mind; cross-location traffic can affect latency and cost. Consult the Cloud Run locations documentation for available regions.
  5. Verify the deployed browser action. Call the service URL and confirm the expected result, then inspect the service logs for browser launch, navigation, or dependency errors.

For a source-deployed function

If you use a function instead, follow the current function deployment guide for its APIs, permissions, and source build process. Google lists Artifact Registry, Cloud Build, Cloud Run Admin API, and Cloud Logging among prerequisites for that workflow, with Eventarc relevant to event-triggered deployments. Because source builds produce a runtime image, verify that the image has Chromium and its OS dependencies before relying on Puppeteer at invocation time.

Rank #4
AIRWEE for Google Pixel 9 Pro Wallet Case, RFID Blocking PU Leather Magnetic Closure Shockproof Case for Google Pixel 9 Pro, with Credit Card Slots & Wrist Strap for Women Girls, Dolphin Love Cloud
  • Premium PU Leather Wallet Case for Google Pixel 9 Pro: Crafted from top-quality PU leather, our premium Google Pixel 9 Pro wallet case offers unparalleled strength, character, and grain. Specially designed for Google Pixel 9 Pro, Attention: This Wallet case is not compatibility with magnetic chargers and wireless charging
  • Convenience Practical Card Holders: Enjoy easy access to all buttons, the camera, speaker, and connector without removing Google Pixel 9 Pro wallet case. With three card slots and a pocket, you can conveniently store your ID card, driver's license, credit cards, and cash. The strong magnet ensures your belongings stay securely in place. without taking purse to outdoor
  • Unique Design: Our slim Google Pixel 9 Pro wallet case minimizes bulk while fully protecting your Google Pixel 9 Pro from scratches. Convenient to Answer the phone without taking off the case,and you can make the conversation with the case closed
  • Stand Feature and Convenient Wrist Strap: Flip wallet Case for Google Pixel 9 Pro opens like a book, fold into a built-in stand lets you make hands-free facetime video calls, read, or watch movies. Attached with a removable wristlet for women, convenient keep hold of you phone while walking you dog
  • 360°Full Protection: wallet case for Google Pixel 9 Pro made of soft PU leather materia, flexible shockproof TPU inner case, strong magnetic closure to keeps your phone secure like a glove, anti-drop and shockproof design keeps safe from scratch accidents and perfect protects screen and camera

Test and troubleshoot the deployed browser

Start with a real browser action, not only an HTTP health response. Confirm that Chromium launches, reaches the target page under the service’s network and access conditions, and returns the output your handler expects. Check Cloud Run logs whenever the request fails; browser errors often occur after the container itself has started.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Symptom Likely cause What to check
Puppeteer reports that it cannot find or launch Chrome/Chromium. The browser was not included in the image, the configured path is wrong, or the browser install did not run. Inspect the image build output and Puppeteer executable configuration; make sure the binary is present in the deployed image.
Launch fails with a missing shared library error. The base image lacks an OS library required by that Chromium build. Identify the missing library in logs and add the appropriate package for the chosen base image; package names differ across distributions.
Browser starts locally but fails after deployment. The deployed image or runtime configuration differs from local development, or a browser flag/runtime constraint differs. Reproduce using the built container image and compare its installed Chromium, dependencies, and launch arguments with the deployed configuration.
Navigation times out or returns unexpected content. The target may be slow, inaccessible from the service, or waiting for a page condition that does not occur. Review the navigation wait condition, target access requirements, network behavior, and logs; set timeouts appropriate to the operation.
Requests fail unexpectedly or resource use rises. Browser/page instances may not be closed reliably, or request volume and parallel browser work exceed what the configured service handles. Ensure cleanup in success and error paths, then measure memory, request behavior, and concurrency with your workload before changing service settings.
Unauthorized callers cannot invoke the service. The service requires authentication. Use the intended authenticated invocation method or deliberately change access policy only after assessing the security impact.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability, and cost considerations

Browser automation is more resource-intensive than a basic HTTP handler because it starts and runs a full browser process. Actual startup time, throughput, concurrency, reliability, and bill depend on the browser build, page behavior, request pattern, service configuration, region, and other workload details; the cited Google documentation does not establish a universal benchmark or fixed cost for Puppeteer.

Best Value
SROJDHFJB Color Cloud Sky Wallet Case for Google Pixel 9/9 Pro, Credit Card Holder ID Slot Hidden Pocket Built-in Stand Kickstand Rugged Full Covered Phone Case for Google Pixel 9/9 Pro
  • ♪ [ Compatible Model ] Slim Case compatible with Google Pixel 9 and Pixel 9 Pro.
  • ♪ [ Foldable Kickstand Design ] There is a hidden bracket on the back of the case(for Google Pixel 9 ), which is very convenient to use when watching movies and video chats.
  • ♪ [ Credit Card Holder Case ] Hidden wallet card holder lets you conveniently store up to 3 ID-size cards like credit cards, driver license, metro cards, etc, plus loose cash.The cards or folded bills are hidden and not easy to be noticed, very safe and convenient
  • ♪ [ Full Body Shockproof ] This Cool Case for Google Pixel 9 Pro is made of soft TPU inside,surrounding the edge of the phone effectively absorbs shock, especially thickened at the four corners. Rugged PC outside for more protection and sleek looking. Raised bezels keep your Phone screen and camera lens free from damaging surfaces.
  • ♪ [ Beautiful Custom Pattern ] Sleek design with multiple color choices to decorate your phone(for Google Pixel 9/9 Pro) and offer protection, turns your Phone into a Brilliant,pretty, new accessory
  • Measure a representative page and task using the deployed image, including browser launch, navigation, and output generation.
  • Set service resource and timeout options based on observed behavior rather than a generic recipe.
  • Close pages and browsers on both success and failure, and record actionable errors without returning sensitive diagnostics to callers.
  • Keep the service’s authentication and target-URL policy in mind: an unrestricted public browser endpoint can become an unintended proxy or be used to access destinations you did not intend.
  • Review current Cloud Run pricing and configuration for your region and resource settings before estimating costs; no workload-independent price is implied here.

Or skip the browser setup

If your task is simply to obtain a website screenshot, ScreenshotNeo offers a screenshot API and MCP server for developers. Its one-request API returns an image or PDF without requiring you to package and operate Chromium in your own Cloud Run service. See the ScreenshotNeo API documentation for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be disabled. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, with response headers indicating the page verdict and billing status. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month with no card.

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

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
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.