TL;DR — Firecracker is a purpose-built KVM microVM hypervisor that boots in ~125ms with ~5MB memory overhead per VM. AWS Lambda, Fargate, and Fly.io use it to deliver hardware-level isolation without the latency of traditional VMs. It achieves this by stripping a hypervisor down to a minimal VMM, a tiny Linux kernel, and a minimal initrd.

Serverless compute has a fundamental tension: you want the isolation of a virtual machine, but the cold-start latency of a container. Traditional VMs boot in seconds. Containers boot in milliseconds but share a kernel, which means a vulnerability in one workload can compromise the host and every other tenant. Firecracker, the open-source microVM hypervisor that AWS built and later open-sourced, resolves this tension by building the smallest possible VM that still gives you hardware-level isolation. It powers AWS Lambda, Fargate, and Fly.io, and it has become the backbone of modern serverless infrastructure.

Why MicroVMs?

Before Firecracker, the industry had two extremes. Containers (Docker, Kubernetes) start fast — a well-configured container can be ready in under 100ms — but they all share the host kernel. That means a kernel exploit in one tenant’s container can escape to the host, and every other tenant on that machine is exposed. This is a non-starter for multi-tenant public cloud.

Traditional hypervisors (VMware, KVM with a full distro, Xen) give you strong isolation because each VM runs its own kernel, but they are slow to boot. A minimal Linux VM with a full userspace can take 5 to 30 seconds to reach a usable state. For a serverless function that might execute once and then go back to sleep, that latency is unacceptable.

A microVM sits between these two worlds. It is a virtual machine, so it gets hardware-enforced isolation via KVM, but it is stripped down to the bare minimum: a micro-kernel, a tiny initrd, and no userspace beyond what the workload needs. Firecracker’s innovation was not inventing microVMs — the concept existed before — but building a production-grade, open-source tool that made them fast, safe, and easy to orchestrate at scale.

Architecture of a Firecracker MicroVM

Firecracker is not a hypervisor in the traditional sense. It is a Virtual Machine Monitor (VMM) that uses the Linux kernel’s KVM (Kernel-based Virtual Machine) API to create and run microVMs. The architecture has four key components:

The VMM Process

The Firecracker binary is a single, statically linked Rust process. It opens /dev/kvm, creates a virtual machine, configures memory and CPUs, loads a kernel and initrd, and exposes a REST API for runtime management. The entire VMM process uses roughly 3 to 5MB of RAM before any guest workload starts. This is the magic number: it means a host with 8GB of RAM can run well over a thousand Firecracker processes, each ready to host a microVM.

The MicroVM Kernel

Firecracker does not ship a full Linux distribution. It uses a custom-tuned Linux kernel, typically around 3 to 5MB compressed, that boots directly into a minimal initrd. The kernel is configured with a reduced set of drivers — no USB, no PCI hotplug, no filesystems beyond the initramfs — which shrinks both the kernel image and the attack surface. The kernel boots in what Firecracker calls “microVM mode,” where it expects to be the sole workload in the VM.

The Jailer

Firecracker’s jailer is a separate process that wraps the VMM in a chroot, sets resource limits, and drops privileges before the VMM starts. This defense-in-depth layer ensures that even if the VMM process is compromised, the attacker cannot access the host filesystem or network directly. The jailer also handles process supervision and cleanup, which is critical when you are running thousands of VMM processes on a single host.

The REST API

All interaction with a running Firecracker instance happens over a Unix socket with a RESTful API. You can configure the boot source, drives, network interfaces, and machine resources via HTTP PUT requests. This makes Firecracker easy to integrate into orchestration systems. Lambda’s runtime loader, for example, uses this API to boot a new microVM for each function invocation, configure the network, and then signal readiness.

Booting in 125 Milliseconds

The headline number for Firecracker is boot time. In production, a microVM can reach the point where it is ready to execute user code in roughly 125ms. This is achieved through several optimizations:

  • Minimal kernel and initrd. The kernel is stripped of unnecessary drivers and compiled with a small footprint. The initrd contains only the binaries needed to run the user’s code — often just the language runtime (e.g., the Node.js or Python runtime for Lambda) and the function’s dependencies.
  • No BIOS/UEFI. Firecracker uses direct kernel boot, skipping the firmware phase entirely. The kernel is loaded directly into memory by the VMM.
  • No disk I/O at boot. The root filesystem lives in a memory-backed initramfs. There is no block device to probe, no filesystem to mount, no disk driver to initialize.
  • Pre-warmed kernel. The kernel is compiled and stored in a shared page cache on the host. When a new microVM boots, the kernel pages are already in the host’s page cache, avoiding disk reads.

The result is that a cold start — from the moment the orchestration system requests a new microVM to the moment the function is ready to receive requests — takes about 125ms. This is fast enough that it is effectively indistinguishable from a warm container start for most applications.

Isolation and Security

Isolation is the primary reason to use Firecracker over containers. Each microVM runs its own kernel, and KVM provides hardware-enforced separation between VMs. But Firecracker adds several layers of defense on top of KVM:

  • Seccomp filters. The VMM process itself is restricted by seccomp-bpf filters that limit the syscalls it can make. This reduces the attack surface of the VMM to a small, auditable set.
  • Jailer chroot and namespace isolation. The jailer ensures the VMM process cannot access the host filesystem or network. Even a full compromise of the VMM would not give an attacker access to the host.
  • No shared kernel. Because each microVM has its own kernel, a vulnerability in one tenant’s kernel does not affect any other tenant. This is the fundamental security advantage over containers.
  • Memory safety. Firecracker is written in Rust, which prevents entire classes of memory corruption bugs (buffer overflows, use-after-free, double frees) that have historically been the source of hypervisor vulnerabilities.

Firecracker also supports running multiple microVMs per host, with each microVM getting its own isolated memory and CPU resources. The host kernel schedules VMM processes like any other process, and KVM ensures that guest memory is not accessible to the host or to other guests.

Patterns in Production

Firecracker is not just a research project. It is in production at scale across multiple cloud providers and platforms.

AWS Lambda

Lambda was the original use case. AWS uses Firecracker to run millions of function invocations per second. Each function runs inside its own microVM, which is created on-demand when a function is invoked for the first time. The microVM is then “frozen” — its state is saved and the VMM process is paused — and thawed when the function is invoked again. This allows AWS to reuse the same microVM for multiple invocations of the same function without losing isolation.

AWS Fargate

Fargate uses Firecracker to run containers in an isolated environment. A Fargate task is a container image that is run inside a Firecracker microVM. This gives you the familiar container experience with the isolation of a VM. From the user’s perspective, it looks like a container. From the infrastructure’s perspective, it is a microVM.

Fly.io

Fly.io uses Firecracker to run near-user applications on their global network. Each Fly.io app runs in its own Firecracker microVM, which allows them to offer VM-level isolation with container-level density. Their “Machine” API lets you configure the microVM directly, giving you fine-grained control over CPU, memory, and storage.

Cloudflare Workers (isolated VMs)

While Cloudflare Workers primarily uses V8 isolates for their main compute product, they have also experimented with Firecracker-based microVMs for workloads that require stronger isolation or that need to run non-JavaScript code.

Building Your Own MicroVM

You can build and run your own Firecracker microVM today. Here is a minimal example that boots a microVM and runs a simple command:

# Install Firecracker from source or a release binary
# https://github.com/firecracker-microvm/firecracker/releases

# Download a minimal kernel and rootfs
# The Firecracker project provides example images:
# https://github.com/firecracker-microvm/firecracker/blob/master/docs/rootfs.md

# Create a simple config file (boot.json)
{
  "boot-source": {
    "kernel_path": "/path/to/vmlinux",
    "boot_args": "console=ttyS0 reboot=k panic=1 pci=off"
  },
  "drives": {
    "rootfs": {
      "path": "/path/to/rootfs.ext4",
      "is_root_device": true,
      "is_read_only": false
    }
  },
  "machine-config": {
    "vcpu_count": 1,
    "mem_size_mib": 128
  },
  "networks": {
    "eth0": {
      "host_dev_name": "tap0",
      "guest_dev_name": "eth0"
    }
  }
}

# Start Firecracker with the config
firecracker --api-sock /tmp/firecracker.sock --config-file boot.json

Once the microVM is booted, you can interact with it via the REST API or by connecting to the serial console. The guest kernel boots into your rootfs, and you can run any command inside the microVM.

For a more advanced use case, you can use Firecracker’s snapshot and restore functionality to create pre-warmed microVMs that can be restored in milliseconds, eliminating the boot time entirely for repeated invocations.

Key Takeaways

  • Firecracker is a KVM-based microVM hypervisor that boots in ~125ms with ~5MB memory overhead per VM.
  • It achieves this by using a minimal kernel, a memory-backed initrd, and direct kernel boot, skipping BIOS/UEFI entirely.
  • Each microVM runs its own kernel, providing hardware-level isolation that is stronger than containers and faster than traditional VMs.
  • The jailer process wraps the VMM in a chroot with seccomp filters, adding defense-in-depth on top of KVM’s isolation.
  • Firecracker powers AWS Lambda, Fargate, Fly.io, and is being adopted by other platforms for multi-tenant serverless compute.
  • You can build and run your own Firecracker microVMs today using the open-source project and example images provided by the Firecracker team.

Further Reading