> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sevalla.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These are the docs for Sevalla, a platform for deploying applications, databases, static sites, object storage and load balancers. The dashboard is at https://app.sevalla.com.
> Bold text in steps is an exact dashboard label.
> To act on a Sevalla account, prefer the Sevalla MCP server (https://mcp.sevalla.com/mcp, see https://docs.sevalla.com/ai-agents/overview.md), then the Sevalla CLI (https://docs.sevalla.com/developer-tools/cli.md), then the REST API (https://api-docs.sevalla.com, OpenAPI spec at https://api.sevalla.com/v3/openapi.json).
> Every page index is at https://docs.sevalla.com/llms.txt.

# Deploy Dart applications

> How Dart servers build and run on Sevalla: a Dockerfile that compiles them ahead of time on the official dart image, the Dart version, the PORT variable and SIGTERM.

A Dart web server runs on Sevalla as an [application](https://docs.sevalla.com/applications/overview.md): Sevalla builds an image from the Dockerfile in your Git repository, which compiles your server ahead of time (AOT) into one native executable on the official `dart` image, and runs that executable as processes. The executable needs no Dart SDK, so the final image is Debian slim with the executable in it.

## Framework guides

> **[Dart Frog](https://docs.sevalla.com/guides/dart/dart-frog.md)**
>
> Deploy a Dart Frog server, compiled with `dart compile exe`, that stops cleanly on `SIGTERM`.

## How Dart applications run on Sevalla

| Part | On Sevalla |
| - | - |
| Build | A [Dockerfile](https://docs.sevalla.com/applications/builds/dockerfile.md) in the repository, with the **Dockerfile** build strategy. [Ingot](https://docs.sevalla.com/applications/builds/ingot.md), the default for new applications, has no Dart provider: its build stops with `Ingot couldn't tell what kind of application this is`. Choose the Dockerfile build strategy on the application's **Settings** tab before the first deployment. |
| Package manager | pub. Commit `pubspec.lock`, and install with `dart pub get --enforce-lockfile`, which installs exactly the versions you tested and fails when the lock file is missing or doesn't match `pubspec.yaml`. Some templates, Dart Frog's among them, list `pubspec.lock` in `.gitignore`: remove that line. |
| Dart version | The tag of the image the Dockerfile builds on, such as `dart:3.13`. See [Pin the Dart version](#pin-the-dart-version). |
| What runs | The executable that `dart compile exe` builds from the server's entry point, on `debian:trixie-slim`, the Debian release the `dart` image is built on |
| Start command | The Dockerfile's `CMD`, such as `/app/server` |
| Port | Sevalla sets `PORT` to the web process's port, `8080` by default. The server that Dart Frog generates reads it; read it with `Platform.environment['PORT']` in any other server. |
| Shutdown | The executable runs as process 1, and Linux ignores a signal that process 1 has no handler for. Handle `SIGTERM` with `ProcessSignal.sigterm.watch()`, or the instance runs until Sevalla stops it 30 seconds later. See [Shut down gracefully](https://docs.sevalla.com/guides/dart/dart-frog.md#shut-down-gracefully). |
| Databases | PostgreSQL, MySQL, MariaDB, Redis or Valkey on Sevalla, reached over an [internal connection](https://docs.sevalla.com/databases/connect.md#connect-an-application) that adds `DB_URL` and the other connection variables |
| Files | The filesystem resets on every deployment. Keep uploads in [object storage](https://docs.sevalla.com/object-storage/overview.md), or attach a [disk](https://docs.sevalla.com/applications/disks.md). |

Every process (web, worker, cron job and job) runs from the same image, each with its own start command. See [Processes](https://docs.sevalla.com/applications/processes.md).

## Pin the Dart version

The Dockerfile's `FROM` line sets the Dart version: `dart:3.13` compiles with the newest Dart 3.13 release. A line tag such as `3.13` moves to each 3.13 patch release and to Debian's security fixes, so every new build picks them up. A full version, such as `3.13.7`, stays on that release. The `environment: sdk` constraint in `pubspec.yaml`, such as `^3.11.0`, is the range of Dart versions the package accepts, and must include the image's version.

## Build with a Dockerfile

A Dockerfile for a Dart server builds in one stage and runs in another. The build stage uses the official `dart` image, copies `pubspec.yaml` and `pubspec.lock` first and installs the packages in their own layer, then copies the code and compiles the entry point with `dart compile exe`. The final stage starts from `debian:trixie-slim`, which has `/bin/sh` for the [web terminal](https://docs.sevalla.com/applications/web-terminal.md) and custom start commands, copies only the executable, owned by root, and runs it as user `1000:1000` with an exec-form `CMD`. Dart's own image documentation copies the executable into an empty `scratch` image instead, which has no shell. The [Dart Frog guide](https://docs.sevalla.com/guides/dart/dart-frog.md#deploy-with-a-dockerfile) has a tested Dockerfile.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.