# Quickstart guide

{% hint style="warning" %}
This product is in Beta stage and breaking changes may be released. The documentation here matches the release version listed in the table of contents.&#x20;
{% endhint %}

## Step 1: Install the SonarQube CLI

Depending on your operating system, run these commands in your terminal:

macOS and Linux:

```shell
curl -o- https://raw.githubusercontent.com/SonarSource/sonarqube-cli/refs/heads/master/user-scripts/install.sh | bash
```

Windows (from PowerShell):

```powershell
irm https://raw.githubusercontent.com/SonarSource/sonarqube-cli/refs/heads/master/user-scripts/install.ps1 | iex
```

## Step 2: Authenticate with the server

Create a user token in SonarQube Server or SonarQube Cloud.

Then authenticate and store it locally:

```bash
sonar auth login -s <YourSonarQubeURL> --with-token <YourSonarQubeUserToken>
```

{% hint style="warning" %}
*User tokens* are required when authenticating your SonarQube CLI with SonarQube Cloud or SonarQube Server. Note that the CLI will not function properly if *project tokens*, *global tokens*, or *scoped organization tokens* are used during the setup process.
{% endhint %}

Verify the connection:

```bash
sonar auth status
```

{% hint style="info" %}
If you’re using SonarQube Cloud, pass your organization with `-o <YourSonarQubeCloudOrganization>` instead of `-s <YourSonarQubeServerURL>`.
{% endhint %}

## Step 3: Review the SonarQube CLI commands

For a full list of available commands, see the [commands](https://docs.sonarsource.com/sonarqube-cli/using/commands "mention") page.
