Seven ways to run and test AWS-backed code locally now that LocalStack needs an account and an auth token, ranked by how much local setup each one removes.

The best LocalStack alternative for a backend that mostly needs Postgres, queues and buckets is Encore: your code declares those resources, encore run starts local versions of them, and a deploy creates the same resources in your own AWS or GCP account. If your code calls AWS APIs directly, use Floci or AWS Emulator. Moto covers Python tests and the SAM CLI covers Lambda.
LocalStack was the default container for running S3, SQS and DynamoDB on a laptop and in CI. In March 2026 it became a single image that needs an account and an auth token, and pipelines that pulled localstack/localstack:latest without a token started failing.
The replacement depends on what LocalStack was doing for you. If it stood in for a database, a queue and a bucket, you can skip emulation. If your code calls DynamoDB, Step Functions or Cognito, you still need an emulator.
The ranking puts first the option that removes the most local configuration for a typical backend, then the tools that emulate or mock AWS for code that needs the APIs themselves. Versions are from each project's releases page, package registry or, for AWS Emulator, its published version list.
Verdict. Pick Encore when LocalStack was standing in for a database, a queue and a bucket, because it removes the emulator and the Terraform behind it. Pick Floci when you need the AWS APIs and want the smallest change from LocalStack, and try AWS Emulator when you want the emulator AWS maintains.
With Encore, encore run starts local Postgres, Pub/Sub and buckets from your backend code, and a deploy creates the same resources in your own AWS or GCP account.
Most teams run LocalStack so that the app on a laptop has a bucket, a queue and a database to talk to. Encore gets there from the other direction with infrastructure from code. The database, the Pub/Sub topic and the bucket are declared in the application, encore run starts local versions of each, and a deploy creates RDS, SNS/SQS and S3 (or Cloud SQL, Pub/Sub and Cloud Storage) in your own cloud account from the same declarations. There is no emulator to point Terraform at, because these resources have no separate Terraform.

With LocalStack, a receipts flow gets its local bucket and queue from an init script or Terraform aimed at port 4566, and the app reads endpoint overrides from environment variables. With Encore, this file is the whole definition:
// orders/orders.ts (encore.dev v1.58)
import { api, APIError } from "encore.dev/api";
import { SQLDatabase } from "encore.dev/storage/sqldb";
import { Topic } from "encore.dev/pubsub";
import { Bucket } from "encore.dev/storage/objects";
// Local Postgres with migrations applied on `encore run`; RDS or Cloud SQL when deployed.
const db = new SQLDatabase("orders", { migrations: "./migrations" });
// Local topic on `encore run`; SNS/SQS or GCP Pub/Sub when deployed.
export const orderPlaced = new Topic<{ orderId: string }>("order-placed", {
deliveryGuarantee: "at-least-once",
});
// Local files on `encore run`; S3 or Cloud Storage when deployed.
export const receipts = new Bucket("receipts", { versioned: false });
const maxReceiptBytes = 2 * 1024 * 1024;
export const placeOrder = api(
{ method: "POST", path: "/orders", expose: true },
async ({ pdf }: { pdf: string }): Promise<{ orderId: string }> => {
const data = Buffer.from(pdf, "base64");
if (data.length === 0 || data.length > maxReceiptBytes) {
throw APIError.invalidArgument("receipt must be a PDF of at most 2 MiB");
}
const row = await db.queryRow<{ id: string }>`
INSERT INTO orders DEFAULT VALUES RETURNING id::text AS id
`;
const orderId = row!.id;
await receipts.upload(`${orderId}.pdf`, data, { contentType: "application/pdf" });
await orderPlaced.publish({ orderId });
return { orderId };
},
);
encore run starts local versions of each.placeOrder inserts a row, stores the receipt under the new order id and publishes orderPlaced. Locally, that is a Postgres database, a local Pub/Sub implementation and a folder on disk. The same declarations drive preview environments, which Encore hosts for each pull request, and production in your AWS or GCP account, so the gap between "works on my machine" and "works in AWS" is the gap between local and managed Postgres, not between an emulator and AWS.
Once AI coding agents write part of the backend, an agent that needs a bucket declares it in the same change as the code that uses it and runs it with encore run right away, with no Terraform module or console step for anyone to add first.
encore run starts every service along with the Postgres databases, Pub/Sub topics and buckets declared in code, and applies migrations.encore secret set.encore build docker builds an image you can run on infrastructure you manage.Encore is not an AWS API emulator, so code that calls DynamoDB, Step Functions or Cognito through the AWS SDK still needs an AWS account or one of the emulators below. Cron jobs do not run on their schedule locally, so you call the cron endpoint directly to test one. Adopting Encore means declaring infrastructure through its APIs, which is a bigger change than swapping an image, and it can start with one service while the rest keeps its current setup.
Run in your terminal to get started locally.
Yes, for most setups: Floci is an MIT-licensed AWS emulator built as a replacement for the LocalStack container. It runs without an account or auth token, serves every service on http://localhost:4566 and accepts any non-empty credentials, so the AWS SDKs, CLI, Terraform and CDK keep working against it.
Floci is the shortest path back to a working LocalStack setup without a token, since the port and SDK configuration stay the same and the image name changes. Check the operations your code calls against its service list. The Terraform or scripts that create the local resources are still a second definition you maintain next to production.
Use it when you want the emulator AWS maintains: AWS Emulator is a local emulator of the AWS APIs that needs no AWS account. On Linux it installs from an RPM or Debian package and runs as a command-line tool. On macOS and Windows you build a Docker image from the Dockerfile in the docs, since AWS does not publish a prebuilt one.
By default it expects SigV4-signed requests over HTTPS with credentials it generates per run, which is closer to AWS than emulators that accept any key. The limitations are explicit: it does not evaluate IAM policies the way AWS does, it keeps every resource in memory and drops them when it stops, it treats all requests as one account and region, and it is meant for test runs, not a long-running environment. AWS publishes per-service fidelity scores with each release, and control-plane calls match AWS most closely today.
fakecloud is an AGPL-3.0 AWS emulator that runs as a single binary or a Docker image. Next to the AWS APIs it ships test SDKs that let a test reset state and inspect side effects such as SES emails, SNS messages or Lambda invocations.
fakecloud fits integration tests that need to assert on what AWS did, not only call it. Its coverage and conformance numbers are self-reported, so verify the services you depend on, and check the AGPL-3.0 license against your company's policy.
MotoYes, for unit and integration tests: Moto mocks AWS for Python, usually through its @mock_aws decorator inside pytest, and it has a standalone server mode that any AWS SDK can call.
# moto 5.2.5
import boto3
from moto import mock_aws
@mock_aws
def test_upload_receipt():
s3 = boto3.client("s3", region_name="us-east-1")
s3.create_bucket(Bucket="receipts")
s3.put_object(Bucket="receipts", Key="r1.pdf", Body=b"...")
assert s3.list_objects_v2(Bucket="receipts")["KeyCount"] == 1
Resources exist only for the duration of a test, and event delivery between services is limited, so Moto is a poor fit for a long-running environment that a whole team develops against.
Use it when the thing you would emulate is open source software. Testcontainers starts throwaway Docker containers from test code in Java, Go, Node.js, Python, Rust, .NET and other languages, so instead of emulating RDS or ElastiCache you test against a real Postgres or Redis.
from testcontainers.postgres import PostgresContainer
def test_orders_repository():
with PostgresContainer("postgres:17") as pg:
url = pg.get_connection_url()
# run migrations and queries against a real Postgres at `url`
Testcontainers only covers services that have a container image, so AWS-specific APIs still need an emulator. It is built for tests, not for a development environment that stays up all day.
For the Lambda part, yes: the AWS SAM CLI runs Lambda functions and API Gateway endpoints locally in containers that match the Lambda runtime, using your SAM template.
SAM covers the compute side and does not emulate the databases, queues or buckets a function talks to, so teams pair it with a dev account or an emulator. It only targets AWS and depends on SAM or CloudFormation templates.
If DynamoDB is the only AWS API your code calls, DynamoDB Local is the official downloadable version of DynamoDB and is simpler than a full emulator. The trade-off is one tool per service: the queue, the bucket and the database each need their own local stand-in, which is the sprawl that pushed teams toward LocalStack in the first place.
An emulator is the right tool when your code calls AWS-specific APIs. When the app mainly needs a working database, queue and bucket on a laptop and the same resources in AWS, Encore ranks first, because it removes the emulator and the Terraform behind it instead of replacing them. The quick start shows what encore run starts locally.
For a backend that mostly needs Postgres, queues and object storage, Encore: the code declares those resources, encore run starts local versions of them, and a deploy creates the matching services in your own AWS or GCP account, so there is no emulator to configure. If your code calls AWS APIs directly, use Floci as a drop-in for the LocalStack container or AWS Emulator, the emulator AWS publishes itself. Use Moto for Python tests, the SAM CLI for Lambda and Testcontainers for real Postgres or Redis in tests.
No. As of March 2026, LocalStack for AWS ships as one image that asks for an account and an auth token, including in CI. Older Community image tags, such as 4.12, can still be pinned, but they get no new AWS coverage, fixes or security updates.
Yes. AWS Emulator is a local emulator of the AWS APIs that AWS publishes and documents itself. It runs as a command-line tool on Linux or in a Docker image you build on macOS and Windows, needs no AWS account, keeps resources in memory and does not evaluate IAM policies the way AWS does.
Yes. For most setups, Floci serves the AWS APIs on localhost:4566, accepts any non-empty credentials and works with the standard AWS SDKs, CLI, Terraform and CDK, so the usual change is the image name in docker-compose.yml. Check the operations your code calls against its service list.
No. If your app mostly needs Postgres, queues and object storage, running local versions of those resources is simpler and closer to production than emulating AWS. You need an emulator when your code calls AWS-specific APIs such as DynamoDB, Step Functions or Cognito directly.
Deploy to your cloud on AWS and Google Cloud without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.