Delete an App and Cleanup Expectations

Who this is for

Users who want to remove an app from a server and understand what gets cleaned up in the process.


What App Deletion Does

Deleting an app performs a full cleanup:

  1. Stops the Docker container (or compose stack)
  2. Removes the container
  3. Removes the Docker image (best-effort — only images not used elsewhere)
  4. Removes the build directory (for git-source apps)
  5. Closes the UFW firewall rule for the host port
  6. Closes the cloud provider firewall rule if one was opened by CloudAIPilot
  7. Removes the Nginx vhost for any custom domains
  8. Soft-deletes the app record in CloudAIPilot (preserves audit history)

How to Delete an App

  1. Open the app detail → SettingsDanger Zone.
  2. Click Delete App.
  3. If the app is running, you will be prompted to confirm with ?force=true:
  • A warning explains that the app is currently serving traffic.
  • Check "Force delete even if running" (or click the forced delete button).
  1. Confirm.

The cleanup runs synchronously and returns a report of each step:

  • ok — step completed successfully
  • skipped — step was not applicable (e.g., no firewall rule existed)
  • failed — step encountered an error (partial cleanup — review and manual clean-up may be needed)

Cleanup Step Report

After deletion, the Activity Center (or the confirmation dialog) shows the cleanup report. Example:

StepStatus
Stop containerok
Remove containerok
Remove Docker imageok
Remove build directoryskipped (no build dir)
Close UFW port ruleok
Close cloud firewall ruleok
Remove Nginx vhostok
Reload Nginxok

If any step shows failed:

  • The app record is still soft-deleted in CloudAIPilot.
  • You may need to manually clean up the remaining resource on the server.

Before You Delete

  • Ensure no other services depend on this app's port or domain.
  • If other apps or sites proxy to this app, update their configuration first.
  • Back up any persistent data stored in Docker volumes (volumes are not automatically deleted).

Docker Volumes Are Not Deleted

CloudAIPilot does not delete Docker named volumes when deleting an app. This prevents accidental data loss for apps with databases or file storage in volumes.

To delete volumes manually:

docker volume ls
docker volume rm <volume-name>

SSH into the server via the Terminal tab to run these commands.


What Success Looks Like

The app no longer appears in the Apps list. No container is running on the server for this app. The host port is available for new apps. The cleanup report shows all steps as ok or skipped.


Common Issues and Fixes

IssueLikely causeFix
"APP_RUNNING" errorApp is running and force flag not setUse the force delete option.
Cleanup step "failed" for firewallCloud API timeout or credential issueCheck if the firewall rule still exists in your cloud console and delete it manually.
Docker image not removedImage is used by another containerExpected — image removal is best-effort and skipped if still in use.

Related Articles