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:
- Stops the Docker container (or compose stack)
- Removes the container
- Removes the Docker image (best-effort — only images not used elsewhere)
- Removes the build directory (for git-source apps)
- Closes the UFW firewall rule for the host port
- Closes the cloud provider firewall rule if one was opened by CloudAIPilot
- Removes the Nginx vhost for any custom domains
- Soft-deletes the app record in CloudAIPilot (preserves audit history)
How to Delete an App
- Open the app detail → Settings → Danger Zone.
- Click Delete App.
- 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).
- Confirm.
The cleanup runs synchronously and returns a report of each step:
ok— step completed successfullyskipped— 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:
| Step | Status |
|---|---|
| Stop container | ok |
| Remove container | ok |
| Remove Docker image | ok |
| Remove build directory | skipped (no build dir) |
| Close UFW port rule | ok |
| Close cloud firewall rule | ok |
| Remove Nginx vhost | ok |
| Reload Nginx | ok |
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
| Issue | Likely cause | Fix |
|---|---|---|
| "APP_RUNNING" error | App is running and force flag not set | Use the force delete option. |
| Cleanup step "failed" for firewall | Cloud API timeout or credential issue | Check if the firewall rule still exists in your cloud console and delete it manually. |
| Docker image not removed | Image is used by another container | Expected — image removal is best-effort and skipped if still in use. |