Stack Management
Delete Stack
Remove a compose stack and its resources
DELETE
Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Finsys/dockhand/llms.txt
Use this file to discover all available pages before exploring further.
Path Parameters
Stack name (URL-encoded)
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-vflag ifforce=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
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
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
403 Forbidden
- User lacks
stacks:removepermission - User cannot access the specified environment
404 Not Found
500 Internal Server Error
- Docker daemon error
- File system error
- Database error
Permissions
Requiresstacks:remove permission for the specified environment.
Related Endpoints
- List Stacks - View all stacks
- Deploy Stack - Create a new stack
- Update Stack - Modify an existing stack
