October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Headless Chrome

How to Capture Website Screenshots on Shared Hosting

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

Short answer: shared hosting can capture screenshots only if your specific plan permits a Chrome or Chromium process and supplies its runtime libraries, sandbox behavior, writable temporary directories, and enough CPU, memory, and execution time. If those conditions are met, use Puppeteer for scripted captures or Chrome’s headless command line for a simple image. If they are not, run the browser elsewhere—such as ScreenshotNeo—because PHP, cPanel, or Puppeteer by themselves do not render a page.

First determine whether your hosting account can run a browser

“Shared hosting” describes an account model, not a guaranteed software environment. cPanel can manage domains, website files, and databases, but its general interface documentation does not promise that a plan may launch Chromium. The provider and plan decide that.

Questions to send your host

  • May this plan launch Chrome or Chromium from a script, cron job, SSH session, or web request?
  • Is a compatible browser executable already installed, and may I install one in my account?
  • Are the browser’s required system libraries available?
  • Which sandbox mode is supported? Some restricted accounts cannot use Chrome’s normal sandbox.
  • What are the process, memory, CPU, request-time, and cron limits?
  • Which directories are writable for browser profiles, cache data, temporary files, and the final screenshot?
  • May a long-running or concurrent browser process be used, and what happens when it exceeds a limit?

Ask for answers for your exact plan, region, and runtime—not a generic statement that Node.js or cPanel is available. Puppeteer’s troubleshooting guidance specifically calls out system libraries, sandbox conditions, and writable profile and cache locations as common runtime requirements.

A quick account-side check

After the provider confirms support, use SSH (if supplied) to inspect the environment:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
node --version
which chromium
which chromium-browser
which google-chrome
php -v
pwd
printf 'tmp=%sn' "$TMPDIR"

The commands only report what is visible to your account; they do not prove that the browser will launch. Test the actual executable and save output beneath a directory you own.

Option 1: capture with Puppeteer

Puppeteer drives a real browser. Its Page.screenshot() method returns screenshot data and supports a file path, full-page capture, clipping, and output types. Installing the JavaScript package is not the same as having a usable browser: Puppeteer normally installs a compatible Chrome, but its configuration also permits an explicit executable path for another browser. On shared hosting, confirm where that browser is and whether its dependencies are allowed.

Install in an account-owned directory

  1. Open SSH or the host’s Node.js application terminal.
  2. Create an application directory and install the package locally:
mkdir -p ~/site-capture
cd ~/site-capture
npm init -y
npm install puppeteer

Keep the browser cache and profile in writable locations. If the host blocks Puppeteer’s downloaded browser, install only puppeteer-core and set executablePath to the provider-approved Chromium binary.

Complete full-page example

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch({
    // Set this only when your host supplies a known executable.
    // executablePath: '/path/to/chromium',
    headless: true,
    args: [
      // Use the arguments your provider documents. Do not disable
      // security controls casually on a multi-tenant account.
      '--no-sandbox',
      '--disable-setuid-sandbox'
    ]
  });

  try {
    const page = await browser.newPage();
    await page.setViewport({ width: 1440, height: 900, deviceScaleFactor: 1 });
    await page.goto('https://example.com', {
      waitUntil: 'networkidle2',
      timeout: 60000
    });
    await page.screenshot({
      path: './example-full.png',
      fullPage: true,
      type: 'png'
    });
  } finally {
    await browser.close();
  }
})();

Run it from the same directory:

node capture.js

A relative path resolves from the process working directory. Without path, Puppeteer returns image data but does not save a file through that option. Use an absolute, account-writable path when a cron job may start in a different directory.

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

Useful Puppeteer variations

  • Viewport: call page.setViewport() before navigation to reproduce a desktop or mobile layout.
  • Element only: locate an element and pass its bounding box as clip, or use the element’s screenshot helper when available in your installed version.
  • Wait for application UI: await page.waitForSelector('.report', {timeout: 30000}) avoids capturing a loading shell.
  • Delay for late animation: use a bounded page.waitForTimeout() (or an equivalent timer) rather than an unbounded sleep.
  • Output: select PNG, JPEG, or WebP where supported by your installed Puppeteer/Chrome version; JPEG and WebP require attention to quality settings.
  • Clipping: pass {x, y, width, height} to capture a fixed region instead of an entire page.

Full-page mode can create very tall images and consume substantial memory. For long documents, capture sections or produce several files, and remove each browser instance after the job.

Option 2: use Chrome’s headless command line

If the host already provides a working Chrome or Chromium binary, the command line is simpler than maintaining a Node application. Chrome’s documented headless mode accepts --screenshot; --window-size sets the viewport. The example below writes screenshot.png in the current working directory.

mkdir -p ~/site-capture/output
cd ~/site-capture
chromium 
  --headless 
  --disable-gpu 
  --no-sandbox 
  --window-size=1440,900 
  --screenshot=output/home.png 
  https://example.com

Replace chromium with the executable path your host gives you. Use the provider’s documented sandbox approach; --no-sandbox reduces isolation and should not be added blindly. Confirm that the output directory is writable and that the resulting file is served only as intended.

When the command-line method is a better fit

  • One URL, one viewport, and one image are all you need.
  • You cannot justify a Node application but can invoke an approved browser binary.
  • A cron job can run a short command and write to a known directory.

Choose Puppeteer when you need selectors, scripted clicks, custom waits, multiple pages, clipping, or structured error handling.

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

Design the job for shared-hosting limits

Keep processes short and bounded

Set navigation and selector timeouts. Always close the browser in a finally block. Avoid launching one browser per URL when a single controlled instance can process a small batch, but do not create unbounded concurrency that trips account limits.

Separate public output from private state

Store Chrome profiles, cache, logs, and temporary downloads outside the public document root. Copy only the final image into a directory that must be web-accessible, and use unpredictable filenames or access controls if screenshots contain private data.

Plan for lazy loading and dynamic pages

A page may look complete before images, charts, or fonts arrive. Wait for a meaningful selector, network-idle condition, or a short, measured delay. For pages that require authentication, provide credentials through the host’s secret mechanism rather than hard-coding them in a public script.

Make retries safe

Write to a temporary filename, verify that the file exists and has a non-zero size, then rename it to the published name. This prevents a reader from receiving a partially written image when a process is killed.

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

Common failures and fixes

Symptom Likely cause Fix
“Browser executable not found” Puppeteer’s browser download was blocked or no path was configured. Ask the host for an approved executable; set executablePath, or install the permitted browser in an account-owned location.
Missing shared-library error The account lacks system libraries required by Chrome. Send the exact error to the provider. A user-level package cannot always supply system dependencies on shared hosting.
Sandbox or permission error The host restricts namespaces, setuid helpers, or process permissions. Use the provider’s supported sandbox configuration. Do not assume disabling the sandbox is acceptable; move the browser off-host if it is not.
Browser starts, then dies or times out Memory, CPU, process, or request-time limits; oversized pages can trigger them. Reduce viewport or page size, process fewer URLs, increase the allowed job timeout where possible, and inspect provider limits.
Cannot create profile or cache Chrome is trying to write to a read-only home or temporary path. Set writable profile/cache locations approved by the host and keep them outside public files.
Blank or incomplete image Capture occurred before the page rendered, or the URL returned a bot check/error. Wait for a selector or network idle, log the response and page title, and test the URL in the same network environment.
File exists but the web server returns 404 or 403 The script wrote outside the document root or file permissions prevent serving. Use an intentional output directory and verify ownership and permissions without making private directories public.

When shared hosting is the wrong place to render

Move capture to another environment when the plan forbids browser processes, lacks required libraries, imposes a short request limit, or cannot provide a safe writable profile. A separate server, CI runner, desktop worker, or hosted screenshot API can render the page and return the image. Compare choices by browser permission, dependency access, CPU and memory, execution time, writable storage, viewport and interaction controls, privacy, reliability, and current price. Provider limits and third-party terms vary; verify them directly before committing.

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 is a website screenshot API and MCP server. One GET request returns PNG, JPEG, WebP, or a PDF, so your shared account does not need to launch Chrome. Before capture it accepts the cookie or consent banner like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers identify the page verdict and whether it was billed.

Its 63 options include full-page capture with lazy images loaded, CSS-selector element capture, dark mode, 12 device presets or a custom viewport, retina scale, PDF paper size and page ranges, custom CSS and JavaScript, clicks, selector hiding, waits, request/resource blocking, headers, cookies, user agent, Authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTL, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, usage reporting, and an OpenAPI specification. Common parameter names used by other screenshot APIs also work.

One-call cURL example

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 documentation for authentication, output options, and the complete parameter list.

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

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
require('fs').writeFileSync('shot.webp', Buffer.from(await res.arrayBuffer()));

The MCP server adds take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients, allowing an AI agent to request captures without your shared host running a browser.

Plans and billing

Plan Included shots/month Price
Free 1,000 $0; no card
Starter 3,000 $5
Growth 15,000 $15
Pro 60,000 $39
Scale 250,000 $99
Business 1,000,000 $249

Every feature is on every plan, and yearly billing gives two months free. Start with 1,000 free screenshots per month with no card.

Practical decision checklist

  1. Get written confirmation that your exact plan permits Chrome or Chromium.
  2. Verify executable location, libraries, sandbox behavior, writable paths, and limits.
  3. Run a minimal capture and inspect the file, logs, and page completeness.
  4. Add bounded waits, retries, cleanup, and private temporary directories.
  5. Move rendering off-host when any prerequisite is unavailable or unreliable.
  6. Use ScreenshotNeo when you want a single request, cleaned pages, explicit billing verdicts, or MCP access.

Frequently Asked Questions

Can I take a screenshot using only PHP on shared hosting?

PHP can start a browser only when the hosting plan permits the process and provides a usable Chrome or Chromium executable. PHP itself is not a rendering engine.

Does installing Puppeteer guarantee that screenshots will work?

No. Puppeteer controls a browser; the executable, system libraries, sandbox behavior, writable paths, and account limits must also be available.

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

Should screenshots be generated during a web request or by cron?

Use a bounded cron or queue job for full-page or slow pages when possible. Web-request time limits on shared hosting can terminate a capture before the file is written.

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 *

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.

Read next

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.