Skip to content
Get Started for Free

Saving snapshots locally

With Snapshots, you can save the state of your LocalStack instance to a file on disk, then load it back at a later time. This concept is similar to that of desktop-based word processors, spreadsheets, or practically any software that allows saving and loading the program state.

Loading a snapshot is significantly faster, and far more convenient, than re-creating the same state with infrastructure-as-code tools such as Terraform or CDK, or re-running deployment scripts by hand. Additionally, the dynamic state of those resources (such as database content) is automatically captured, avoiding the need for data-seeding scripts to populate them.

The lstk CLI lets you save your instance’s state to a local file and load it back into another instance at a later time.

For example, starting from an empty emulator instance, create an S3 bucket, an SNS topic, and an SQS queue:

Terminal window
lstk start
lstk aws s3 mb s3://bucket1
lstk aws sns create-topic --name topic1
lstk aws sqs create-queue --queue-name queue-1

The lstk status command confirms that the three resources are deployed:

Terminal window
lstk status
Output
✔︎ LocalStack AWS Emulator is running
Endpoint: localhost.localstack.cloud:4566
Container: localstack-aws-dev
Version: 2026.8.0
Uptime: 17s
~ 3 resources · 3 services
SERVICE RESOURCE REGION ACCOUNT
S3 bucket1 global 000000000000
SNS topic1 us-east-1 000000000000
SQS http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/queue-1 us-east-1 000000000000

To save the state to a local file, run:

Terminal window
lstk snapshot save my-snapshot
Output
✔︎ Snapshot saved to ./my-snapshot.snapshot
Services: sns, sqs, s3
Size: 85.4 KB

The destination argument is optional. If you omit it, lstk auto-generates a timestamped snapshot file in the current directory:

Terminal window
lstk snapshot save
Output
✔︎ Snapshot saved to ./snapshot-2026-08-04T20-16-49-5e3.snapshot
Services: sns, sqs, s3
Size: 85.4 KB

Since saving is a common operation, the lstk save abbreviation is also available:

Terminal window
lstk save
Output
✔︎ Snapshot saved to ./snapshot-2026-08-04T20-16-49-db4.snapshot
Services: sns, sqs, s3
Size: 85.4 KB

Restarting the emulator discards all of its state, so lstk status now reports that no resources are deployed:

Terminal window
lstk restart
lstk status
Output
✔︎ LocalStack AWS Emulator is running
Endpoint: localhost.localstack.cloud:4566
Container: localstack-aws-dev
Version: 2026.8.0
Uptime: 5s
> Note: No resources deployed

To load a previously saved snapshot, run:

Terminal window
lstk snapshot load my-snapshot
Output
✔︎ Snapshot loaded from ./my-snapshot.snapshot

Alternatively, the lstk load command is also available:

Terminal window
lstk load my-snapshot
Output
✔︎ Snapshot loaded from ./my-snapshot.snapshot

Running lstk status once more confirms that the bucket, topic, and queue have returned:

Terminal window
lstk status
Output
✔︎ LocalStack AWS Emulator is running
Endpoint: localhost.localstack.cloud:4566
Container: localstack-aws-dev
Version: 2026.8.0
Uptime: 6s
~ 3 resources · 3 services
SERVICE RESOURCE REGION ACCOUNT
S3 bucket1 global 000000000000
SNS topic1 us-east-1 000000000000
SQS http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/queue-1 us-east-1 000000000000

The LocalStack Console allows saving a snapshot to a file, then loading it into another LocalStack instance.

LocalStack Export/Import State Local Mode

To save the snapshot, follow these steps:

  1. Create AWS resources locally as needed.
  2. Navigate to the Local tab within the Export/Import State page.
  3. Click on the Export State button. This action will initiate the download of a ZIP file.

The downloaded ZIP file contains your container state, which can be injected into another LocalStack instance for further use.

To load an existing snapshot, follow these steps:

  1. Navigate to the Local tab within the Export/Import State page.
  2. Upload the ZIP file that contains your container state. This action will restore your previously saved AWS resources.

To confirm the successful injection of the container state, visit the respective Resource Browser for the services and verify the resources.

Was this page helpful?