The Problem

LocalStack moved core services behind a paid plan, breaking teams that relied on it for local development and CI/CD. MiniStack is a free, MIT-licensed alternative that emulates 40+ AWS services on a single port (4566) with real databases and Terraform compatibility.

What This Does

MiniStack is a Python-based AWS emulator (130 Python files) with a Flask-style HTTP server in ministack/app.py. It implements service handlers across ministack/services/ — S3, EC2, Lambda, Cognito, RDS, CloudFormation, and others. The core/ directory holds shared infrastructure: responses.py, persistence.py, and router.py.

Real infrastructure support is notable: RDS spins up actual Postgres/MySQL containers, ElastiCache runs Redis, Athena uses DuckDB, and ECS/Lambda execute real Docker containers. Testcontainers bindings exist for Go, Java, and Python in the Testcontainers/ directory. The README claims ~270MB image and ~21MB RAM idle, versus LocalStack's ~1GB image.

How It Is Wired

Execution starts in ministack/app.py — app (line 1026) reaches 426 functions, _handler (line 126) reaches 402. The shortest paths to effects: _handler -> handle_request reaches crypto via os.urandom; main -> _cleanup touches the filesystem. Network calls leave via client.get from handle_oauth2_authorize in Cognito.

The critical hub is ministack/core/responses.py — 65 modules import it, and its json_response is called from 520 places, error_response_json from 409. Change that file and you change the entire system. persistence.py (46 importers) and services/__init__.py (21 importers) are similar blast radii.

The lambda_svc.py file (124 functions, 3,559 lines) is the most complex — it makes outbound network calls, runs external commands, and participates in an import cycle with core/lambda_runtime.py and cloudformation/__init__.py. The cycle means changes ripple unpredictably.

How To Use It

# Option 1: PyPI
pip install ministack
ministack

# Option 2: Docker
docker run -p 4566:4566 ministackorg/ministack

# Option 3: Clone and build
git clone https://github.com/moses-y/ministack
cd ministack
docker compose up -d

# Verify
curl http://localhost:4566/_ministack/health

Configuration is runtime-based via POST /_ministack/config (e.g., {"lambda_svc.LAMBDA_EXECUTOR": "docker"}). State resets via POST /_ministack/reset. The Makefile and pyproject.toml suggest standard Python tooling.

Real-World Use

For CI pipelines that need AWS integration tests without cloud costs: run MiniStack in a Docker container, point AWS_ENDPOINT_URL=http://localhost:4566 at it, and execute Terraform plans or boto3 tests against it. The internal reset endpoint lets you wipe state between test runs — something real AWS can't do.

Code Health & Issues

Static analysis found 187 findings (63 high, 124 medium). Key issues:

  • Critical — golang.org/x/crypto@0.45.0 carries CVE-2026-42508 (critical); the pinned version is exactly what installs. Upgrade and commit the lockfile.
  • Critical — .github/workflows/docker-publish-on-pr.yml checks out PR code in a privileged workflow with DOCKERHUB_TOKEN exposed. This is the most reliably exploited Actions pattern.
  • Critical — Same workflow exposes publish-scoped Docker Hub credentials to fork-triggered jobs.
  • High — Third-party Actions pinned to tags (@v4, @v6) instead of commit SHAs; tags can be moved (the tj-actions pattern).
  • High — docker-compose.yml mounts the Docker socket with privileged mode and host networking.
  • High — ministack/app.py sets Access-Control-Allow-Origin: "*", enabling cross-site authenticated requests.
  • High — No lockfile for pyproject.toml; transitive dependencies can drift.
  • High — containerd@1.7.29 and docker/docker@27.1.1 carry published advisories.
  • Medium — No Dependabot/Renovate configured; no permissions: declarations in CI workflows.

Deep nesting (depth 6) and oversized files (3,559 lines in lambda_svc.py) make the code hard to follow. The import cycle compounds this.

The Bottom Line

A genuinely useful LocalStack alternative with real infrastructure support and a small footprint. The architecture is sound but the security posture needs immediate attention — fix the workflow privileges and pinned dependencies before adopting it in production CI. Best suited for teams that want free local AWS emulation and can tolerate the maintenance overhead of a young project.