Skip to content

Delete an app

Deleting an app cannot be undone. There is no rollback and no grace period, so the console and the CLI ask you to type the app’s name first.

Open the app. At the bottom of its overview tab, Delete app opens a dialog; type the app’s name and choose Delete for good.

From tori.host 0.19.0:

Terminal window
npx tori.host delete # the app in ./tori.json; asks for its name
npx tori.host delete crimson-finch # an app by name, from any directory
npx tori.host delete crimson-finch --yes # no prompt; for scripts

On a terminal the command says what it is about to delete and sends nothing until you type the app’s name; anything else aborts. In a script or CI, where nobody can answer, it refuses unless you name the app and pass --yes. With --yes the app is never taken from tori.json, so a script whose variable came out empty deletes nothing. An app whose name starts with a hyphen can be deleted only from its own directory or in the console.

It does not touch your files.

If the API fails or the connection drops, the CLI says that it cannot tell whether the app was deleted. Look in the console before you run it again: if the name has been taken for a new app since, a second run deletes that one.

If ./tori.json names the deleted app, a deploy from there is refused: there is no such app. Delete the file, and the next deploy creates a new app and writes a new one. It knows nothing of the deleted app, so deploy the way that one was first deployed: with --service for a source tree that needed it, or with --image for an image.

If the file also sets release or port, keep it and change only its slug, so the first deploy of the new app has them too. Create the new app first, and put the slug from the answer into the file:

Terminal window
curl -sS -X POST -H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" -d '{"kind":"service"}' \
https://api.tori.host/api/apps

See tori delete.

Ask for the app by name: “delete the app crimson-finch on Tori”. The MCP tool tori_app_delete (preview, from tori.host 0.19.0) takes the app and a confirm field that repeats its name, and deletes nothing if the two differ. It is marked destructive, so an MCP host can ask you before it runs. To deploy the directory again as a new app, the agent calls tori_deploy without app. That tool does not read the slug in tori.json, but a source deploy reads release and port there, so the file stays. Before the CLI is used in that directory again, put the new app’s slug into it. The agent needs no token from you: the tool uses the one the MCP server already has. See MCP for coding agents.

Terminal window
curl -sS -X DELETE -H "Authorization: Bearer <token>" \
https://api.tori.host/api/apps/<slug>

The answer is { "ok": true, "reclaimed": true }. "reclaimed": false means the app is deleted and what it stored is still being removed; do not retry. Neither value says that every address has stopped answering: that follows within seconds, and can take longer if the zone that serves the app cannot be reached. A second request gets HTTP 404, as does an app of another account, unless you have taken the name for a new app since: then it deletes that one. If a request fails with a 5xx or its answer is lost, check with GET /api/apps/<slug> whose app answers there, by its id, before sending it again. A deploy token cannot delete its app and gets HTTP 403.

  • The site. Its <slug>.tori.cloud address and its custom domains stop serving it, normally within seconds, longer only if the zone that serves it cannot be reached. The tori.cloud address then answers with the 404 page of an address with no app. A custom domain usually answers nothing over HTTPS: its certificate goes with it, so the connection fails before any status.
  • Its deploys and the files they stored.
  • Its environment variables.
  • Its custom domains. The hostnames leave the app, and can be added to another one once the cleanup is done. The DNS records at your provider are yours to delete.
  • Its managed Postgres database, if it has one, with its data and nightly dumps. A copy of the data stays in the platform’s disaster-recovery copies until they age out, as when only the database is deleted.
  • Its deploy tokens stop working.

The app no longer counts toward the number of apps your plan allows, from the moment it is deleted.

  • The name. No other account can take it, so an old link never leads to somebody else’s site. You can take it again for a new app with POST /api/apps, once the cleanup is done; until then that request is refused with slug still being reclaimed.
  • A name you bought through Tori (preview) stays on your account, and can be connected to another app.
  • Your files, and the rest of the account.

Download this page as Markdown.