Skip to main content

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. 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 versionDeploys to CloudMore than one podlet
3.3.0 or laterYesYes
2.3.0 to 3.2.xYesNot recommended
Earlier than 2.3.0NoNo

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:

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:

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 for the steps between major versions.

Dart SDK versions​

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

  • Dart 3.8 (default)
  • Dart 3.9
  • Dart 3.10
  • Dart 3.11
  • Dart 3.12
  • Dart 3.13
  • Dart 3.14

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 3.8.

Pass the flag​

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

Set the version in scloud.yaml​

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:

.tool-versions
dart 3.10.4

Use the pubspec constraint​

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

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.