# Serverpod and Dart SDK versions

https://docs.serverpod.dev/cloud/reference/serverpod-and-dart-sdk-versions

Each deploy to Serverpod Cloud checks two versions in your project. The Serverpod version decides whether the project deploys and whether it can safely run more than one [podlet](https://docs.serverpod.dev/cloud/concepts/compute.md). The Dart SDK version decides which Dart release Cloud builds your server with.

## Serverpod versions

Here's what each Serverpod version supports on Cloud:

| Serverpod version  | Deploys to Cloud | More than one podlet |
| ------------------ | ---------------- | -------------------- |
| 3.3.0 or later     | Yes              | Yes                  |
| 2.3.0 to 3.2.x     | Yes              | Not recommended      |
| Earlier than 2.3.0 | No               | No                   |

Serverpod 3.3.0 added the health check endpoints that Cloud uses when it deploys, scales up, and scales down. Without them, a project running more than one podlet can be disrupted during deploys and scaling.

## How the deploy checks the Serverpod version

Each deploy reads the `serverpod` dependency in your server's `pubspec.yaml`. Every version its constraint allows must be 2.3.0 or later. A constraint such as `^2.2.0` stops the deploy, even if your lockfile resolves a later version:

```text
Unsupported serverpod version constraint: ^2.2.0 (must adher to: >=2.3.0)
```

If the constraint allows no version from 3.3.0 on, and your project's **Min podlets** or **Max podlets** is above 1, the deploy continues with this warning:

```text
Multiple podlets are enabled, but your Serverpod constraint does not allow it. Upgrade to Serverpod 3.3.0 or later to reduce the risk of disruption during scaling and deployment.
```

To clear either message, raise the `serverpod` constraint and upgrade the project. See [Upgrading](https://docs.serverpod.dev/upgrading.md) for the steps between major versions.

## Dart SDK versions

Serverpod Cloud builds your server with one of these Dart SDK versions:

## How the Dart SDK version is selected

The `serverpod cloud deploy` command reads the Dart SDK version from the first of these sources that sets one:

1. The `--dart-version` flag.
2. The `dartSdk` field in `scloud.yaml`.
3. The `dart` entry in a `.tool-versions` file, in the project directory first and then the workspace root.
4. The `environment.sdk` constraint in `pubspec.yaml`.

Every source accepts an exact version or a pub-style version constraint, such as `3.10`, `^3.9.0`, or `>=3.9.0 <4.0.0`. Serverpod Cloud builds with the highest supported version the constraint allows. If the constraint allows no supported version, the deploy fails with an error that lists the supported versions.

When no source sets a version, your server builds with Dart .

### Pass the flag

```bash
# Deploy with a one-off Dart SDK version override
serverpod cloud deploy --dart-version 3.10
```

### Set the version in scloud.yaml

```yaml title="scloud.yaml"
project:
  projectId: "my-app"
  dartSdk: "3.10"
```

### Use your version manager's pin

Version managers such as mise and asdf pin tool versions in a `.tool-versions` file. Serverpod Cloud reads the `dart` entry:

```text title=".tool-versions"
dart 3.10.4
```

### Use the pubspec constraint

Without any of the sources above, the SDK constraint in your `pubspec.yaml` decides:

```yaml title="pubspec.yaml"
environment:
  sdk: ">=3.9.0 <4.0.0"
```

This example builds with the highest supported version, since the constraint allows all of them from 3.9 up.

## Related documentation

- [Compute](https://docs.serverpod.dev/cloud/concepts/compute.md): podlet sizes and the autoscaling range.
- [scloud.yaml schema](https://docs.serverpod.dev/cloud/reference/scloud-yaml-schema.md): the `dartSdk` field and how Cloud CLI commands preserve it.
- [Deployments](https://docs.serverpod.dev/cloud/concepts/deployments.md): deploy operations, status checks, and package validation.
- [CLI reference: `deploy` command](https://docs.serverpod.dev/cloud/reference/cli/commands/deploy.md): all deploy flags.
