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

Smooth transition from local development to production for your AWS-powered applications

Running your Spring Boot app on AWS for production is common, but testing there can be slow and costly. In this video, we’ll show you how to speed up development using LocalStack. By provisioning your infrastructure with Terraform, you can easily switch to local testing in just three steps: configure your dev environment variables, start LocalStack in Docker, and run your IaC files. Get faster feedback and reduce costs by testing locally with LocalStack!

Learn More
Learn More
Simulate Microservices, Cloud Services, and Everything Else with WireMock & LocalStack

In this live session, WireMock CTO Tom Akehurst will introduce hybrid API simulation (local + cloud) with WireMock Runner. Tom will explain why we built Runner, how developers are using it today, and how it fits into modern dev and test workflows - such as simulating APIs during testing, prototyping, and AI-native development.

Learn More
Learn More
Simulating outages with LocalStack Chaos API

LocalStack Chaos API enables you to simulate outages in any AWS region or service. Chaos API provides an easy way to implement chaos engineering experiments to test a wide variety of simulated outages and failures within your application safely, without impacting your production users. Common examples can include region-wide outages, DNS failovers, service failures, and network faults. All the testing scenarios described above can be executed within LocalStack, providing thorough coverage for critical situations in a matter of minutes rather than hours or days. In this presentation by Viren Nadkarni, we explore how Chaos API is leveraged to perform service failures in a local environment while using robust error handling to address and mitigate such issues.

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