DEV Community

Cover image for Why I'm Using LocalStack in My Project (And Why You Might Want to Too)
Matheus Bernardes Spilari
Matheus Bernardes Spilari

Posted on

Why I'm Using LocalStack in My Project (And Why You Might Want to Too)

TL;DR: I’m using LocalStack to emulate AWS services locally, mainly because I don’t want to wake up to a surprise credit card bill 😅 — but also because it's fast, easy to integrate with Docker, and helps me stay productive without needing real cloud resources.


💳 Let's Get Real — AWS Billing Is Scary

If you’ve ever added a real AWS key to a pet project and forgot to delete a bucket, or left something running overnight...

You know the fear. I didn’t want to risk seeing a three-digit charge on my card just for experimenting with S3 and DynamoDB.

And honestly, not everyone even has a credit card to begin with ,especially students or people just getting started.

That’s when I found LocalStack.


What is LocalStack?

LocalStack is a fully functional local AWS cloud emulator. It allows you to develop and test cloud applications entirely on your local machine, without connecting to actual AWS infrastructure.

Even with the free tier, you get access to several core AWS services locally, including:

  • S3
  • DynamoDB
  • Lambda
  • SNS / SQS
  • API Gateway

And a bunch more.


🤔 Why I Chose LocalStack

In my case, I’m building a POC(Proof of Concept) of a full-stack app (React + Spring Boot), with websockets, that stores albums and pictures using AWS-like services:

  • S3 for image storage
  • DynamoDB for metadata

I wanted to mimic an AWS-based architecture without actually connecting to AWS, because:

  • I don’t want unexpected billing
  • I’m still exploring how AWS services work
  • I wanted full control of my stack locally
  • I didn't want to put my card at risk
  • And yes... I really didn’t want to add a credit card to AWS just to test things 😅

🔍 Friendly Web UI to Monitor Services

Even on the free plan, LocalStack provides a very intuitive web interface where you can inspect your services. You can:

  • Check which buckets you've created in S3
  • Browse DynamoDB tables and data
  • See logs and API calls
  • Monitor services running
Beautiful UI from LocalStack

It’s like having your own local AWS Console — and it’s amazing for debugging and learning.


🐳 How I’m Using LocalStack with Docker Compose

Here’s how I set it up in my docker-compose.yml, located inside the /webSocketBackend directory:

services:
  localstack:
    image: localstack/localstack:latest
    container_name: localstack
    ports:
      - "4566:4566"
    environment:
      - SERVICES=s3,dynamodb
      - DEBUG=1
    volumes:
      - "localstack_data:/var/lib/localstack"

volumes:
  localstack_data:
Enter fullscreen mode Exit fullscreen mode

Once it's running, I can start the backend and point my AWS SDK to http://localhost:4566. Everything behaves just like AWS — but it’s all running on my machine.


✅ Benefits of Using LocalStack (Even on the Free Plan)

1. No Credit Card Needed

You can build and test AWS-based apps with zero billing worries — perfect for students or devs without a card.

2. Safe Learning Environment

If you're just starting out with AWS, LocalStack is the perfect sandbox to learn S3, DynamoDB, and more without fear.

3. Blazing Fast Feedback Loop

No internet lag. No real deployments. Just run, test, fix — all locally.

4. Cloud-Like Testing for Free

You can simulate real AWS workflows and catch bugs before going to production.

5. Easy Integration with Docker

Thanks to Docker Compose, LocalStack fits right into your containerized workflow.

6. No Surprise Bills

Enough said 😂


Tips

  • Use the AWS CLI with --endpoint-url=http://localhost:4566 to manage your mock services.
  • Make sure your SDK is pointed to the same local endpoint.
  • Create your buckets/tables at startup via CLI, code, or scripts.

Conclusion

LocalStack gave me the confidence to build AWS-style applications without worrying about billing, credentials, or account limits. Whether you're experimenting, learning, or working in a team without AWS access — it just makes sense.

If you're cloud-curious but want to stay local for now, I can’t recommend LocalStack enough. Especially if you’re like me and still not ready to hand your credit card over to Jeff Bezos 😅


📍 Reference

💻 Project Repository

👋 Talk to me

Top comments (0)