Headless Chrome in Docker: Images, Sandbox, /dev/shm, Fonts and Memory
A practical, tested guide to running headless Chrome or Chromium in a container for PDFs and screenshots: which base image to start from, how to keep the sandbox instead of reaching for --no-sandbox, shared memory, emoji and CJK fonts, memory limits, zombie processes, concurrency, the new headless mode, and Python. Every command was run on Docker 29.8 with Chrome 158.
Last updated
Short answer
Start from an image that already has Chrome and its libraries, such as ghcr.io/puppeteer/puppeteer or mcr.microsoft.com/playwright. Run as a non-root user with --init, and give Chrome its sandbox with a seccomp profile that allows user namespaces (or --cap-add=SYS_ADMIN) instead of --no-sandbox. Then add emoji and CJK fonts, enlarge /dev/shm, and cap memory and concurrency.
Headless Chrome is easy to start on a laptop and surprisingly fiddly in a container: it refuses to run as root, crashes without a usable sandbox, renders emoji as boxes, leaves zombie processes behind, and gets killed when a long screenshot meets a memory limit. We hit every one of those on purpose while writing this guide. Each section shows the failure, the error text you'll search for, and the fix that worked, tested on Docker Desktop 29.8.2 with Puppeteer 25.19.0 and Chrome 158 in November 2026.
Quick start: a working headless Chrome Dockerfile
The shortest path is the Puppeteer team's own image, pinned to the Puppeteer version in your package.json. It already contains Chrome for Testing, chrome-headless-shell, Chrome's system libraries and fonts for Chinese, Japanese, Korean, Thai, Khmer and Arabic, and it runs as a non-root user:
FROM ghcr.io/puppeteer/puppeteer:25.19.0
# Base image: Debian bookworm, Node 24, Chrome for Testing + chrome-headless-shell,
# working directory /home/pptruser, non-root user pptruser (UID 10042)
COPY --chown=pptruser:pptruser package.json package-lock.json ./
RUN npm ci --omit=dev
COPY --chown=pptruser:pptruser . .
CMD ["node", "capture.mjs"]// capture.mjs: a smoke test that also shows whether emoji and CJK fonts are installed
import puppeteer from "puppeteer";
import { writeFile } from "node:fs/promises";
const browser = await puppeteer.launch();
try {
const page = await browser.newPage();
await page.setViewport({ width: 600, height: 200 });
await page.setContent(`<!doctype html><meta charset="utf-8">
<body style="font: 28px sans-serif; padding: 16px">
<div>Emoji: π β
π«π· π</div>
<div>CJK: δ½ ε₯½ γγγ«γ‘γ― μλ
νμΈμ</div>
</body>`);
await writeFile("/out/fonts.png", await page.screenshot());
console.log("saved /out/fonts.png");
} finally {
await browser.close();
}docker build -t renderer .
# --init: a real PID 1 that reaps Chrome's orphaned processes
# --cap-add=SYS_ADMIN: lets Chrome create its sandbox (safer alternative below)
docker run --rm --init --cap-add=SYS_ADMIN -v "$PWD/out:/out" rendererThat works, but two things in the output are worth noticing. The emoji line comes out as empty boxes, because the image has no emoji font. And --cap-add=SYS_ADMIN is a bigger grant than Chrome needs. Both are fixed below.
Choosing a base image for headless Chrome
| Base image | What's inside | Runs as | Best for | Watch out for |
|---|---|---|---|---|
ghcr.io/puppeteer/puppeteer:<version> | Debian 12, Node 24, Chrome for Testing, chrome-headless-shell, CJK/Thai/Arabic fonts | pptruser (non-root) | Puppeteer apps that want a known-good setup | No emoji font, no init process, amd64 only as of 25.19.0 |
mcr.microsoft.com/playwright:v1.65.1-noble | Ubuntu 24.04, Playwright's Chromium, Firefox and WebKit plus their libraries | root (a pwuser account exists) | Playwright tests and scripts; also amd64 and arm64 tags | The Playwright package isn't included; root disables the sandbox; its docs advise against untrusted websites with that setup |
mcr.microsoft.com/playwright/python:v1.65.2-noble | The same, with Python | root | Python rendering jobs | Same as above |
node:22-bookworm-slim + your own layers | Only what you add | Whatever you choose | Smallest image you fully control | You own fonts, libraries, unzip and the init process |
Alpine + the chromium package | musl-based Chromium from Alpine's repositories | Your choice | Very small images | Chrome doesn't officially support Alpine; Puppeteer's version must match Alpine's Chromium |
AWS Lambda + @sparticuz/chromium | A compressed Chromium built for serverless | Lambda runtime | Bursty, low-volume rendering | Ships only the Open Sans font; 512 MB minimum, 1,600 MB recommended |
Pin exact tags. latest moves with every release, and a Chrome version change can alter rendering, so upgrade on purpose and compare a few outputs when you do. Chrome for Testing has published Linux ARM64 builds since version 153, so Puppeteer can download a native ARM64 Chrome on Graviton or Apple Silicon even though the official Puppeteer image itself is amd64 only.
Build your own image on Debian slim
When you want a smaller image, color emoji, or one base image for several services, build from node:22-bookworm-slim. This is the exact Dockerfile we built and ran; the comments explain every line that isn't obvious:
FROM node:22-bookworm-slim
# tini reaps zombie processes; unzip lets Puppeteer 25 unpack Chrome; fonts cover emoji, CJK and Latin
RUN apt-get update \
&& apt-get install -y --no-install-recommends tini unzip fonts-noto-color-emoji fonts-noto-cjk fonts-liberation \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
ENV PUPPETEER_CACHE_DIR=/app/.cache/puppeteer
COPY package.json package-lock.json ./
# npm ci downloads Chrome for Testing; --install-deps apt-installs the libraries it needs (root + apt lists)
RUN npm ci --omit=dev \
&& apt-get update \
&& npx puppeteer browsers install chrome --install-deps \
&& rm -rf /var/lib/apt/lists/*
COPY . .
# A non-root user, so Chrome keeps its sandbox
RUN groupadd -r app && useradd -r -g app -G audio,video -m app \
&& chown -R app:app /app
USER app
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["node", "capture.mjs"]- `unzip` is now required. Since Puppeteer 25, the browser download unpacks Chrome with the system's
unzip(or the optionalyauzlnpm package). Slim images have neither, and the failure is sneaky:npm ciprintsExtraction failed: no zip archiver is availablebut exits 0, and the build fails later with a half-installed browser folder. - `--install-deps` needs root and apt lists. It runs
apt-get satisfywith the library list that ships with Chrome for Testing, so run it before switching users, afterapt-get update, and clean the lists in the same layer. - `PUPPETEER_CACHE_DIR` inside the app. By default the browser lands in the build user's home directory; keeping it under
/appmeans the runtime user finds it. - tini as the entrypoint gives you a proper PID 1 even on platforms with no
--initswitch, such as Kubernetes.
Chrome headless no sandbox: what --no-sandbox really trades away
Chrome's Linux sandbox isolates each renderer process, the part that parses HTML and runs page JavaScript, so a compromised page can't reach the rest of the system. It builds that sandbox from user namespaces and seccomp filters. Docker's default seccomp profile blocks creating new namespaces, so a non-root Chrome in a stock container fails like this:
# Non-root user, no extra flags
FATAL:content/browser/zygote_host/zygote_host_impl_linux.cc:144] No usable sandbox!
# Running as root
ERROR:content/browser/zygote_host/zygote_host_impl_linux.cc:117] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.The common fix is --no-sandbox, and it works because it switches the protection off. If you only render your own HTML, such as invoices from your own templates, that's a defensible choice. If you render arbitrary URLs or user-supplied HTML, the sandbox is your main line of defense against a malicious page exploiting a renderer bug. These three options all launched Chrome in our tests, in order of preference:
# A. Recommended: non-root user + a seccomp profile that allows user namespaces.
# Playwright publishes one: Docker's default profile plus clone, setns and unshare.
curl -fsSLO https://raw.githubusercontent.com/microsoft/playwright/main/utils/docker/seccomp_profile.json
docker run --rm --security-opt seccomp=seccomp_profile.json renderer
# B. What Puppeteer's docs show: grant CAP_SYS_ADMIN (works, but a much broader grant)
docker run --rm --init --cap-add=SYS_ADMIN renderer
# C. No sandbox at all: only for content you fully trust
docker run --rm -e PUPPETEER_DANGEROUS_NO_SANDBOX=true renderer # Puppeteer adds --no-sandbox| Option | Chrome sandbox | What the container gains | Use when |
|---|---|---|---|
| Non-root + Playwright's seccomp profile | On | Only the clone, setns and unshare syscalls | Default choice, especially for untrusted pages |
Non-root + --cap-add=SYS_ADMIN | On | A broad Linux capability (mount and many admin operations) | Local development, or when you can't ship a profile |
--no-sandbox / PUPPETEER_DANGEROUS_NO_SANDBOX=true | Off | Nothing | Only your own trusted HTML |
| Running as root | Off (required) | Nothing; Chrome demands --no-sandbox | Avoid |
Two Playwright specifics. Playwright passes --no-sandbox unless you launch with chromiumSandbox: true (chromium_sandbox=True in Python), so Playwright users are usually running unsandboxed without knowing it. And Playwright's image runs as root by default; its docs recommend --user pwuser plus the seccomp profile for crawling and scraping. Other flags from older tutorials: --disable-setuid-sandbox only matters for the legacy setuid sandbox, and --no-zygote must be combined with --no-sandbox per Chromium's own source, so neither is a safe shortcut.
/dev/shm and --disable-dev-shm-usage
Chrome's processes pass data to each other through shared memory, which on Linux lives in /dev/shm. Docker gives every container a 64 MB /dev/shm unless told otherwise; we confirmed it with df -h /dev/shm in the official image. Large pages can exhaust it, and the symptom is crashed tabs or a browser that disconnects mid-render.
--disable-dev-shm-usage tells Chrome to create those shared-memory files in the temp directory instead. You rarely need to add it: both Puppeteer and Playwright already include it in their default launch arguments. It moves the pressure rather than removing it, because if /tmp is a RAM-backed tmpfs those files still use memory. The alternative is to make /dev/shm bigger:
# A bigger /dev/shm (Docker's default is 64 MB)
docker run --rm --shm-size=1g --security-opt seccomp=seccomp_profile.json renderer
# Or share the host's IPC namespace, which Playwright's Docker docs recommend for Chromium
docker run --rm --ipc=host --security-opt seccomp=seccomp_profile.json renderer--ipc=host shares the host's IPC namespace and its /dev/shm, which weakens isolation between the container and the host, so prefer --shm-size when you can. In Kubernetes there's no shm-size field; mount a memory-backed emptyDir at /dev/shm, as shown in the Compose and Kubernetes examples below.
Fonts: emoji, CJK and missing glyphs
Headless Chrome can only draw glyphs from fonts installed in the image. A bare Debian or Ubuntu image has almost none, so text falls back to whatever is there and unsupported characters become empty boxes ("tofu"). The official Puppeteer image covers CJK, Thai, Khmer and Arabic, but in our smoke test the emoji came out as boxes. In the slim image above, fonts-noto-color-emoji and fonts-noto-cjk fixed both lines.
- Debian/Ubuntu packages:
fonts-noto-color-emoji(emoji),fonts-noto-cjk(Chinese, Japanese, Korean),fonts-liberation(metric-compatible with Arial, Times New Roman and Courier New, so layouts designed with those fonts don't reflow). - Your brand fonts: load them with
@font-facefrom your own server, or copy the files into/usr/local/share/fontsand runfc-cache -f. Web fonts are the more portable choice because the same CSS works in every environment. - Check what's installed with
fc-list : family, and render the smoke test above after every base-image change. - Lambda:
@sparticuz/chromiumincludes only Open Sans (Latin, Greek, Cyrillic). Add fonts in afontsdirectory in a layer; its README lists the folders it searches.
Memory limits and per-page memory
Chrome is a multi-process browser: one browser process plus renderer, GPU and utility processes, and pages on different sites generally get separate renderers. Memory therefore grows with pages in flight, with page complexity, and sharply with capture size. A 1,440Γ20,000 full-page screenshot is about 115 MB of raw pixels before encoding; at deviceScaleFactor: 2 it's about 461 MB.
We gave a container a 512 MB limit and asked for a 1,440Γ30,000 screenshot at 3x. The kernel's out-of-memory killer killed a Chrome process; docker inspect showed OOMKilled=true, but the Node process survived and the screenshot call simply hung for three minutes until Puppeteer's protocolTimeout fired with Page.captureScreenshot timed out. That's the typical shape of an OOM in a rendering service: no crash, just a stuck job. Lower the timeouts so stuck work fails fast:
const browser = await puppeteer.launch({
protocolTimeout: 60_000, // default 180 s: how long one DevTools call may hang
});
const page = await browser.newPage();
page.setDefaultTimeout(20_000); // waits and selectors
page.setDefaultNavigationTimeout(30_000); // goto and setContent- Set a container memory limit (
--memory,mem_limit, orresources.limits.memory) so one runaway page can't take down the host, and alert on OOM kills. - Measure, don't guess. Run a batch of your real URLs at concurrency 1, 2, 4 and 8 and watch
docker stats. Container metrics cover Node plus every Chrome child;process.memoryUsage()only sees Node. - Cap capture size. Limit full-page height with a
clip, and usedeviceScaleFactor: 2only where it's needed. - Recycle browsers after a few hundred jobs, and close pages and contexts in
finallyblocks. Our Puppeteer PDF guide has a server that does both, and why Puppeteer eats your RAM covers where the memory goes.
Zombie processes: give the container an init (tini)
When a Chrome process dies, its children are re-parented to PID 1 in the container. If PID 1 is Node, nobody calls wait() on them and they stay in the process table as zombies. We measured it: three simulated Chrome crashes with Node as PID 1 left 18 zombie processes; with docker run --init, there were none. In a long-running service they keep piling up, and with a PID limit on the container (--pids-limit, or a Kubernetes PID limit) new browser launches eventually fail.
- `docker run --init` runs
docker-init, which is tini, as PID 1. Puppeteer's and Playwright's Docker docs both recommend it. - Compose:
init: trueon the service. - Kubernetes and other orchestrators don't have an equivalent switch, so bake tini into the image with
ENTRYPOINT ["/usr/bin/tini", "--"], as in the slim Dockerfile. - Don't double up. If the image already runs tini as its entrypoint, skip
--init.
# compose.yaml (for the official-image Dockerfile above)
services:
renderer:
build: .
init: true # tini as PID 1: reaps Chrome's orphaned processes
shm_size: "1gb" # Docker's default /dev/shm is 64 MB
mem_limit: 2g # hard cap; size it from measurements
security_opt:
- seccomp=./seccomp_profile.json # lets Chrome create its sandbox
volumes:
- ./out:/out# Kubernetes: a memory-backed /dev/shm. tmpfs pages count against the memory limit.
spec:
containers:
- name: renderer
image: registry.example.com/renderer:1.0
resources:
limits:
memory: 2Gi
volumeMounts:
- name: dshm
mountPath: /dev/shm
volumes:
- name: dshm
emptyDir:
medium: Memory
sizeLimit: 1GiConcurrency: pages, contexts or browsers?
| Strategy | Isolation | Overhead | Use it for |
|---|---|---|---|
| One browser, many pages | Shared cookies, cache and storage | Lowest | Rendering your own HTML |
| One browser, a context per job | Separate cookies and storage per job | Low | Arbitrary URLs and multi-tenant work; the usual choice |
| Several browsers per container | Separate processes | A browser start-up per instance | Spreading crash impact; recycling one browser while another serves |
| Several containers | Full | Highest | Horizontal scaling and hard memory limits per worker |
In every case put a queue in front with a fixed number of slots. Unbounded Promise.all over a list of URLs is the most common way to OOM a rendering container. Size the slot count per container from the measurements above, then scale by adding containers.
Chrome headless new vs old (chrome-headless-shell)
Chrome has had two headless implementations, and "new vs old" decides which binary you install and how it behaves:
- Chrome 112 (2023) introduced the new headless mode (
--headless=new): the real Chrome browser, running without showing windows. - Chrome 120 started shipping the old implementation as a separate binary,
chrome-headless-shell, through Chrome for Testing. - Chrome 132 removed old headless from the Chrome binary.
--headlessand--headless=newnow both mean new headless, and--headless=oldprints an error. The old mode lives on only as chrome-headless-shell.
// Puppeteer
await puppeteer.launch(); // new headless (the full Chrome binary), default since v22
await puppeteer.launch({ headless: "shell" }); // chrome-headless-shell, the old headless
// Playwright
await chromium.launch(); // chromium headless shell by default
await chromium.launch({ channel: "chromium" }); // opt in to the new headless modeChrome's team describes the trade-off as performance versus authenticity. chrome-headless-shell is a lighter wrapper that doesn't need X11, Wayland or D-Bus and is "in some ways more performant", which suits screenshots and scraping. New headless is the full browser, so it behaves exactly like desktop Chrome, which suits high-fidelity testing. Note the defaults differ: Puppeteer has used new headless since v22, while Playwright uses the headless shell unless you set channel: "chromium". For PDFs and screenshots either works; if output must match what users see in Chrome, use new headless and compare before switching.
Flags you can drop from old tutorials: --headless=new (plain --headless is new headless since Chrome 132) and --disable-gpu (Chrome's launcher documentation notes it hasn't been needed since 2021).
Headless Chrome for PDF generation and screenshots
For one-off captures you don't need a library at all. Chrome's command line can screenshot, print and dump the rendered DOM; we ran all three inside the official image:
# Chrome's own command line, no library needed (paths from: npx puppeteer browsers install chrome)
chrome --headless --screenshot=/out/page.png --window-size=1440,900 https://example.com
chrome --headless --print-to-pdf=/out/page.pdf --no-pdf-header-footer https://example.com
chrome --headless --dump-dom https://example.com > page.html
# Give slow pages a deadline (ms) after which the capture happens anyway
chrome --headless --print-to-pdf=/out/page.pdf --timeout=10000 https://example.comThe CLI is fine for a cron job, but it can't wait for a selector, set print margins precisely, add page-number footers or reuse a browser between captures. For anything beyond that, drive Chrome from code: see Puppeteer PDF and Puppeteer screenshots for Node.js, or Playwright PDF and Playwright screenshots.
Headless Chrome with Python in Docker
For Python, Playwright's image is the easiest base. Install the same Playwright version as the image tag, run as pwuser, and turn the sandbox on explicitly:
FROM mcr.microsoft.com/playwright/python:v1.65.2-noble
# The image has the browsers and their system libraries, but not the playwright package
WORKDIR /app
RUN pip install --no-cache-dir playwright==1.65.2
COPY capture.py .
USER pwuser
CMD ["python", "capture.py"]# capture.py
from playwright.sync_api import sync_playwright
with sync_playwright() as p:
# Playwright disables Chrome's sandbox unless you ask for it
browser = p.chromium.launch(chromium_sandbox=True)
page = browser.new_page(viewport={"width": 1440, "height": 900})
page.goto("https://example.com", wait_until="networkidle")
page.screenshot(path="/out/example.png", full_page=True)
page.pdf(path="/out/example.pdf", format="A4", print_background=True)
browser.close()docker build -t py-renderer .
docker run --rm --init --ipc=host --security-opt seccomp=seccomp_profile.json \
-v "$PWD/out:/out" py-rendererSelenium also drives headless Chrome from Python. Since Selenium 4.11, Selenium Manager downloads a matching Chrome for Testing and chromedriver when none is installed, but in a container you still need Chrome's system libraries and fonts, so start from an image that has them. More in our Selenium screenshot guide.
# Selenium (outside Docker, or in an image that already has Chrome's libraries)
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument("--headless") # the new headless mode on Chrome 132+
options.add_argument("--window-size=1440,900")
driver = webdriver.Chrome(options=options) # Selenium Manager fetches the driver
driver.get("https://example.com")
driver.save_screenshot("example.png")
driver.quit()Debugging headless Chrome in a container
# Which shared libraries are missing? (v25: executablePath() returns a Promise)
CHROME=$(node --input-type=module -e "import p from 'puppeteer'; console.log(await p.executablePath())")
ldd "$CHROME" | grep "not found"
# Which fonts can Chrome use?
fc-list : family | sort -u
# How much shared memory, and how many processes (zombies show state Z)?
df -h /dev/shm
ps -eo pid,stat,comm- `Failed to launch the browser process` is a wrapper; the useful line is in the
stderrsection below it. Passdumpio: truetopuppeteer.launch()to stream Chrome's output into your logs. - `Could not find Chrome` in a container usually means the browser was downloaded for a different user or cache path at build time. Set
PUPPETEER_CACHE_DIRthe same at build and run time. - `chrome_crashpad_handler: --database is required` in a read-only container: point
XDG_CONFIG_HOMEandXDG_CACHE_HOMEat a writable directory such as/tmp, per Puppeteer's troubleshooting guide. - Random crashes on large pages: check
/dev/shmsize andOOMKilledindocker inspectbefore suspecting your code.
Production checklist
- Base image pinned to an exact Puppeteer or Playwright version.
- Non-root user; sandbox on via a seccomp profile (or
SYS_ADMIN);--no-sandboxonly for trusted content. - An init process:
--init,init: true, or tini as the entrypoint. - Fonts for emoji, CJK and your brand, verified with a smoke-test render.
/dev/shmenlarged, or the default--disable-dev-shm-usageleft in place.- Container memory limit plus a fixed number of render slots, sized from measurements.
- Timeouts on navigation, waits and DevTools calls; pages and contexts closed in
finally. - Browser recycling and relaunch on disconnect.
- Untrusted input treated as hostile: block requests to internal addresses, and keep the sandbox on.
When a hosted API is the better trade
Every item on that checklist is reasonable on its own, but together they're a small infrastructure project that needs upkeep with each Chrome release. A hosted rendering API is a better trade when rendering is a feature rather than your product, volume is spiky, or nobody on the team wants to own a browser fleet. Self-hosting stays the better trade when documents can't leave your network, volume is high and steady enough that compute is cheaper than per-render pricing, or you need full scripted control of the browser.
RenderKit is our API, so weigh this accordingly. It runs the Chromium fleet (fonts, sandboxing, memory limits, banner blocking, retries) and exposes screenshots, PDFs and page-to-markdown extraction as one HTTPS call each:
curl https://api.renderkit.tech/v1/screenshot \
-H "x-api-key: $RENDERKIT_API_KEY" \
-H "content-type: application/json" \
-d '{ "url": "https://example.com", "full_page": true, "block_cookie_banners": true }'
curl https://api.renderkit.tech/v1/pdf \
-H "x-api-key: $RENDERKIT_API_KEY" \
-H "content-type: application/json" \
-d '{ "url": "https://example.com/report", "page_format": "A4", "margin": "16mm" }'- Costs: a screenshot is 1 credit and a PDF 2; cache hits are free and failed renders are refunded. The free trial gives 500 credits for 14 days (10 requests a minute, 1 concurrent render, 15-second timeout); Hobby is $9/month for 5,000 credits, Growth $29 for 25,000. See pricing.
- Limits to know: renders run from France (EU), results are public, unguessable URLs on cdn.renderkit.tech, there's no SLA, and it doesn't bypass bot protection.
- SDKs: Node and Python (
renderkit-sdk), plus an MCP server (npx -y renderkit-mcp) for AI agents.
Related
Code for what runs inside the container: Puppeteer PDF, Puppeteer screenshots, Playwright PDF, Playwright screenshots. Background: why Puppeteer eats your RAM. Hosted options: Screenshot API, HTML to PDF API, and RenderKit vs Browserless.
Common questions
Use an image that includes Chrome and its libraries (ghcr.io/puppeteer/puppeteer or mcr.microsoft.com/playwright), or install them on Debian slim with npx puppeteer browsers install chrome --install-deps. Run as a non-root user and start the container with --init plus a seccomp profile that allows user namespaces, or --cap-add=SYS_ADMIN, so Chrome can sandbox itself.
It doesn't have to. Chrome fails in a stock container because Docker's default seccomp profile blocks the namespaces its sandbox uses, and it refuses to sandbox as root. --no-sandbox switches the protection off, which is acceptable for your own trusted HTML but risky for arbitrary URLs. A non-root user plus Playwright's seccomp profile keeps the sandbox on.
It makes Chrome write its shared-memory files to the temp directory instead of /dev/shm, which Docker limits to 64 MB by default. Puppeteer and Playwright already pass it by default. If /tmp is RAM-backed the memory is still used, so for heavy pages also raise --shm-size (for example 1g) or use --ipc=host.
New headless (Chrome 112+) is the full Chrome browser without visible windows. Old headless was a separate, lighter implementation; since Chrome 132 it's only available as the chrome-headless-shell binary, and --headless now always means new. Puppeteer uses new headless by default (headless: 'shell' selects the old one); Playwright defaults to the headless shell.
For Puppeteer, ghcr.io/puppeteer/puppeteer pinned to your Puppeteer version; for Playwright, mcr.microsoft.com/playwright (or /python) pinned to your Playwright version, run as pwuser. Build from node:22-bookworm-slim if you want a smaller image or extra fonts, and remember to install unzip for Puppeteer 25.
The container has no font with those glyphs. On Debian or Ubuntu, install fonts-noto-color-emoji for emoji and fonts-noto-cjk for Chinese, Japanese and Korean, then verify with fc-list and a test render. The official Puppeteer image covers CJK but not color emoji.
It depends on the pages, concurrency and capture size, so measure with your real URLs at several concurrency levels using docker stats. Full-page screenshots are the big spikes: 1,440x20,000 pixels is about 115 MB raw. For serverless, @sparticuz/chromium recommends at least 512 MB and suggests 1,600 MB. Set a container memory limit and lower Puppeteer's protocolTimeout so OOM-killed work fails fast.
Playwright for Python is the most direct: p.chromium.launch() then page.screenshot() or page.pdf(). In Docker, base on mcr.microsoft.com/playwright/python with a matching pip install playwright, run as pwuser and pass chromium_sandbox=True. Selenium works too, with options.add_argument('--headless'); pyppeteer is unmaintained.
Ship your first render in 60 seconds.
500 free credits to start. No card. Cancel by ignoring it.