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.For more information, check out our docs:- Install LocalStack: https://docs.localstack.cloud/getting-started/installation/- Configure an Auth Token: https://docs.localstack.cloud/getting-started/auth-token/ - Supported EC2 operations: https://docs.localstack.cloud/user-guide/aws/ec2/#operations - Supported Instances & AMIs: https://docs.localstack.cloud/user-guide/aws/ec2/#instances-and-amis Corrections:- LocalStack will no longer provide the Ubuntu 20.04 Docker AMI (used in this video) by default in the next major release. It can still be manually added.- 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

Making your AWS cloud environment state persistent

Recreating the unique state of a cloud app environment is notoriously complex, making it difficult to diagnose bugs, collaborate with teammates, or even just pick up where you left off. Join us as we deep dive into LocalStack’s powerful state management and persistence features, exploring how to maintain, snapshot, and seamlessly share your local cloud environments using core features like persistence, Cloud Pods, and state files. Learn how to restore a previous state, share preconfigured environments with colleagues for collaboration or onboarding, or restore preset services and data for functional tests in CI. We'll also showcase LocalStack's new Model Context Protocol (MCP) integration, revealing how AI can manage, inspect, and automate your local cloud state.

Learn More
Learn More
Give Your AI Agent a Local AWS Environment with LocalStack

An agent will write you a CDK stack, a Terraform module, or a stack of IAM policies in seconds.

Whether any of it works is a separate question, and the usual way to find out is to deploy to a real AWS account and watch what breaks.

In an agentic workflow, that means giving AI access to a public cloud account, racking up costs on the AWS bill, and waiting for provisioning to complete every time you push new code to the environment.

Learn More
Learn More
Securing the Software Delivery Lifecycle when AI Writes the Code

The rise of agentic AI in the software delivery lifecycle creates a dilemma with high-stakes implications.

As agents create new applications at an unprecedented rate, how do you integrate security without slowing down delivery?

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