Skip to content
Get Started for Free

CI/CD Setup

LocalStack works great in CI environments. The setup differs from local development in a few important ways:

  • Use a CI Auth Token, not your personal Developer token
  • Manage the container directly via Docker Compose or docker runlstk and the LocalStack Desktop are local-only tools
  • LocalStack is ephemeral by default — each CI run starts fresh, which is usually exactly what you want for reproducible tests

CI pipelines should use a dedicated CI Auth Token, not a Developer token tied to a specific user.

  1. Go to the Auth Tokens page in the LocalStack Web Application
  2. Create a new CI Auth Token
  3. Add it as a secret in your CI provider (e.g., LOCALSTACK_AUTH_TOKEN)

See the Auth Token documentation for full details on token types and configuration.

The recommended approach is to start LocalStack as a service container or as a step using the official GitHub Action:

.github/workflows/integration-tests.yml
name: Integration Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start LocalStack
uses: LocalStack/setup-localstack@v0.2
with:
image-tag: latest
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
- name: Run tests
run: |
# Your test commands here, e.g.:
pip install awscli-local
awslocal s3 mb s3://my-test-bucket
pytest tests/integration/

The setup-localstack action handles pulling the image, starting the container, and waiting for LocalStack to be ready.

After LocalStack starts, confirm the license is active:

Terminal window
curl -s http://localhost:4566/_localstack/info | jq '.is_license_activated'
# Should return: true
Local developmentCI/CD
CLIlstk or LocalStack CLIDocker Compose / docker run
AuthBrowser login or stored tokenLOCALSTACK_AUTH_TOKEN env var
Token typeDeveloper tokenCI token
StateOptional persistenceEphemeral (fresh per run)
StartupInteractive TUI--non-interactive / -d flag

By default, LocalStack starts fresh on every run — all resources are gone when the container stops. This is ideal for most CI use cases (clean, reproducible tests).

If you need to share state across runs (e.g., seed data, pre-built infrastructure), look at Cloud Pods, which let you snapshot and restore LocalStack state.

LocalStack has dedicated integration guides for many CI providers:

See the full CI/CD integrations section for details.

Was this page helpful?