Skip to main content

LocalEmu

LocalEmu

A free, open-source AWS cloud emulator.

PyPI Python versions Docker Pulls License: Apache 2.0

Emulates AWS AWS services PRs welcome Ruff GitHub stars

Run AWS services locally. No account. No token. No sign-up.

LocalEmu demo: real AWS CLI against localhost:4566


What is LocalEmu?

LocalEmu emulates 133 AWS services on your machine. Use the same AWS CLI, boto3, Terraform, or CDK you already know - just point to localhost:4566.

Build and test against AWS APIs from your laptop with no account, no credentials, no internet. The iteration loop is seconds instead of minutes; you can break, reset, and rebuild as often as you want at zero cost.

Where it counts, the behavior is real, not stubbed: Lambda runs your code in the official AWS runtime images, EC2 instances are real containers on a real VPC with security groups enforced by actual packet filtering, RDS is a real PostgreSQL or MySQL you can open a connection to, and (with IAM_ENFORCEMENT=1) your identity and resource policies actually deny.

Install

pip install localemu

That's it. No Java. No tokens. No accounts. Docker is required for services that emulate by running a real engine in a sidecar (Lambda, ECS, EKS via k3d, RDS, OpenSearch, EC2). Everything else is pure Python and needs no Docker.

pip install localemu[runtime] still works too - every package that used to live behind that extra is now a plain dependency of the base package, so both commands install the exact same thing. The extra is kept only for backward compatibility with existing scripts and will be removed in a future release, at which point pip install localemu will be the only documented form.

Start

# Foreground (see the banner and logs)
localemu start

# Detached mode (runs in background)
localemu start -d

# Custom port
localemu start --port 4567

# Stop
localemu stop

localemu start: boot banner and ready state

Use

LocalEmu ships awsemu - a drop-in replacement for the AWS CLI that automatically points to LocalEmu. No configuration needed:

# S3
awsemu s3 mb s3://my-bucket
awsemu s3 cp file.txt s3://my-bucket/

# DynamoDB
awsemu dynamodb create-table --table-name Users \
  --key-schema AttributeName=id,KeyType=HASH \
  --attribute-definitions AttributeName=id,AttributeType=S \
  --billing-mode PAY_PER_REQUEST

# SQS
awsemu sqs create-queue --queue-name my-queue

# Lambda
awsemu lambda create-function --function-name hello \
  --runtime python3.12 --handler handler.handler \
  --role arn:aws:iam::000000000000:role/role \
  --zip-file fileb://function.zip

# Any of the 133 supported services...
awsemu ecs create-cluster --cluster-name my-cluster
awsemu rds describe-db-instances
awsemu cognito-idp create-user-pool --pool-name my-pool

awsemu sets credentials, region, and endpoint automatically. You can also use the standard AWS CLI, boto3, Terraform, CDK, or Pulumi - just point to http://localhost:4566.

Documentation & examples

The full documentation lives at localemu.cloud/docs: prerequisites, install guide, per-service API reference, and end-to-end use case walkthroughs.

For runnable code, clone the companion examples repository:

git clone https://github.com/localemu/localemu-examples

It ships self-contained tutorials covering common patterns: public + private VPC with EC2 / nginx / NACL, image pipelines, scheduled jobs, IAM least-privilege drills, Step Functions sagas, EKS + kubectl, chaos resilience tests, and more.

Explore

# List all supported services
localemu services

# Show operations for a specific service
localemu services s3
localemu services lambda
localemu services dynamodb

# Check running services
localemu status

# Stop
localemu stop

Dashboard

LocalEmu includes a built-in web dashboard for monitoring and exploring your local AWS environment in real time.

http://localhost:4566/_localemu/dashboard

The dashboard shows:

  • Overview: endpoint with copyable AWS_ENDPOINT_URL exports, version, uptime, IAM enforcement mode, persistence, Docker and Bedrock backend status, a requests-per-second chart with error and denial markers, and a grid of all 132 registered services (32 of them with a live resource counter; the rest show "not counted" instead of a false 0)
  • Resource drill-down: click any service to see tables, buckets, queues, functions, instances, IAM roles/users/policies, and more
  • S3 object browser and DynamoDB item viewer with click-through navigation
  • Command palette (Cmd+K, Ctrl+K, or /) to jump to any service, resource, or action
  • Live call panel: every AWS call with status, error code, principal, resource, account, and handling time — filterable by errors, writes, account, or LocalEmu-internal calls, pausable, and expandable to the full CloudTrail record
  • Account switcher to scope the console to one of your accounts
  • CloudTrail event history filterable by account and service, with expandable request/response details and the principal of each event
  • Light and dark themes that follow the OS preference until picked manually

Write actions are available for S3 buckets, SQS queues, SNS topics, and DynamoDB tables directly from the console; other services show the sample AWS CLI command to create them.

The dashboard starts automatically with LocalEmu. No configuration needed.

Simulation Features

Test real AWS behavior locally with opt-in feature flags:

# IAM policy enforcement (full AWS evaluation algorithm, see section below)
IAM_ENFORCEMENT=1 localemu start

# API throttling simulation (per-service AWS error codes)
SIMULATE_THROTTLING=1 THROTTLE_RATE=0.05 localemu start

# Network latency injection (realistic per-service delays)
SIMULATE_LATENCY=1 localemu start

# Lambda cold start simulation
LAMBDA_COLD_START_DELAY=3 localemu start

# EC2, ECS, and EKS use real containers automatically when Docker is
# available; no env var needed. Opt out via EC2_VM_MANAGER=none,
# ECS_DOCKER_BACKEND=0, or EKS_K8S_PROVIDER=off.

# Real RDS engines (PostgreSQL / MySQL / MariaDB in containers)
RDS_DOCKER_BACKEND=1 localemu start

Simulation features (IAM enforcement, throttling, latency, cold-start) are disabled by default; zero overhead when off. The container-backed services turn themselves off automatically when the Docker daemon is unavailable.

IAM Policy Enforcement

Run your AWS workload against the same policy rules AWS applies in production. Useful for catching permission errors locally before they surface in a deployed environment.

# Strict mode: deny unauthorized requests with 403 AccessDenied
IAM_ENFORCEMENT=1 localemu start

# Audit mode: log would-be denials, allow the request through
IAM_ENFORCEMENT=soft localemu start

# Bypass enforcement for specific access keys (comma-separated allow-list)
ROOT_ACCESS_KEYS=AKIAIOSFODNN7EXAMPLE IAM_ENFORCEMENT=1 localemu start

What gets evaluated (full AWS algorithm, see policy evaluation logic):

  • Explicit Deny in any policy → deny (identity / resource / permission boundary / session).
  • Same-account: either identity-policy Allow OR resource-policy Allow is sufficient.
  • Permission boundary: must also Allow (intersection).
  • Session policies (inline or managed) passed via AssumeRole: must also Allow (intersection).

Policy elements

Element Supported
Action / NotAction with wildcards * ? ✅
Resource / NotResource ARN matching ✅
Principal / NotPrincipal (AWS / Service / Federated / CanonicalUser) ✅
IAM policy variables: ${aws:username}, ${aws:userid}, ${aws:PrincipalTag/*} ✅
String / Numeric / Date / IpAddress / Bool / Arn / Null operators ✅
IfExists suffix ✅
ForAllValues: / ForAnyValue: set operators ✅

Condition context keys populated per request

aws:PrincipalArn, aws:PrincipalAccount, aws:PrincipalType, aws:SourceIp, aws:CurrentTime, aws:EpochTime, aws:SecureTransport (from TLS scheme), aws:UserAgent, aws:RequestedRegion, aws:username, aws:userid, aws:PrincipalTag/*, aws:RequestTag/*, aws:TagKeys, and aws:MultiFactorAuthPresent (set to "true" only when the caller's session was minted by AssumeRole / GetSessionToken with --serial-number, otherwise absent per AWS spec).

Temporary-credential validation: temporary access keys (ASIA* / LSIA*) must include an X-Amz-Security-Token. Expired sessions return ExpiredTokenException.

Limitations

  • Cross-account calls (caller account ≠ resource owner account) are currently treated as same-account. LocalEmu defaults to a single account so this rarely matters; if you emulate multi-account IAM flows, enforcement will be more permissive than AWS.
  • Service-principal grants on resource policies (e.g. Principal: {Service: lambda.amazonaws.com}) are not auto-matched for internal service-to-service calls; use AWS principals or * for now.

Bedrock (local inference)

bedrock:ListFoundationModels/GetFoundationModel return a curated, real catalog (Anthropic Claude 3.x, Amazon Titan, Meta Llama 3/3.1/3.2, Mistral/Mixtral, Cohere, AI21 Jamba — the long-established, verified-ID families; newer 2025/2026 providers aren't in the catalog yet, see src/localemu/services/bedrock/catalog.py).

bedrock-runtime:InvokeModel actually runs, picked by BEDROCK_BACKEND:

# Default: zero dependencies, deterministic, works instantly.
localemu start

# Real local inference via a Docker sidecar running Ollama.
BEDROCK_BACKEND=ollama localemu start
  • synthetic (default) — a deterministic placeholder response shaped like the real model family's output (Anthropic Messages, Titan, Llama, Mistral, Cohere, ...), so application code parses it without changes. Same prompt always returns the same output; different prompts return different output. No Docker, no download, no internet.

  • ollama — real generation/embeddings from a real local model, pulled into a Docker sidecar on first use (one-time download per model, same as any Docker image LocalEmu already pulls). Gated by a RAM pre-flight check (memory_gate.py): a one-time, static comparison of the machine's total physical RAM against the model's declared tier (16/32/64GB) — not a live/available-memory probe, since free RAM fluctuates minute to minute with whatever else is open and isn't a stable thing to gate on. A machine below the model's tier gets an immediate, readable error instead of attempting the pull at all:

    ServiceQuotaExceededException: 'meta.llama3-1-70b-instruct-v1:0' needs
    a 64GB-tier machine to run locally; this machine has 16.0GB of RAM.
    Pick a smaller model, or set BEDROCK_BACKEND=synthetic to skip real
    inference for this call.
    

Performance expectations with BEDROCK_BACKEND=ollama — real numbers, measured on a 16GB Mac (M-series) with Docker Desktop given 15.6GB; yours will vary with hardware, but the shape of these numbers won't:

Model Real RAM while loaded First-load time
llama3.2:1b 1.9GB ~3s
llama3.2:3b 2.9GB ~4s
gemma3:4b 4.4GB ~22s
mistral:7b 5.5GB ~28s
llama3.1:8b 5.9GB ~60-65s
gemma3:12b 8.7GB ~2min

First call to a given model pays both the Docker pull (one-time, network-bound — minutes for an 8B+ model on a slow connection) and this load time (every time the model has to come off disk into RAM — not one-time).

A 16GB machine cannot keep two 8B-class models warm at once. Ollama unloads a model after ~5 minutes idle (OLLAMA_KEEP_ALIVE) or sooner if RAM is needed for a different model you just called. Concretely: embed with amazon.titan-embed-text-v1 (nomic-embed-text), then generate with meta.llama3-1-8b-instruct-v1:0 (llama3.1:8b) a few minutes later — expect the generate call to pay a full ~60s reload, because loading the embedding model evicted it. This isn't a bug to work around; it's the real, honest cost of running two models on one RAM-constrained machine, same as it would be outside LocalEmu entirely. If your workshop/demo needs both warm simultaneously, budget RAM for both models' rows in the table above, not just the larger one.

Model mapping and fidelity (src/localemu/services/bedrock_runtime/local_inference.py). Every entry is honest about what is actually running: same_family (the real open-weight model), different_family (a real model standing in for a closed-weight one, e.g. Claude), or unavailable (no local model is a reasonable substitute at a dev-machine RAM budget, use synthetic instead). With BEDROCK_BACKEND=ollama, the response always comes from the "Runs locally as" model, never from the model named in the request.

Model id Runs locally as Min RAM Fidelity
anthropic.claude-3-haiku-20240307-v1:0 llama3.1:8b 16GB different_family (Claude has no open weights)
anthropic.claude-3-5-sonnet-20240620-v1:0 llama3.1:8b 16GB different_family (Claude has no open weights)
any other anthropic.claude-* id (Sonnet 4.x, Opus, Haiku 4.x, ...) llama3.1:8b 16GB different_family (same stand-in as the Claude entries above)
amazon.titan-embed-text-v1 nomic-embed-text 16GB different_family
amazon.titan-embed-text-v2:0 nomic-embed-text 16GB different_family
amazon.titan-text-express-v1 llama3.1:8b 16GB different_family
meta.llama3-8b-instruct-v1:0 llama3:8b 16GB same_family
meta.llama3-1-8b-instruct-v1:0 llama3.1:8b 16GB same_family
meta.llama3-2-1b-instruct-v1:0 llama3.2:1b 16GB same_family
meta.llama3-2-3b-instruct-v1:0 llama3.2:3b 16GB same_family
meta.llama3-2-11b-instruct-v1:0 llama3.2-vision:11b 16GB same_family
meta.llama3-70b-instruct-v1:0 llama3:70b 64GB same_family
meta.llama3-1-70b-instruct-v1:0 llama3.1:70b 64GB same_family
meta.llama3-1-405b-instruct-v1:0 none none unavailable (~230GB+ even at 4-bit)
meta.llama3-2-90b-instruct-v1:0 none none unavailable (more than a 64GB machine has)
mistral.mistral-7b-instruct-v0:2 mistral:7b 16GB same_family
mistral.mixtral-8x7b-instruct-v0:1 mixtral:8x7b 32GB same_family (total weights ≈47B params)
mistral.mistral-large-2402-v1:0 none none unavailable (closed-weight)
cohere.command-r-v1:0 mistral:7b 16GB different_family
cohere.embed-english-v3 nomic-embed-text 16GB different_family
cohere.embed-multilingual-v3 nomic-embed-text 16GB different_family
ai21.jamba-1-5-large-v1:0 none none unavailable (closed-weight)

A well-formed model id from a known provider that is not in this table is accepted by InvokeModel (the synthetic backend answers it). With ollama, such an id returns a ValidationException that names the model and tells you to use synthetic, except for anthropic.claude-* ids, which use the Claude stand-in above. Inference-profile ids (us.anthropic...) and model ARNs are accepted the same way.

Why no DeepSeek/Qwen/GLM/gpt-oss/Nemotron mapping yet: their exact Bedrock modelId strings weren't confirmed when this catalog was written. A wrong invented ID would mislead more than an honest gap — adding them (with verified IDs) is a good follow-up contribution.

RAM-tiered Ollama tags worth knowing, if you're extending the map yourself (dev machines commonly run 16–64GB):

RAM tier Good local models
16GB llama3.1:8b, llama3.2:1b/3b, llama3.2-vision:11b, mistral:7b, gemma3:4b/12b, nemotron, gpt-oss:20b
32GB mixtral:8x7b, gemma3:27b, qwen3:32b, deepseek-r1:32b (a distillation, not the real 671B R1)
64GB llama3.3:70b, qwen3-next (tight)

133 Supported Services

Run localemu services to see the full list. Key services include: ACM, API Gateway, AppSync, Athena, Backup, Batch, Bedrock, Bedrock Runtime, CloudFormation, CloudFront, CloudTrail, CloudWatch, CodeBuild, CodeCommit, CodeDeploy, CodePipeline, Cognito, Config, DynamoDB, EC2, ECR, ECS, EFS, EKS, ElastiCache, ELB, ELBv2, Elasticsearch, EMR, EventBridge, Firehose, FSx, Glacier, Glue, GuardDuty, IAM, IoT, Kafka, Kinesis, KMS, Lambda, CloudWatch Logs, Neptune, OpenSearch, Organizations, Pipes, RDS, Redshift, Rekognition, Resource Groups, Route53, S3, SageMaker, Scheduler, Secrets Manager, SES, SESv2, SNS, SQS, SSM, Step Functions, STS, Textract, Transfer, WAFv2, X-Ray, and more.

Python (boto3)

import boto3

s3 = boto3.client("s3",
    endpoint_url="http://localhost:4566",
    aws_access_key_id="AKIAIOSFODNN7EXAMPLE",
    aws_secret_access_key="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
    region_name="us-east-1",
)

s3.create_bucket(Bucket="my-bucket")
s3.put_object(Bucket="my-bucket", Key="hello.txt", Body=b"Hello!")

Terraform

provider "aws" {
  access_key                  = "AKIAIOSFODNN7EXAMPLE"
  secret_key                  = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
  region                      = "us-east-1"
  skip_credentials_validation = true
  skip_metadata_api_check     = true

  endpoints {
    s3       = "http://localhost:4566"
    dynamodb = "http://localhost:4566"
    lambda   = "http://localhost:4566"
    sqs      = "http://localhost:4566"
    # all services on the same endpoint
  }
}

Persistence

By default, LocalEmu state is ephemeral. To keep your resources across restarts:

# Local
PERSISTENCE=1 localemu start

# Docker
docker run -d --name localemu \
  -p 4566:4566 \
  -v localemu-data:/var/lib/localemu \
  -e PERSISTENCE=1 \
  --user root \
  localemu/localemu

State is saved on shutdown and restored on startup. S3 buckets, DynamoDB tables, Lambda functions, SQS queues, Secrets Manager secrets. Everything survives.

Save strategies (set via SNAPSHOT_SAVE_STRATEGY):

  • ON_SHUTDOWN (default): saves when LocalEmu stops
  • SCHEDULED: saves every 15 seconds (configurable via SNAPSHOT_FLUSH_INTERVAL)
  • MANUAL: save/load via POST /_localemu/state/save and POST /_localemu/state/load

Check status: GET /_localemu/state/status

Docker (alternative)

# Linux
docker run --rm -d -p 4566:4566 -p 4510-4559:4510-4559 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --group-add docker \
  -e DASHBOARD_API_OPEN=1 \
  localemu/localemu

# macOS (Docker Desktop)
docker run --rm -d -p 4566:4566 -p 4510-4559:4510-4559 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --user root \
  -e DASHBOARD_API_OPEN=1 \
  localemu/localemu

Why --user root on macOS? Lambda, ECS, and EC2 services spawn real Docker containers for function execution. On Docker Desktop for Mac the socket is owned by root inside the container regardless of host GID, so the non-root localemu user cannot access it. On Linux, adding the docker group (--group-add docker) is sufficient.

Why DASHBOARD_API_OPEN=1? The dashboard at http://localhost:4566/_localemu/dashboard is restricted to loopback callers by default. When LocalEmu runs in a container, a port-mapped request from your browser reaches the container from the Docker bridge, not from 127.0.0.1 inside it, so without the variable the dashboard returns 403 with a message naming this exact variable. The pip-install path does not need it because localemu start listens directly on the host loopback.

Accessing the dashboard (or any API) through a custom hostname? DASHBOARD_API_OPEN=1 only lifts the loopback-IP restriction above — it does not affect CORS. A browser sends an Origin header matching the hostname it's actually loaded from (e.g. http://my.domain:4567), and by default only localhost/127.0.0.1/app.localemu.cloud origins are allowed; anything else gets 403 Blocked CORS request from forbidden origin ... in the log, and the dashboard's own CSS/JS/API calls will fail the same way even though the first HTML page loads. Fix it with EXTRA_CORS_ALLOWED_ORIGINS (comma-separated, matched by hostname), the one knob that covers both the general API and the dashboard's write actions:

EXTRA_CORS_ALLOWED_ORIGINS=http://my.domain:4567 \
  DASHBOARD_API_OPEN=1 localemu start

Using the AWS CLI with Docker

When LocalEmu runs in Docker, use the standard AWS CLI from your host:

# Option A: set the endpoint once via env var (recommended)
export AWS_ENDPOINT_URL=http://localhost:4566
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
export AWS_DEFAULT_REGION=us-east-1

aws s3 ls
aws dynamodb list-tables
aws lambda list-functions

Standard AWS CLI against LocalEmu via env vars: DynamoDB and Lambda

# Option B: create a host-side awsemu alias
alias awsemu='aws --endpoint-url=http://localhost:4566 --region us-east-1'
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

awsemu s3 ls
awsemu sqs list-queues
# Option C: use awsemu inside the container
docker exec localemu bash -c \
  '. /opt/code/localemu/.venv/bin/activate && awsemu s3 ls'

Tip: Option A with AWS_ENDPOINT_URL is the cleanest: boto3 and the AWS CLI both read it automatically. Your code works identically on LocalEmu and real AWS by just unsetting the env var.

Contributing

License

Copyright (c) 2026 TocConsulting and LocalEmu contributors. Copyright (c) 2017-2026 LocalStack contributors. Copyright (c) 2016 Atlassian and others.

Apache License, Version 2.0. See LICENSE and NOTICE.

LocalEmu is a fork of LocalStack, which was archived by its maintainers. We are grateful to all original contributors.

Metadata

Release files for localemu 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for localemu 1.4.0
File Size Uploaded Provenance Actions
localemu-1.4.0.tar.gz 12.4 MB Without provenance Details for localemu-1.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for localemu 1.4.0
File Interpreter ABI Platform Actions
localemu-1.4.0-py3-none-any.whl Python 3 none any Details for localemu-1.4.0-py3-none-any.whl

Total release size: 25.6 MB

Release files / localemu-1.4.0.tar.gz

Download URL localemu-1.4.0.tar.gz
Size 12.4 MB
Tags Source
SHA-256 checksum
How to use checksums
3dd38d7ae8d2883f307e224014c6168a6caa1456caa8f26029b7677465409477
BLAKE2b-256 checksum
How to use checksums
1d71dcb56edeb277ad3c29cb4f2e07f38d093b1d5863971b38ce2008623dccb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Release files / localemu-1.4.0-py3-none-any.whl

Download URL localemu-1.4.0-py3-none-any.whl
Size 13.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2a4defb67224b00fa4da2c2f20957cc692f4796fa7f84868414e7d09655d86db
BLAKE2b-256 checksum
How to use checksums
fc22a928a9fa8b7b1c6dc63a922c135a432b45b26bdc607b9bdeafb29b35b3f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Security for localemu 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page