What problem will this feature address?
When using Docker Compose deployments, there is no built-in way to redeploy with fresh/clean volumes. This is commonly needed when:
- Debugging state-related issues that persist across redeployments
- Resetting a database or persistent data to a clean state
- Testing a fresh installation scenario
Currently, the only workaround is to manually modify the Run Command in the Advanced tab to prepend a volume cleanup step, for example:
compose -p my-project-ajnxdl -f ./docker-compose.production.yaml down --volumes && docker compose -p my-project-ajnxdl -f ./docker-compose.production.yaml up -d --build --remove-orphans
This is error-prone (easy to forget to revert), requires knowledge of the exact compose command syntax, and isn't accessible to less technical users.
Describe the solution you'd like
Add a "Deploy with Fresh Volumes" button (or a "Reset & Deploy" toggle) to the compose deployment UI. When triggered, it would:
- Run
docker compose -p <appName> -f <composePath> down --volumes to stop containers and remove their volumes
- Then proceed with the normal deployment (build + up)
This could be implemented as:
- A separate button next to the existing Deploy button, e.g. "Deploy (Fresh Volumes)"
- Or a toggle/checkbox in the deploy dialog: "Clean volumes before deploying"
The underlying command generation in createCommand() (packages/server/src/utils/docker/compose.ts) would check for this flag and prepend the down --volumes step before the standard up command.
Describe alternatives you've considered
- Custom Run Command (current workaround) — Works but requires manual editing in the Advanced tab and is easy to forget to revert, leaving the project permanently in "fresh volumes" mode on subsequent deploys.
- Manual SSH / terminal access — Not all users have direct server access, especially on cloud-hosted instances.
- A separate "Reset" action (non-deploying) — Useful but requires two clicks (reset + deploy) instead of one. A combined action is more convenient.
Additional context
Relevant code locations:
- Command generation:
packages/server/src/utils/docker/compose.ts — createCommand() function (lines 80-97) builds the docker compose command. This is where the down --volumes prefix would be added.
- Deploy endpoint:
apps/dokploy/server/api/routers/compose.ts — deploy (lines 416-465) and redeploy (lines 466-513) queue the deployment. A new freshVolumes boolean parameter could be added here.
- Compose schema:
packages/server/src/db/schema/compose.ts — The compose table schema where deployment settings are stored.
- Advanced/Run Command UI:
apps/dokploy/components/dashboard/compose/advanced/add-command.tsx — Where users currently set custom commands.
- Volume cleanup already exists:
removeCompose() in packages/server/src/services/compose.ts (lines 422-460) already supports deleteVolumes: true with docker compose down --volumes, so the pattern is established in the codebase.
Will you send a PR to implement it?
Yes, I plan to submit a PR to implement this feature.
What problem will this feature address?
When using Docker Compose deployments, there is no built-in way to redeploy with fresh/clean volumes. This is commonly needed when:
Currently, the only workaround is to manually modify the Run Command in the Advanced tab to prepend a volume cleanup step, for example:
This is error-prone (easy to forget to revert), requires knowledge of the exact compose command syntax, and isn't accessible to less technical users.
Describe the solution you'd like
Add a "Deploy with Fresh Volumes" button (or a "Reset & Deploy" toggle) to the compose deployment UI. When triggered, it would:
docker compose -p <appName> -f <composePath> down --volumesto stop containers and remove their volumesThis could be implemented as:
The underlying command generation in
createCommand()(packages/server/src/utils/docker/compose.ts) would check for this flag and prepend thedown --volumesstep before the standardupcommand.Describe alternatives you've considered
Additional context
Relevant code locations:
packages/server/src/utils/docker/compose.ts—createCommand()function (lines 80-97) builds the docker compose command. This is where thedown --volumesprefix would be added.apps/dokploy/server/api/routers/compose.ts—deploy(lines 416-465) andredeploy(lines 466-513) queue the deployment. A newfreshVolumesboolean parameter could be added here.packages/server/src/db/schema/compose.ts— Thecomposetable schema where deployment settings are stored.apps/dokploy/components/dashboard/compose/advanced/add-command.tsx— Where users currently set custom commands.removeCompose()inpackages/server/src/services/compose.ts(lines 422-460) already supportsdeleteVolumes: truewithdocker compose down --volumes, so the pattern is established in the codebase.Will you send a PR to implement it?
Yes, I plan to submit a PR to implement this feature.