Path Parameters
Query Parameters
Environment ID where the stack exists
Force deletion without confirmation. Removes containers, networks, volumes, and files.
Response
Whether the deletion succeeded
Error message if deletion failed
Behavior
Stops and removes all containers in the stack
Removes networks created by the stack (if not in use by other containers)
Removes named volumes (when force=true)
Deletes compose file, .env file, and stack directory
Removes stack from database
For Git stacks, also removes Git repository clone and unregisters auto-sync schedule
Deletion Process
Runs docker compose down (with -v flag if force=true)
Deletes compose file and environment file
Removes stack directory
Removes database records (stack sources, environment variables)
For Git stacks: removes repository clone and schedules
Standard Delete
Force Delete (with volumes)
JavaScript
curl -X DELETE "https://your-dockhand-instance.com/api/stacks/my-app?env=1" \
-H "Cookie: auth_token=your_token"
Force Delete vs Standard Delete
Standard Delete
Stops containers
Removes containers
Removes networks (if unused)
Preserves volumes
Deletes compose files
Force Delete
Stops containers
Removes containers
Removes networks (if unused)
Removes volumes
Deletes compose files
Important Notes
Force deletion (force=true) permanently removes all volumes associated with the stack. This includes databases, uploaded files, and any persistent data. This action cannot be undone.
Networks are only removed if they are not in use by other containers. Shared networks will be preserved.
External stacks (adopted stacks) only have their Dockhand metadata removed. The actual compose files at the external location are not deleted .
What Gets Deleted
Internal Stacks (Created via Dockhand)
All containers
All networks (if unused)
All volumes (if force=true)
Compose file at /data/stacks/{name}/compose.yaml
Environment file at /data/stacks/{name}/.env
Stack directory at /data/stacks/{name}/
Database records
Git Stacks
All containers
All networks (if unused)
All volumes (if force=true)
Git repository clone at /data/git-repos/repo-{id}/
Database records
Auto-sync schedules
External Stacks (Adopted)
All containers
All networks (if unused)
All volumes (if force=true)
Database records only
Original files are NOT deleted
Error Responses
400 Bad Request
{
"success" : false ,
"error" : "Stack is currently running. Stop it first or use force=true"
}
403 Forbidden
User lacks stacks:remove permission
User cannot access the specified environment
404 Not Found
{
"error" : "Compose file not found for stack \" my-app \" . The stack may have been deleted or was created outside of Dockhand."
}
500 Internal Server Error
Docker daemon error
File system error
Database error
Permissions
Requires stacks:remove permission for the specified environment.