Skip to content
Get Started for Free

Deprecated LocalStack CLI

The LocalStack Command Line Interface (CLI) is the original Python tool for starting, managing, and configuring the LocalStack container. It works with the Azure emulator, as long as you point it at the Azure image.

Terminal window
pip install localstack
localstack --version

Recent versions of the CLI print a deprecation warning before each command and then continue with it.

For the other installation options, such as pre-built binaries, see Installation in the AWS docs.

The CLI starts the AWS emulator image unless you tell it otherwise, so set IMAGE_NAME to the Azure image. Export it rather than setting it for a single command, so that every localstack command in your shell session uses the same image:

Terminal window
export LOCALSTACK_AUTH_TOKEN="<your-auth-token>"
export IMAGE_NAME=localstack/localstack-azure:latest
localstack start -d
localstack wait -t 120

The CLI runs the emulator in a container named localstack-main. Confirm that it is up and licensed:

Terminal window
curl -s http://localhost:4566/_localstack/health
Output
{"edition": "azure-alpha", "license": true}

"edition": "azure-alpha" confirms that you are talking to the Azure emulator.

The CLI forwards the LocalStack configuration variables it knows from your shell to the container. These are the ones that matter for Azure:

Variable Value Why
IMAGE_NAME localstack/localstack-azure:latest Selects the Azure image. Required, because the CLI defaults to the AWS image.
LOCALSTACK_AUTH_TOKEN Your auth token Required. The emulator doesn’t start without a valid license.
MSSQL_ACCEPT_EULA Y Accepts the Microsoft SQL Server EULA, which Azure SQL Database needs.
LS_AZURE_PORTAL 1 Enables the Azure Portal Emulator.
DEBUG / LS_LOG 1 / debug Turns on verbose emulator logs.

You can also pass a variable to the container with -e:

Terminal window
localstack start -d -e LS_AZURE_PORTAL=1
Terminal window
localstack status # show the container status
localstack logs # print the emulator logs, add -f to follow them
localstack restart # restart LocalStack inside the running container, keeping your resources
localstack stop # stop and remove the container

Run localstack --help for the full list of commands and flags.

Was this page helpful?