Skip to content
Get Started for Free

Installation

LocalStack provides multiple installation paths depending on your development environment and requirements. We recommend a CLI-based installation for the most consistent local startup experience.

Use lstk to install, authenticate, and start LocalStack with minimal setup.

LocalStack for AWS features require an Auth Token to activate your running instance. lstk handles authentication through a browser-based login flow, while Docker and CI workflows can use LOCALSTACK_AUTH_TOKEN.

lstk is a lightweight CLI for LocalStack that manages the authentication and container lifecycle in a single workflow.

Requirement: You must have a working Docker installation before proceeding.

Terminal window
brew install localstack/tap/lstk
Terminal window
lstk start

The first execution initiates a browser-based login flow. Subsequent starts use credentials stored in your system keyring.

Terminal window
lstk update

For more details, see the lstk documentation.

Use these methods when you need explicit container configuration, want to run LocalStack alongside other services, or deploy LocalStack in CI and Kubernetes environments. For everyday local development, lstk is usually simpler.

Use Docker Compose when you want a reusable configuration file that can be shared across a team or checked into a project repository. Create a docker-compose.yml with the following configuration:

services:
localstack:
container_name: '${LOCALSTACK_DOCKER_NAME:-localstack-main}'
image: localstack/localstack
ports:
- '127.0.0.1:4566:4566' # LocalStack Gateway
- '127.0.0.1:4510-4559:4510-4559' # external services port range
- '127.0.0.1:443:443' # LocalStack HTTPS Gateway
environment:
# Activate LocalStack for AWS: https://docs.localstack.cloud/getting-started/auth-token/
- LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?} # required for Pro
# LocalStack configuration: https://docs.localstack.cloud/references/configuration/
- DEBUG=${DEBUG:-0}
- PERSISTENCE=${PERSISTENCE:-0}
volumes:
- '${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack'
- '/var/run/docker.sock:/var/run/docker.sock'

Execute docker compose up to start.

Use the Docker CLI for one-off starts or when you want to test a container configuration before moving it into Compose:

Terminal window
docker run \
--rm -it \
-p 127.0.0.1:4566:4566 \
-p 127.0.0.1:4510-4559:4510-4559 \
-p 127.0.0.1:443:443 \
-e LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?} \
-v /var/run/docker.sock:/var/run/docker.sock \
localstack/localstack

Deploy LocalStack to a Kubernetes cluster:

Terminal window
helm repo add localstack-repo https://helm.localstack.cloud
helm upgrade --install localstack localstack-repo/localstack

Manage local instances via a standalone desktop application. Download here.

Install the official extension to manage LocalStack directly from the Docker Desktop.

The LocalStack CLI installation is successful, but I cannot execute localstack

Section titled “The LocalStack CLI installation is successful, but I cannot execute localstack”

If you can successfully install LocalStack using pip but you cannot use it in your terminal, you most likely haven’t set up your operating system’s / terminal’s PATH variable (in order to tell them where to find programs installed via pip).

  • If you are using Windows, you can enable the PATH configuration when installing Python, as described in the official docs of Python.
  • If you are using a MacOS or Linux operating system, please make sure that the PATH is correctly set up - either system wide, or in your terminal.

As a workaround you can call the LocalStack CLI python module directly:

Terminal window
python3 -m localstack.cli.main

The localstack CLI does not start the LocalStack container

Section titled “The localstack CLI does not start the LocalStack container”

If you are using the localstack CLI to start LocalStack, but the container is not starting, please check the following:

  • Uncheck the Use kernel networking for UDP option in Docker Desktop (SettingsResourcesNetwork) or follow the steps in our documentation to disable it.
  • Start LocalStack with a specific DNS address:
Terminal window
DNS_ADDRESS=0 localstack start

How should I access the LocalStack logs on my local machine?

Section titled “How should I access the LocalStack logs on my local machine?”

You can now avail logging output and error reporting using LocalStack logs. To access the logs, run the following command:

Terminal window
lstk logs

AWS requests are now logged uniformly in the INFO log level (set by default or when DEBUG=0). The format is:

AWS <service>.<operation> => <http-status> (<error type>)

Requests to HTTP endpoints are logged in a similar way:

2022-09-12T10:39:21.165 INFO --- [ asgi_gw_0] localstack.request.aws : AWS s3.ListBuckets => 200
2022-09-12T10:39:41.315 INFO --- [ asgi_gw_0] localstack.request.aws : AWS s3.CreateBucket => 200
2022-09-12T10:40:04.662 INFO --- [ asgi_gw_0] localstack.request.aws : AWS s3.PutObject => 200
2022-09-12T11:01:55.799 INFO --- [ asgi_gw_0] localstack.request.http : GET / => 200

How should I share the LocalStack logs for troubleshooting?

Section titled “How should I share the LocalStack logs for troubleshooting?”

You can share the LocalStack logs with us to help us identify issues. To share the logs, call the diagnostic endpoint:

Terminal window
curl -s localhost:4566/_localstack/diagnose | gzip -cf > diagnose.json.gz

Ensure that the diagnostic endpoint is run after you have tried reproducing the affected task. After running the task, run the diagnostic endpoint and share the archive file with your team members or LocalStack Support.

My application cannot reach LocalStack over the network

Section titled “My application cannot reach LocalStack over the network”

We have extensive network troubleshooting documentation available here.

If this does not solve your problem then please reach out to LocalStack Support.

Now that you’ve completed installation, proceed to the Auth Token guide to activate LocalStack and prepare your environment for local development.

Was this page helpful?