---
id: installation
title: Installation
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

driftctl is available on Linux, macOS and Windows.

Binaries are available in the [release page](https://github.com/snyk/driftctl/releases).

<Tabs
  defaultValue="manual"
  values={[
    { label: "Manual", value: "manual" },
    { label: "Docker", value: "docker" },
    { label: "Homebrew", value: "homebrew" },
    { label: "Macports", value: "macports" },
  ]}
>
  <TabItem value="manual">

<Tabs
  defaultValue="linux-macos"
  values={[
    { label: "Linux / macOS", value: "linux-macos" },
    { label: "Windows", value: "windows" },
  ]}
>
  <TabItem value="linux-macos">

This is an example using `curl`. If you don't have `curl`, install it, or use `wget`.

```shell
# Linux
# x64
$ curl -L https://github.com/snyk/driftctl/releases/latest/download/driftctl_linux_amd64 -o driftctl

# x86
$ curl -L https://github.com/snyk/driftctl/releases/latest/download/driftctl_linux_386 -o driftctl

# macOS
$ curl -L https://github.com/snyk/driftctl/releases/latest/download/driftctl_darwin_amd64 -o driftctl
```

Make the binary executable:

```shell
$ chmod +x driftctl
```

Optionally install driftctl to a central location in your `PATH`:

```shell
# use any path that suits you, this is just a standard example. Install sudo if needed.
$ sudo mv driftctl /usr/local/bin/
```

## Verify checksum

```shell
# Download binary and checksums
$ curl -L https://github.com/snyk/driftctl/releases/latest/download/driftctl_linux_amd64 -o driftctl_linux_amd64
$ curl -L https://github.com/snyk/driftctl/releases/latest/download/driftctl_SHA256SUMS -o driftctl_SHA256SUMS

# Verify checksum
$ sha256sum --ignore-missing -c driftctl_SHA256SUMS
driftctl_linux_amd64: OK
```

 </TabItem>
  <TabItem value="windows">

```shell
# x64
$ curl https://github.com/snyk/driftctl/releases/latest/download/driftctl_windows_amd64.exe -o driftctl.exe
# x86
$ curl https://github.com/snyk/driftctl/releases/latest/download/driftctl_windows_386.exe -o driftctl.exe
```

  </TabItem>
</Tabs>

  </TabItem>
  <TabItem value="docker">

You can use also our official Docker image from the terminal.

```shell
$ docker run -t --rm \
  -v ~/.aws:/root/.aws:ro \
  -v $(pwd):/app:ro \
  -v ~/.driftctl:/root/.driftctl \
  -e AWS_PROFILE=non-default-profile \
  snyk/driftctl scan
```

`-v ~/.aws:/root/.aws:ro` (optionally) mounts your `~/.aws` containing AWS credentials and profile

`-v $(pwd):/app:ro` (optionally) mounts your working dir containing the terraform state

`-v ~/.driftctl:/root/.driftctl` (optionally) prevents driftctl to download the provider at each run

`-e AWS_PROFILE=your_profile` (optionally) exports the non-default AWS profile name to use

`snyk/driftctl:<VERSION_TAG>` run a specific driftctl tagged release

## Usage examples

```shell
# With a local state
$ docker run -t --rm \
  -v $(pwd):/app:ro \
  -v ~/.driftctl:/root/.driftctl \
  -e AWS_ACCESS_KEY_ID=XXXXXXXX \
  -e AWS_SECRET_ACCESS_KEY=XXXX \
  snyk/driftctl scan

# With state stored on a s3 backend
$ docker run -t --rm \
  -v $(pwd):/app:ro \
  -v ~/.driftctl:/root/.driftctl \
  -e AWS_ACCESS_KEY_ID=XXXXXXXX \
  -e AWS_SECRET_ACCESS_KEY=XXXX \
  snyk/driftctl scan --from tfstate+s3://my-bucket/path/to/state.tfstate

# With multiple states
$ docker run -t --rm \
    -v $(pwd):/app:ro \
    -v ~/.driftctl:/root/.driftctl \
    -e AWS_ACCESS_KEY_ID=XXXXXXXX \
    -e AWS_SECRET_ACCESS_KEY=XXXX \
    snyk/driftctl scan --from tfstate://terraform_S3.tfstate --from tfstate://terraform_VPC.tfstate

# Using a named profile
$ docker run -t --rm \
    -v ~/.aws:/root/.aws:ro \ # mount your aws config folder
    -v $(pwd):/app:ro \
    -v ~/.driftctl:/root/.driftctl \
    -e AWS_PROFILE=your-profile \
    snyk/driftctl scan
```

  </TabItem>
  <TabItem value="homebrew">

Homebrew is a free and open-source package management system for Mac OS X. Install the official driftctl formula from the terminal.

```shell
$ brew install driftctl
```

  </TabItem>
  <TabItem value="macports">

MacPorts is an easy to use system for compiling, installing, and managing open source software. Install the community port from the terminal.

```shell
$ sudo port install driftctl
```

  </TabItem>
</Tabs>
