October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

How to Configure LocalStack Services, Persistence, and Test Data

Learn how to select LocalStack services, preserve or reset emulator state, choose snapshot behavior, and provision project-owned test fixtures.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure LocalStack by enabling only the AWS-like services your project needs, deciding whether emulator state should survive restarts, and provisioning test fixtures with initialization hooks. For example, SERVICES=s3,sqs PERSISTENCE=1 localstack start starts with S3 and SQS enabled and persistence on. The right setup depends on whether each run should begin with fresh test data or resume a previous working state.

Choose which LocalStack services to enable

Set SERVICES to a comma-delimited list of service names, such as s3,sqs. When the variable is set, LocalStack loads only the listed services; other services are disabled and cannot be used. See the LocalStack configuration reference for supported configuration and service names.

Start with the services the application or test suite actually uses. This keeps the local environment aligned with the test’s dependencies instead of assuming every service is available. To check service names and current status, consult /_localstack/health.

Decide whether LocalStack state should persist

LocalStack state is ephemeral by default: it resets when the emulator shuts down or exits unexpectedly. Enable snapshots with PERSISTENCE=1, or use the documented --persist option. Persistent state is stored beneath the LocalStack volume directory, rooted inside the container at /var/lib/localstack. Mount or otherwise retain that directory if it must survive container replacement. See the persistence documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Persistence is useful for resuming a development environment, but it is not the same as a clean test fixture. A resumed snapshot can contain resources from earlier runs. If tests need deterministic starting data, decide how the environment is reset and seeded rather than relying on persistence alone.

Choose when snapshots are saved and loaded

LocalStack offers snapshot strategies that trade routine overhead against how much recent state might be lost and when restore work occurs. The documented save default is SCHEDULED, which flushes every 15 seconds by default. The documented load default is ON_REQUEST. Exact behavior and configuration options are described in the persistence reference.

Snapshot action Strategy Practical effect
Save ON_REQUEST Can add latency or block state-changing requests while state is saved.
Save ON_SHUTDOWN Low routine overhead, but recent state can be lost if shutdown does not complete.
Save SCHEDULED Automatically flushes on a schedule; default interval is 15 seconds.
Save MANUAL Snapshot timing is explicitly controlled through state endpoints.
Load ON_REQUEST Loads state as requests require it; errors may appear as services are accessed.
Load ON_STARTUP Loads state during startup, so restoration work happens before normal use.
Load MANUAL Loading is explicitly controlled through state endpoints.

Pick a save strategy based on the cost of losing the newest changes versus the interruption or work caused by saving. Pick a load strategy based on whether startup work or later, request-triggered restore is more suitable. Do not treat the 15-second schedule as a guarantee that all changes are durably saved at every moment.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Seed test data with initialization hooks

LocalStack provides initialization hooks under /etc/localstack/init, with hook directories for boot, start, ready, and shutdown. Mount project-owned scripts into the hook directory appropriate to when provisioning should run. A ready hook is a practical place for provisioning once services are ready to accept setup requests.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Keep fixtures with the project. Store setup scripts and fixture data alongside the application or test configuration so changes can be reviewed and versioned with the code.
  2. Mount the script into an init hook. For example, mount a ready hook under /etc/localstack/init/ready.d/.
  3. Provision the resources the application needs. Make the script create the required test resources and be safe to run as part of the intended startup workflow.
  4. Choose fresh or resumed state deliberately. If each test run requires known fixtures, define how prior state is cleared or replaced. If developers want to resume a working environment, enable persistence and account for older resources.

LocalStack’s migration example illustrates the configuration shape: it mounts a ready hook, sets SERVICES=s3,sqs and PERSISTENCE=1, then starts with lstk start. It is an example of wiring a hook and settings, not a complete S3 or SQS fixture; the project must provide its own provisioning commands and data.

Know the limits of snapshots

Persistence support and test coverage vary by service. Dynamic ports used by services such as RDS or ElastiCache may not be preserved on restore, which can leave restored resources pointing to invalid or unintended ports. The documentation suggests restoring services in their original deployment order, but notes that this is not always reliable.

Snapshots may also be incompatible across LocalStack versions. Treat snapshots as environment state rather than portable, version-independent test fixtures, and validate the relevant service and version combination when relying on restore behavior.

Use export and import for file-based state workflows

Automatic persistence is intended to pause and resume emulator state. LocalStack also documents state export and import commands for file-based workflows; those commands are marked preview, and importing state created by another version may fail. Consult the current persistence documentation before adopting them for a repeatable workflow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.