# Installation

Depending on your platform, there are different methods available to install `sentry-cli`.

## [Manual Download](https://docs.sentry.io/.md#manual-download)

You can find the list of releases on [the GitHub release page](https://github.com/getsentry/sentry-cli/releases.md). We provide executables for Linux, OS X and Windows. It’s a single file download and upon receiving the file you can rename it to just `sentry-cli` or `sentry-cli.exe` to use it.

## [Automatic Installation](https://docs.sentry.io/.md#automatic-installation)

If you are on macOS or Linux, you can use the automated downloader which will fetch the latest release version for you and install it:

```bash
curl -sL https://sentry.io/get-cli/ | sh
```

We do however, encourage you to pin the specific version of the CLI, so your builds are always reproducible. To do that, you can use the exact same method, with an additional version specifier:

```bash
curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION="2.47.0" sh
```

This will automatically download the correct version of `sentry-cli` for your operating system and install it. If necessary, it will prompt for your admin password for `sudo`. For a different installation location or for systems without `sudo` (like Windows), you can `export INSTALL_DIR=/custom/installation/path` before running this command.

To verify it's installed correctly you can bring up the help:

```bash
sentry-cli --help
```

## [Installation via NPM](https://docs.sentry.io/.md#installation-via-npm)

There is also the option to install `sentry-cli` via npm for specialized use cases. This, for instance, is useful for build servers. The package is called `@sentry/cli` and in the post installation it will download the appropriate release binary:

```bash
npm install @sentry/cli
```

You can then find it in the `.bin` folder:

```bash
./node_modules/.bin/sentry-cli --help
```

In case you want to install this with npm system wide with sudo you will need to pass `--unsafe-perm` to it:

```bash
sudo npm install -g @sentry/cli --unsafe-perm
```

This installation is not recommended however.

### [Downloading From a Custom Source](https://docs.sentry.io/.md#downloading-from-a-custom-source)

By default, this package will download sentry-cli from the CDN managed by [Fastly](https://www.fastly.com/.md). To use a custom CDN, set the npm config property `sentrycli_cdnurl`. The downloader will append `"/<version>/sentry-cli-<dist>"`.

```bash
npm install @sentry/cli --sentrycli_cdnurl=https://mymirror.local/path
```

Or add property into your `.npmrc` file ([https://docs.npmjs.com/files/npmrc](https://docs.npmjs.com/files/npmrc.md))

```bash
sentrycli_cdnurl=https://mymirror.local/path
```

Another option is to use the environment variable `SENTRYCLI_CDNURL`.

```bash
SENTRYCLI_CDNURL=https://mymirror.local/path npm install @sentry/cli
```

### [Available Installation Options](https://docs.sentry.io/.md#available-installation-options)

Options listed below control how `sentry-cli` install script behaves, when installed through `npm`.

`SENTRYCLI_CDNURL`:

If set, the script will use given URL for fetching the binary. Defaults to `https://downloads.sentry-cdn.com/sentry-cli`.

`SENTRYCLI_USE_LOCAL`:

If set to `1`, `sentry-cli` binary will be discovered from your `$PATH` and copied locally instead of being downloaded from external servers. It will still verify the version number, which has to match.

`SENTRYCLI_SKIP_DOWNLOAD`:

If set to `1`, the script will skip downloading the binary completely.

`SENTRYCLI_SKIP_CHECKSUM_VALIDATION`:

If set to `1`, the script will skip the checksum validation phase. You can manually verify the checksums by visiting [Build Checksums](https://docs.sentry.io/cli/installation.md#build-checksums) page.

`SENTRYCLI_NO_PROGRESS_BAR`:

If set to `1`, the script will not display download progress bars. This is a default behavior for CI environments.

`SENTRYCLI_LOG_STREAM`:

If set, the script will change where it writes its output. Possible values are `stdout` and `stderr`. Defaults to `stdout`.

## [Installation via Homebrew](https://docs.sentry.io/.md#installation-via-homebrew)

If you are on OS X, you can install `sentry-cli` via homebrew:

```bash
brew install getsentry/tools/sentry-cli
```

## [Installation via Scoop](https://docs.sentry.io/.md#installation-via-scoop)

If you are on Windows, you can install `sentry-cli` via [Scoop](https://scoop.sh/.md):

```powershell
> scoop install sentry-cli
```

## [Docker Image](https://docs.sentry.io/.md#docker-image)

For unsupported distributions and CI systems, we offer a Docker image that comes with `sentry-cli` preinstalled. It is recommended to use the `latest` tag, but you can also pin to a specific version. By default, the command runs inside the `/work` directory. Mount relevant project folders and build outputs there to allow `sentry-cli` to scan for resources:

```bash
docker pull getsentry/sentry-cli
docker run --rm -v $(pwd):/work getsentry/sentry-cli --help
```

## [Updating and Uninstalling](https://docs.sentry.io/.md#updating-and-uninstalling)

You can use `sentry-cli update` and `sentry-cli uninstall` to update or uninstall the `sentry-cli` binary. These commands may be unavailable in certain situations, generally when `sentry-cli` has been installed by a tool like homebrew or yarn, either directly or as a dependency of another package. In those cases, the same tool will need to be used for updating and removal. If you find that `sentry-cli update` and `sentry-cli uninstall` aren't working and you don't know how the package was installed, running `which sentry-cli` will often provide a clue as to which tool to use.

## [Build Checksums](https://docs.sentry.io/.md#build-checksums)

When downloading an executable from a remote server, it's often a good practice to verify, that what has been downloaded, is in fact what we expect it to be. To make sure that this is the case, we can use checksum validation. A checksum is the value calculated from the contents of a file, in a form of hash, in our case SHA256, and it acts as the data integrity check, as it's always producing the same output, for a given input.

Below is the table of SHA256 checksums for all available build targets that our CLI supports. To calculate the hash of a downloaded file, you can use `sha256sum` utility, which is preinstalled in OSX and most Linux distributions.

| Filename (v<!-- -->2.47.0<!-- -->)                                                                        | Integrity Checksum                                                        |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| sentry-cli-Darwin-arm64                                                                                   | `sha384-a7f9304278c893fb6c39f0a60bdefdb03902d355d78d978f4a5b7def264fcd9b` |
| sentry-cli-Darwin-universal                                                                               | `sha384-0cee2628fc3835e7238b6a249a59de11391dd2b6bce21eee35254e23947e7aba` |
| sentry-cli-Darwin-x86\_64                                                                                 | `sha384-bcf56037d5a8da58aaead346f26e9ca36cb1b05efb170f44cefdab83cc90bdef` |
| sentry-cli-Linux-aarch64                                                                                  | `sha384-6e06fc74b6449a3cdf3cbffaf4347ae2dd768efff04fa43a306d9ccea4ede54c` |
| sentry-cli-Linux-armv7                                                                                    | `sha384-e1d751963403568bd2cd1de3064bf72522ab782d0e6b67153655bf9ca6459ff9` |
| sentry-cli-Linux-i686                                                                                     | `sha384-fe55d031baf9d182338a0f40a443018cde535371a01a02c0eef60487ec03010a` |
| sentry-cli-Linux-x86\_64                                                                                  | `sha384-d51a6bc0fa076dcd3d4121b9c3f21999057a1727cbc4113f07e0acf8f17afe48` |
| sentry-cli-Windows-aarch64.exe                                                                            | `sha384-6556975813e39d0dc063d589c5152b57233e6aedafdf4d36e4293a3c70a2cc2d` |
| sentry-cli-Windows-i686.exe                                                                               | `sha384-dc0df7dd659ba4c31eda0beb8c05b3f7106dd90b0f7eb5354533de4d20b042ee` |
| sentry-cli-Windows-x86\_64.exe                                                                            | `sha384-4b117ad6871af32963a41f3cb3f1fa15674f2c03ca2ce89fe918cde4bfe2a979` |
| sentry\_cli-2.47.0-py3-none-macosx\_10\_15\_x86\_64.whl                                                   | `sha384-fe4cf247e32259e2ebf28b1b551c8c7a658f1974068ac34e73cae9204d098861` |
| sentry\_cli-2.47.0-py3-none-macosx\_11\_0\_arm64.whl                                                      | `sha384-233d8498f4557dd209eb7118ceae4a451c296f9892ede8a6b5397dcfa2fb17e7` |
| sentry\_cli-2.47.0-py3-none-macosx\_11\_0\_universal2.whl                                                 | `sha384-c933049147179e2605ac298648b88d97479d4c2990f0ee8845fd29acb7f9ef87` |
| sentry\_cli-2.47.0-py3-none-manylinux\_2\_17\_aarch64.manylinux2014\_aarch64.musllinux\_1\_2\_aarch64.whl | `sha384-e7bbd1826b0a8f2916facd5439717ce32c398e178e69b891ec78fc41f4d2ec04` |
| sentry\_cli-2.47.0-py3-none-manylinux\_2\_17\_armv7l.manylinux2014\_armv7l.musllinux\_1\_2\_armv7l.whl    | `sha384-c1caff5aa00bf4756b860efb2a414f833934892e418e093500d43e8ffab1a8aa` |
| sentry\_cli-2.47.0-py3-none-manylinux\_2\_17\_i686.manylinux2014\_i686.musllinux\_1\_2\_i686.whl          | `sha384-d0e32b6ace21a0e7a00dc186ee34eb5bf524dbf3749379e6b67e7e98630d0fa6` |
| sentry\_cli-2.47.0-py3-none-manylinux\_2\_17\_x86\_64.manylinux2014\_x86\_64.musllinux\_1\_2\_x86\_64.whl | `sha384-2263d90ca3e75e4f75df1f3ebb8cef34b45b89c54ae20b00a7d0fcb1222d90e7` |
| sentry\_cli-2.47.0-py3-none-win32.whl                                                                     | `sha384-a7b8e513caaf899d431f47940a0ef42ccca8a5b6cde73d5f91e64d0ec1476104` |
| sentry\_cli-2.47.0-py3-none-win\_amd64.whl                                                                | `sha384-bcfcaa0fd34d6c7b5e10d27fea9643c2198fdb184b1cb7cd30b2d2454a75dc12` |
| sentry\_cli-2.47.0-py3-none-win\_arm64.whl                                                                | `sha384-b55f7036b5dc7826da2e68a7626c47ae2a40e89f03a357960c35c75c0b9efd55` |
| sentry\_cli-2.47.0.tar.gz                                                                                 | `sha384-b8743177585c1db8527e7a40dc28fe342167f5ce375cfae6448a42c5c1d5adfc` |

If you would like to verify checksums for historic versions of the `sentry-cli`, please refer to our release registry directly, which can be found at [https://release-registry.services.sentry.io/apps/sentry-cli/{version}](https://release-registry.services.sentry.io/apps/sentry-cli/latest.md). For example, [https://release-registry.services.sentry.io/apps/sentry-cli/1.74.4](https://release-registry.services.sentry.io/apps/sentry-cli/1.74.4).
