# Removing an app from a local platform

> Takes one app, and its databases, off a local platform that is running on this computer — a scratch app a script compiled, a repro, an experiment — and leaves the platform and its other apps as they are.

<!-- id: local-removing-an-app-locally · area: local · stability: stable · html: https://osysharp.com/reference/local/removing-an-app-locally/ -->

## Summary        {#summary}

Removes one app from a local platform: its databases are dropped and it is no longer listed. The platform keeps running,
and every other app on it is untouched. To throw a whole local platform away instead, use [Stopping the local platform](https://osysharp.com/reference/local/stopping-the-local-platform/)
with `--delete`.

## Signature      {#signature}

```console
osy remove [app] [--path <project>] [--devname <name> | --test-platform | --server <url>] [--force] [--json]
```

## Description    {#description}

- `app` names the app by its name or its slug (`WorkTrackerMigrations4242` or `worktrackermigrations4242`). Left out,
  it is the app of the project in `--path` (the current directory by default).
- The platform is this project's, or the one `--devname` names (`OSY_DEVNAME` works too), or the shared test platform
  with `--test-platform`, or the one listening at `--server`. Name it one way, not two.
- It asks before removing anything; `--force` does not ask. With `--json` and no `--force` it refuses rather than ask.

**A final backup first.** The app is deleted the same way `osyrin app delete` deletes one on a hosted platform: the
platform takes a final backup of its databases into its own folder, under `backups` (`osy instances` shows where the
platform is). Only when that backup has finished, with its archive and checksum recorded, are the databases dropped and
the app marked deleted. If the backup cannot be taken (for example, `pg_dump` is not installed or is older than the
database server), the deletion is held, nothing is deleted, and the command says why.

**Local only.** It acts only on a platform running on this computer, found among the ones `osy instances --running`
lists. A `--server` that is not this computer is refused, and so is a loopback address that no local platform is
listening on — a port forwarded to a hosted platform answers on loopback too. An app on a hosted platform is deleted
with `osyrin app delete`. The platform's own apps (Admin and the platform's state) are never removed.

The platform must be running: it is not started to remove an app from it. Start it with `osy compile` in its project,
or `osyrin dev`, and run the command again.

## Examples       {#examples}

```console
osy remove                                              # this project's app, from this project's platform
```

```console
osy remove WorkTrackerMigrations4242 --devname shared --force   # a scratch app on a named platform
```

## See also       {#see-also}

[Stopping the local platform](https://osysharp.com/reference/local/stopping-the-local-platform/) — stop a local platform, or delete the whole instance with `--delete`.

[Listing your local platforms](https://osysharp.com/reference/local/listing-local-instances/) — the local platforms on this computer, and which are running.

[Reclaiming the disk your local platforms use](https://osysharp.com/reference/local/reclaiming-local-disk/) — delete the instances you are no longer using.

[Compiling your app](https://osysharp.com/reference/local/compiling-your-app/) — compile your source into an app on the local platform.
