Skip to content

Installation

You can use the Snowflake Docker image to run the Snowflake emulator. The Snowflake Docker image is available on the LocalStack Docker Hub. To pull the Snowflake Docker image, execute the following command:

Terminal window
docker pull localstack/snowflake

You can start the Snowflake Docker container using the following methods:

  1. localstack CLI
  2. docker CLI
  3. Docker Compose

To start the Snowflake Docker container using the localstack CLI, execute the following command:

Terminal window
export LOCALSTACK_AUTH_TOKEN=<your_auth_token>
localstack start --stack snowflake

To start the Snowflake Docker container using the docker CLI, execute the following command:

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:?} \
localstack/snowflake

Create a docker-compose.yml file with the specified content:

version: "3.8"
services:
localstack:
container_name: "localstack-snowflake"
image: localstack/snowflake
ports:
- "127.0.0.1:4566:4566"
- "127.0.0.1:4510-4559:4510-4559"
- "127.0.0.1:443:443"
environment:
- LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?}
volumes:
- "./volume:/var/lib/localstack"

Start the Snowflake Docker container with the following command:

Terminal window
docker-compose up

To update the Snowflake Docker container, pull the latest image and restart the container. The latest tag is the nightly build of the Snowflake Docker image.

How to check if the Snowflake emulator is running?

Section titled “How to check if the Snowflake emulator is running?”

You can check if the Snowflake emulator is running by executing the following command:

Terminal window
curl -d '{}' snowflake.localhost.localstack.cloud:4566/session

The response should be:

Terminal window
{"success": true}

You can set the SF_LOG=trace environment variable in the Snowflake container to enable detailed trace logs that show all the request/response message.

When using docker-compose then simply add this variable to the environment section of the YAML configuration file. If you’re starting up via the localstack start CLI, then make sure to start up via the following configuration:

Terminal window
DOCKER_FLAGS='-e SF_LOG=trace' DEBUG=1 localstack start --stack snowflake

The snowflake.localhost.localstack.cloud hostname doesn’t resolve on my machine, what can I do?

Section titled “The snowflake.localhost.localstack.cloud hostname doesn’t resolve on my machine, what can I do?”

On some systems, including some newer versions of MacOS, the domain name snowflake.localhost.localstack.cloud may not resolve properly. If you are encountering network issues and your Snowflake client drivers are unable to connect to the emulator, you may need to manually add the following entry to your /etc/hosts file:

Terminal window
127.0.0.1 snowflake.localhost.localstack.cloud

Now that the Snowflake emulator is installed, you can use it for developing and testing your Snowflake data pipelines. Refer to our Quickstart guide to get started.