Running an EC2 instance locally using LocalStack

In this video, you'll learn how you can run an Elastic Compute Cloud (EC2) instance locally using LocalStack's core cloud emulator. Elastic Compute Cloud (EC2) is a core service within Amazon Web Services (AWS) that provides scalable and flexible virtual computing resources. EC2 enables users to launch and manage virtual servers, commonly referred to as instances. LocalStack is a core cloud emulator that allows you run EC2 instances using a Docker backend. Under the hood, LocalStack spins another Docker container that mimics an EC2 instance functionality, including other add-on features such as EBS, IMDS, and Load Balancers. Corrections: LocalStack will no longer provide the Ubuntu 20.04 Docker AMI (used in this video) by default in the next major release, though it can still be manually added, and on nine minutes & nine seconds mark, we meant 'localhost' instead of 'localstack'. To access the web server, you can hit the localhost:8000 endpoint as shown in the video.

Related Talks

WTH is Chaos Engineering?! A Quick Look at Breaking Things on Purpose

Ever wonder why some teams intentionally break their own systems? Welcome to the world of chaos engineering — a practice that's not just for Netflix-scale infrastructure, but for any team that wants to build resilient, reliable applications. In this session, we'll demystify chaos engineering and explain why intentionally breaking things is actually the smart move. You'll learn what chaos engineering really is (in plain English, no buzzwords), why waiting for production failures is a terrible strategy, how to start experimenting with controlled failure locally, before it happens in the wild, real-world examples of chaos experiments that catch bugs you'd never find in traditional testing, and tools and techniques to get started without blowing up your infrastructure. Through practical demos using LocalStack's cloud emulation and chaos engineering tools, we'll simulate failures like network latency, service outages, and resource exhaustion right from your laptop. If you've ever said "it worked on my machine" only to watch it crash in production, this talk is for you—let's break things intentionally so they don't break unexpectedly.

Learn More
Learn More
Wait, Building in the Cloud Is This Complicated?

Testing in the cloud = slow builds, fragile staging, surprise bills. Let’s talk about how developers are flipping the script and using local cloud environments to test smarter, faster, and cheaper — without breaking production. Bonus: You’ll learn how LocalStack lets you simulate AWS on your machine. Game changer.

Learn More
Learn More
Unified Kubernetes Support in LocalStack

LocalStack now provides enhanced support for running AWS services in Kubernetes environments. In this presentation from the LocalStack 4.0 community meetup by Simon Walker, we explore how to deploy and manage local AWS resources within Kubernetes clusters with LocalStack, to help developers maintain consistency between development and production environments. The session further covers LocalStack’s Kubernetes integration, including deployment via Helm charts, configuration of services like Lambda and RDS as Kubernetes pods, and networking between components. A demo illustrates provisioning a serverless application (Lambda functions interacting with a MySQL database) using Terraform, with all resources managed within a local Kubernetes cluster. You'll additionally learn the practical approaches for local testing and infrastructure emulation by moving from Docker to Kubernetes-native solutions as well as upcoming features, including broader service support and new container runtime options.

Learn More
Learn More

Launch yourself in the world of local cloud development

Try for free
Try for free
Talk to Sales
Talk to Sales