Serverless containers and functions are widely used for deploying and managing software in the cloud. Their popularity is due to reduced cost of operations, improved utilization of hardware, and faster scaling than traditional deployment methods. The economics and scale of serverless applications demand that workloads from multiple customers run on the same hardware with minimal overhead, while preserving strong security and performance isolation. The traditional view is that there is a choice between virtualization with strong security and high overhead, and container technologies with weaker security and minimal overhead. This tradeoff is unacceptable to public infrastructure providers, who need both strong security and minimal overhead. To meet this need, we developed Firecracker, a new open-source Virtual Machine Monitor (VMM) specialized for serverless workloads, but generally useful for containers, functions, and other compute workloads within a reasonable set of constraints. We have deployed Firecracker in two publicly available serverless compute services at Amazon Web Services (Lambda and Fargate), where it supports millions of production workloads and trillions of requests per month. We describe how specializing for serverless informed the design of Firecracker and what we learned from seamlessly migrating Lambda customers to Firecracker.