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

Smarter Serverless Dev with LocalStack VS Code Toolkit & Lambda Debugging

In this hands-on session, you’ll learn how to level up your serverless development by integrating the AWS Toolkit for VS Code with LocalStack — enabling faster Lambda development, debugging, and testing without needing a live AWS account. 👨‍💻 Featuring: Joel Scheuner, Senior Software Engineer at LocalStack, will show you how to configure the AWS Toolkit for VS Code to connect with LocalStack, deploy and test Lambda functions locally with full AWS emulation, set breakpoints and debug functions right from your IDE, and iterate quickly on code changes with minimal setup overhead. You’ll also hear from an AWS engineer sharing real-world insights and best practices for modern serverless workflows. Whether you’re new to serverless or already deep in AWS development, this session will help you code with confidence and streamline your Lambda workflow from start to finish — all from your laptop.

Learn More
Learn More
Testing CloudWatch metric alarms with LocalStack

LocalStack is a cloud service emulator designed for local development and testing of cloud applications. With LocalStack, you can test AWS CloudWatch metric alarms, to get notified on infrastructure failures — all on your local machine! In this video, you will learn how you can use a CloudWatch metric alarm to get notified automatically when your Lambda function invocations fail. You will also set up an email notification using the Simple Email Service (SES) and our Mailhog extension.

Learn More
Learn More
Testing Cloud Apps Shouldn't Be This Hard

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

Launch yourself in the world of local cloud development

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