Skip to main content
Version: Next

Starting the server

The serverpod start command runs your project in development mode. It generates the latest code, starts the server with hot reload, and launches the companion Flutter app, all in a single interactive terminal.

serverpod start

Run it from anywhere inside your project folder.

When it boots the server, serverpod start applies any pending migrations. While it runs, you create and apply new migrations from the terminal UI (see Terminal UI shortcuts).

Usage

serverpod start [options] [-- <server-args>]

Options

OptionDefaultDescription
-w, --watch / --no-watchtrueWatch files and hot-reload using the Frontend Server for fast incremental compilation. Pass --no-watch to start the server with dart run instead.
-d, --directory <path>auto-detectSet the server package directory. Auto-detected from the current directory when omitted.
--docker / --no-dockerfalseStart Docker Compose services if a docker-compose.yaml exists (typically Redis when running Postgres separately). Off by default; pass --docker to opt in.
--tui / --no-tuitrueShow the interactive terminal UI. Pass --no-tui to run without it, for example in scripts or non-interactive shells.
--flutter / --no-fluttertrueLaunch the companion Flutter app alongside the server. Pass --no-flutter to start only the server.
--flutter-device <name>chromeChoose the device passed to flutter run -d. Use web-server for headless or CI runs.
--flutter-option <arg>noneForward an extra argument to flutter run. Repeatable, e.g. --flutter-option=--web-port=8090.
-h, --helpPrint usage information.

Terminal UI shortcuts

The interactive terminal UI lists its shortcuts along the bottom. With the serverpod start terminal focused:

KeyAction
RHot restart the server.
MCreate a migration from your current model changes (Shift+M to force).
AApply pending migrations to the database.
PCreate a repair migration to reconcile a drifted database (Shift+P to force).

Saving a file hot-reloads the server automatically while watching is enabled.

Passing arguments to the server

Arguments after -- are forwarded to the running server. For example, to start it in a specific run mode:

serverpod start -- --mode staging

The server accepts the following arguments:

ArgumentAllowed valuesDefaultDescription
-m, --modedevelopment, test, staging, productiondevelopmentSet the run mode the server starts in.
-r, --rolemonolith, serverless, maintenancemonolithSet the role the server runs as.
-l, --loggingnormal, verbosenormalSet the logging level.
-i, --server-idanydefaultSet the id of this server instance.
-a, --apply-migrationsfalseApply pending database migrations on boot.
-A, --apply-repair-migrationfalseApply the repair migration on boot.
note

serverpod start is intended for local development. For production, deploy the server instead. See Deploy to Serverpod Cloud or Custom hosting.