Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

docs(cli): update local stack guides for CLI v2.120.0 and v2.121.0 behavior (#51751)

Wen Bo Xied46e226af8aa
diff --git a/apps/docs/content/guides/local-development/cli/getting-started.mdx b/apps/docs/content/guides/local-development/cli/getting-started.mdx
index 1be2836137c..a673a69ff0d 100644
--- a/apps/docs/content/guides/local-development/cli/getting-started.mdx
+++ b/apps/docs/content/guides/local-development/cli/getting-started.mdx
@@ -110,7 +110,7 @@ Linux packages are provided in [Releases](https://github.com/supabase/cli/releas
### Run a local Supabase project [#running-a-local-supabase-project]
-The most common thing you'll do with the CLI is run the full Supabase stack (Postgres, Auth, Storage, and the rest) on your own machine. That stack runs in Docker containers, so you need a container runtime installed first. On Windows and Linux, follow the official guide to install and configure [Docker Desktop](https://docs.docker.com/desktop).
+The most common thing you do with the CLI is run the full Supabase stack (Postgres, Auth, Storage, and the rest) on your own machine. That stack runs in Docker containers, so you need a container runtime installed first. On Windows and Linux, follow the official guide to install and configure [Docker Desktop](https://docs.docker.com/desktop). In a coding agent sandbox or on a CI runner with no container engine, the experimental native runtime runs each service as a process instead. It supports Linux and macOS on Apple silicon. For platform requirements and setup, see [Docker and native runtimes](/docs/guides/local-development/docker-and-native-runtimes).
On macOS, we recommend [OrbStack](https://orbstack.dev/) instead of Docker Desktop. It's a drop-in replacement that handles extended file attributes (xattrs) on mounted volumes and container networking more reliably than Docker Desktop. It also starts faster and uses less CPU, memory, and disk, which makes a noticeable difference when running the full Supabase stack.
diff --git a/apps/docs/content/guides/local-development/docker-and-native-runtimes.mdx b/apps/docs/content/guides/local-development/docker-and-native-runtimes.mdx
index 113bc12b773..0a8356bcd5f 100644
--- a/apps/docs/content/guides/local-development/docker-and-native-runtimes.mdx
+++ b/apps/docs/content/guides/local-development/docker-and-native-runtimes.mdx
@@ -110,5 +110,6 @@ The `runtime` field is `docker`, `podman`, or `native`. The text output of `supa
- A local project keeps the runtime it was created with, and the CLI doesn't move data between runtimes. See [How the CLI picks a runtime](#how-the-cli-picks-a-runtime).
- Running several native local projects on one machine works, but they share host resources without the isolation containers provide. Use Docker for that case.
- If Postgres takes too long to become ready on a cold start, raise `health_timeout` under `[db]` in `config.toml`. Both runtimes use that setting.
+- In CLI v2.121.0 or later, the native runtime runs each `pg_cron` job in a background worker instead of over a new connection. As a result, a job body can't contain its own `BEGIN` or `COMMIT`. Earlier versions fail every native `pg_cron` job with `connection failed` or with `job startup timeout` on macOS.
<ContentListings id="local-development-runtimes-learn-more" />
diff --git a/apps/docs/content/guides/local-development/running-multiple-local-projects.mdx b/apps/docs/content/guides/local-development/running-multiple-local-projects.mdx
index e718ac1c1b8..87036186f78 100644
--- a/apps/docs/content/guides/local-development/running-multiple-local-projects.mdx
+++ b/apps/docs/content/guides/local-development/running-multiple-local-projects.mdx
@@ -106,7 +106,15 @@ For an app that already has a `config.toml`, remove the port lines from each app
- `smtp_port` and `pop3_port` under `[local_smtp]`, and `vector_port` under `[analytics]`, if you set them. `supabase init` writes the SMTP ports commented out.
3. Save the file and commit it, so everyone on the team gets the same behavior.
-Remove the ports before the app's first `supabase start` with the setting on. A local project keeps the ports it was created with. If you already started one with the fixed ports, removing them afterward makes `supabase start` fail with `cannot change on the saved stack`. Start a new local project with a different `--stack` name, or run `supabase stack destroy` and start again. Destroying deletes the local project's data.
+If you already started a local project with the fixed ports:
+
+1. Stop it with `supabase stop`.
+2. Remove the port keys from `config.toml`.
+3. Run `supabase start` again.
+
+In CLI v2.121.0 or later, `supabase start` applies the port change to the stopped local project and prints each moved endpoint, such as `api: 54321 → 26199`. The local project keeps its data.
+
+Earlier versions fail with `The saved stack cannot adopt these changes`. On those versions, start a new local project with a different `--stack` name or run `supabase stack destroy` and start again. Destroying deletes the local project's data.
The CLI also treats ports you set with an environment variable, such as `SUPABASE_API_PORT` or `SUPABASE_DB_PORT`, as exact requests. If another process already listens on that port, the start fails. When the port belongs to another local project, the error names that local project.
@@ -146,7 +154,7 @@ The database can't be excluded. Studio needs the REST API, so to exclude `rest`,
Running `supabase start` again on a running local project keeps its current settings and prints `Stack is already running with its current services`. To apply a change to `config.toml`, `--exclude`, or `--eager`, stop the local project and start it again. Starting without `--exclude` restores the services enabled in `config.toml`.
-Stopping and starting doesn't apply changes to ports or to the Postgres major version. For those, start a new local project with a different `--stack` name, or run `supabase stack destroy` and start again.
+In CLI v2.121.0 or later, stopping and starting also applies port changes. A change to the Postgres major version always needs a new local project. Start one with a different `--stack` name, or run `supabase stack destroy` and start again.
## Run named local projects for one app
@@ -206,9 +214,15 @@ To list every local project on the machine, across all apps, run:
supabase stack list
```
-The list shows each local project's name, project root, branch, runtime, and a short ID. Pass `--output-format json` to get the full ID that `--stack-id` accepts.
+The list shows each local project's name, project root, branch, runtime, whether its background process is reachable, and a short ID. Pass `--output-format json` to get the full ID that `--stack-id` accepts.
-To stream live logs from a local project, run `supabase stack logs`. Pass `--service database` to limit the output to one service.
+To read a local project's logs, run `supabase stack logs` in its app directory. The command prints the last 200 retained lines and exits. It also works while the local project is stopped. These flags change what it prints:
+
+- `--follow` keeps streaming new lines after the history.
+- `--tail <n>` changes how many retained lines it prints.
+- `--since 10m` prints only lines from the last 10 minutes.
+- `--service database` narrows the output to one service.
+- `--service gateway` shows only the requests that reached the shared API port.
## Choose a runtime
@@ -246,9 +260,11 @@ To permanently delete one local project and its data, run `supabase stack destro
supabase stack destroy --stack test --yes
```
+In CLI v2.121.0 or later, you can destroy several local projects in one command by passing `--stack-id` more than once with IDs from `supabase stack list`. The command asks for confirmation once. Every ID must match a local project before it destroys anything. Earlier versions destroy one local project per command.
+
<Admonition type="danger">
-`supabase stack destroy` deletes the local project's database data and frees its ports. There is no backup and no undo. There is also no bulk destroy, so one command removes one local project.
+`supabase stack destroy` takes no backup, so you can't recover the local project's data afterward. It also frees the local project's ports.
</Admonition>
@@ -276,10 +292,10 @@ Keep these differences in mind when you turn the setting on for an app that used
- Custom Auth email templates with `content_path`
- Storage Analytics and Storage vector buckets
- A custom `edge_runtime.deno_version`
- - OrioleDB, and `db.major_version` values other than 15 and 17
+ - `db.major_version` values other than 15 and 17
+ - `db.orioledb_version` in CLI versions earlier than v2.121.0, and the `experimental.s3_*` settings for OrioleDB in any version
- Database commands don't accept `--stack`. `supabase db reset` and `supabase db diff` run against the current branch's default local project. `supabase db pull`, `supabase db push`, and `supabase db dump` target the linked project unless you pass `--local`. To reach a named local project, pass the `DB_URL` from `supabase status --stack <name> --env` to a command that accepts `--db-url`.
- Switching branches switches local projects. The git branch is part of the identity. After you check out another branch in the same directory, `supabase start` creates or resumes a different local project with its own data. The first branch's local project keeps running until you stop it.
- Moving or renaming an app directory creates a new local project, because the identity includes the project root path. The previous local project's data stays until you destroy it.
-- `supabase stack logs` streams new log lines only. It has no history.
<ContentListings id="local-development-parallel-projects-learn-more" />