
There's No Place Like localhost:4566
Running AWS on your own machine without selling a kidney. The paid road (LocalStack + cdklocal), my free swap (MiniStack), and the new kid on the block (AWS Blocks)
Preface (existential crisis, skip it if you just want tech stuff xD)
Who'd have guessed it'd be normal to torch $160 a day, and that's the frugal setup, the harness-is-my-bestie, I-compacted-everything, I-set-a-budget-alarm setup, I-speak-like-caveman , I-use-ponytail , just to build something. And we call that savings. One hundred and sixty bucks. Round my parts that nearly buys out the corner boteco . The whole joint. Just for you.
And what do we get? Plastic productivity (brain fry...). Temples bulging, paddling just enough to keep our chin over a rising tide of PRs nobody really reads no more . We even gave the feeling a fancy name: cognitive debt . Which then turns into debt of intention . Translation for the rest of us: ain't nobody understands a thing anymore, and understands even less what they wanna build or where they're headed.
But sure, the folks driving the bus spin myths , then distil fable s outta the myths. Funny, right? On the eve of an IPO, beggin' everybody to pause AI like it's a nuclear drill, then shippin' the state of the art anyway. Real artistic. To the point of, hmm, lyin' about 96% of the time . And here I sit, fixin' to get played by a pile of transformers into pretendin' I did something useful, fillin' some magnate's pocket with money that got summoned outta thin air 😅.
And me tryin' to tell my vó what I do for a livin', seein' as I don't really code no more. "It's like this, grandma: I run puppets. You seen Despicable Me? I take afternoon daydreams, turn 'em into requirements, toss 'em to a swarm of minions to build, then I sit here squintin' at whatever they hand back. One rule keeps me sane: treat the outputs like a compiler."
Afternoon daydreams . Anyway. Back to the code...
And speakin' of frugal, real frugal, not the air-quotes kind, let's talk about the cheapest dev box there is: the one already sittin' open on your lap, runnin' for $0 a day.
Why bother runnin' AWS local
Same three reasons every time. The loop (a
cdk deploy to real AWS is a coffee run, a local one's a sip). The bill (see: corner boteco). And the blast radius (your half-cooked event-source mapping spillin' into a real DLQ at 2am beats gettin' the same bug in a container you can just rm).The dream's simple: write your CDK once, run it local while you tinker, ship the same code to AWS when it's ready. Three tools get you there, sittin' at three real different layers. Goin' in order of how much they bleed your wallet.
Option 1. The paid road: LocalStack + cdklocal
LocalStack is the one everybody knows. One container fakin' the AWS APIs on
localhost:4566. Point your SDK, CLI, or IaC at that port and it answers like AWS would. For CDK you don't run cdk, you run cdklocal , a thin wrapper that does one slick thing: swaps the CloudFormation endpoint so your stack lands on the emulator, not the real account. Same constructs, same synth, different address.Short as it gets:
1
2
3
4
5
6
npm install -g aws-cdk aws-cdk-local
pip install localstack awscli-local
localstack start -d # boots :4566
cdklocal bootstrap # cdklocal already aims at :4566
cdklocal deploy --require-approval never
That's the whole gag.
cdklocal is cdk pointin' somewhere else.Here's the rub, and the reason this section exists. LocalStack squeezed what used to be free. Community runs under a restricted license now, and a fat chunk of the services that make local dev feel like AWS sit behind Pro, which starts around $35/month and climbs per seat. Company? Fine, expense it. Solo builder, student, OSS maintainer? "$35 a month to mock a cloud you ain't even payin' for yet" hits different. That squeeze is the whole reason for the next option.
Option 2. My road: MiniStack + cdklocal + Podman (free, MIT, $0)
MiniStack showed up as the answer to exactly that gripe. Free, open-source, MIT. Same play as LocalStack (38-ish services on port
4566, drop-in for boto3, CLI, Terraform, Pulumi, CDK), but with a few choices that make it punch up:- It's tiny. ~250MB image, a few dozen MB of RAM idle, sub-second boot. LocalStack's image is near 1GB and wants ~500MB just to sit there. On a laptop already runnin' Slack, Chrome, and your existential dread, that counts.
- Some services are real, not faked. Spin up RDS and you get an actual Postgres container with a real
host:port. ElastiCache hands you real Redis. Athena runs real SQL via DuckDB. ECS starts real Docker containers. You ain't mockin' the DB, you're talkin' to one. - No account, no key, no signup.
pip install ministack && ministack, or onedocker run. That's it.
Now the part I actually wanna show you, 'cause it's almost too clean.
cdklocal got written for LocalStack. But it don't know or care what's behind localhost:4566, it just wants somethin' speakin' the CloudFormation protocol. MiniStack speaks it, same port, and even serves a LocalStack-flavored health endpoint (/_localstack/health) so the tooling feels right at home. So the wrapper built for the paid thing works, untouched, against the free thing. That's the whole point of cdklocal-ministack : a tiny CDK app (one SQS queue, one Node 22 Lambda wired as consumer) deployed to MiniStack with cdklocal, on Podman 'stead of Docker.Here's the run, warts and all, 'cause the warts is where the real knowledge hides.
MiniStack needs a Docker-API socket to run Lambda containers. On rootless Podman you expose it once per session:
1
2
3
systemctl --user start podman.socket
podman compose up -d
curl http://localhost:4566/_ministack/health # should say healthy
Creds.
cdklocal wants both endpoint vars:1
2
3
4
5
export AWS_ENDPOINT_URL=http://localhost:4566
export AWS_ENDPOINT_URL_S3=http://s3.localhost.localstack.cloud:4566
export AWS_DEFAULT_REGION=us-east-1
export AWS_ACCESS_KEY_ID=test
export AWS_SECRET_ACCESS_KEY=test
Yeah, that S3 endpoint's a
localstack.cloud hostname. MiniStack borrows LocalStack's DNS trick for S3 addressing. The free fork standin' on the paid project's shoulders, both standin' on AWS. Turtles all the way down, and I'm cool with it.Now the wart that'll eat 20 minutes if nobody warns you. MiniStack pulls
public.ecr.aws/lambda/nodejs:20 to run the function, and that tag's flaky. Pre-pull the same image from Docker Hub and re-tag it so MiniStack finds it local:1
2
podman pull amazon/aws-lambda-nodejs:20
podman tag amazon/aws-lambda-nodejs:20 public.ecr.aws/lambda/nodejs:20
Then it's just CDK:
1
2
cdklocal bootstrap
cdklocal deploy --require-approval never
Proof it works. Send a message, watch the Lambda eat it:
1
2
3
4
5
6
awslocal sqs send-message \
--queue-url http://localhost:4566/000000000000/demo-queue \
--message-body "hello from ministack"
awslocal logs tail /aws/lambda/demo-consumer --follow
# Received message: hello from ministack
No account. No bill. No 2am DLQ. Same CDK you'd ship to prod.
Skeptic's footnote, 'cause I'd be a hypocrite without it. MiniStack's a young community emulator and its CloudFormation coverage is partial. Unsupported resource types fail loud with
CREATE_FAILED 'stead of lyin' quiet, which is the behavior you want, but it means you check the exact services your stack touches before trustin' the green check. Treat it like any dep that hooks your build: read what it really does, test the path you care about, don't assume parity you ain't seen with your own eyes. Great free tool. Still not real AWS, and it don't pretend to be.Option 3. The new kid: AWS Blocks (whole different beast)
Then AWS Blocks dropped, and it's worth knowin' 'cause it ain't the same kinda thing. Not an emulator at all. I'm puttin' it here 'cause folks'll lump all three together, and the difference is the point.
Just in case you're a CDK dev like me and want to see what another CDK dev thinks, I'd recommend Kenta Goto 's post .
Just in case you're a CDK dev like me and want to see what another CDK dev thinks, I'd recommend Kenta Goto 's post .
LocalStack and MiniStack sit under your code: you write normal CDK, they fake AWS so it runs somewhere cheap. AWS Blocks sits around your code. It's a backend toolkit where each "Block" is a whole capability (a
KVStore, a FileBucket, an AuthCognito, an AsyncJob, an Agent) bundlin' three things at once: the API you call, the infra it deploys, and a built-in local impl. You don't run a fake cloud beside your app, the mockin' lives inside the abstraction.The mechanism's genuinely slick. Node conditional exports load a different impl dependin' on context:
1
2
3
4
const todos = new KVStore(scope, 'todos');
// local dev → in-memory / filesystem store on your machine
// cdk synth → an Amazon DynamoDB table in a CloudFormation template
// lambda prod → real DynamoDB SDK calls
One line. Three lives. No code change between 'em.
npm create @aws-blocks/blocks-app@latest, npm run dev, whole backend runs local on localhost:3000. No account, no creds, no container to babysit. Types flow end to end, and not just to a TS frontend, out to native clients (Swift, Kotlin, Dart/Flutter) via generated SDKs. Apache-2.0, needs Node 22+, and it's got AWS docs , so it's a blessed-labs play, not some weekend repo.Trade-off's the honest flip side. With MiniStack you keep your own CDK and rent a cheap spot to run it. With Blocks you adopt their idea of what a backend is, you build inside the Blocks model, and that's a real commitment, not a config flag. And it's brand new: handful of commits, no releases yet, the kinda star count that means "interesting," not "battle-tested." Love where it's headed. Wouldn't bet a prod roadmap on it this quarter. Skepticism's a quality, not a defect.
So which one, mate?
Think of it like pickin' a kitchen. LocalStack's the famous restaurant that started chargin' a cover at the door. MiniStack's cookin' the same recipes in your own kitchen for the price of groceries (lil' more setup, couple warts, but the bill's zero and you run the heat). AWS Blocks ain't a kitchen at all, it's a meal-kit sub that ships the ingredients, the recipe, and the pan, long as you cook the way the box says.
| LocalStack + cdklocal | MiniStack + cdklocal | AWS Blocks | |
|---|---|---|---|
| What it is | AWS API emulator | AWS API emulator | Full-stack backend framework |
| Your code | Your own CDK | Your own CDK | Built on Blocks primitives |
| Local cost | Free tier shrank, Pro ~$35+/mo | Free forever (MIT) | Free (Apache-2.0) |
| Footprint | ~1GB image | ~250MB image | Node process, no emulator |
| Best when | Already payin' for Pro | Want your CDK to run free | Greenfield full-stack |
| Maturity | Mature, commercial | Young, movin' fast | Brand new, experimental |
Got existing CDK and a thinnin' wallet (which, post-preface, is most of us)? MiniStack +
cdklocal is the move. Startin' a full-stack app from a blank folder and the Blocks shape fits? The new kid's worth a serious afternoon. Company already pays for LocalStack Pro? Keep usin' it, best tool's the one already bootstrapped.Through-line under all of it: be frugal 'cause it's a virtue, not a defect. Stay skeptical that any of these is really AWS till you watched the exact path you care about work with your own eyes. And don't let spending many bucks to run a day locally get so normal you forget you coulda run the whole thing on the laptop already open in front of you.
May your stacks deploy local and your bill stay boring. Back to the code. 🍻
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article