# Headless & Headful Browsers

{/* vale off */}

Give every session, scrape or screenshot its own disposable browser microVM (headless or with a full display) that starts in milliseconds.

<ValueCards>
  <ValueCard title="Start heavy browsers in milliseconds" metric="cold start < 10 ms">
    Bring any browser you like; the platform is browser-agnostic.
    Its long startup happens once: snapshot the initialised browser into a [template](/platform/instances#instance-templates) and boot every session from there.
  </ValueCard>
  <ValueCard title="Fast to start and still customizable" metric="templates + ROMs, no rebuild">
    Templates alone would give you identical browsers.
    A [ROM](/features/roms) mounted at boot carries that session's own profile, cookies, proxy or script, so one warm template serves many distinct sessions.
  </ValueCard>
  <ValueCard title="Headful sessions, GPU-accelerated" metric="GPU rendering">
    Run browsers with a real display and [GPU](/platform/instances#gpus)-backed rendering (for video, WebGL and canvas-heavy pages that a headless, software-rendered browser can't handle).
  </ValueCard>
</ValueCards>

<FlowDiagram caption="One template gives every session a warm browser in milliseconds; the ROM mounted on top is what makes each one different.">
  <FlowBox title="Browser image">
    Any browser (Chromium, Firefox, WebKit) plus your automation code
  </FlowBox>
  <FlowArrow label="snapshot once" />
  <FlowBox accent title="Template">
    Browser fully initialized, then snapshotted
  </FlowBox>
  <FlowArrow accent label="< 10 ms each" sublabel="+ ROM per session" />
  <FlowStack more="...run as many as you need">
    <FlowStackItem label="browser" chip="rom: profile-a" />
    <FlowStackItem label="browser" chip="gpu · rom: video" />
    <FlowStackItem label="browser" chip="rom: scrape-job" />
  </FlowStack>
</FlowDiagram>

Watch the video to see a browser deployed with a full display, driven over VNC and screenshotted, asleep between each interaction.

<UseCaseVideo src="headless-browsers.webm" captions="headless-browsers.vtt" />

---

## Under the hood

The platform features this use case is built on.

<FeatureTable>
  <FeatureRow
    links={[
      { label: "Stateful scale-to-zero", href: "/features/scale-to-zero#stateful-scale-to-zero" },
      { label: "templates", href: "/platform/instances#instance-templates" },
    ]}
  >
    Snapshot the browser after its long initialisation and start instances from that state in milliseconds.
  </FeatureRow>
  <FeatureRow title="ROMs" href="/features/roms">
    Read-only blobs mounted on a VM at start.
    Paired with templates they customise each instance (profile, cookies, proxy, script) without rebuilding the image.
  </FeatureRow>
  <FeatureRow title="GPU support" href="/platform/instances#gpus">
    Headful browsers can render on a GPU, so video playback, WebGL and canvas-heavy pages behave as they do on a real machine.
  </FeatureRow>
  <FeatureRow title="Branching" href="/features/branching">
    Clones a running browser (memory, cookies and open tabs included), so several paths can be explored from one logged-in state.
  </FeatureRow>
  <FeatureRow title="Network shield" href="/features/network-shield">
    Optionally filter the browser's network traffic, and inject secrets and API keys so the browser does not need to hold them.
  </FeatureRow>
  <FeatureRow title="Autokill" href="/features/autokill">
    Caps how long a session can run, useful when a page hangs and would otherwise stall the instance.
  </FeatureRow>
</FeatureTable>

<UseCaseCta
  title="Automate your first browser now"
  guideHref="/guides/httpserver-node-express-puppeteer"
  guideLabel="Browsers guide"
>
  Sign up to Unikraft Cloud then follow the guide to automate your first browser
</UseCaseCta>

{/* vale on */}
