Skip to content

Volume Restore Fails: Stopped Container Still References Volume, Requires Manual SSH to Restore #3995

Open

Description

@AlfayezDev

To Reproduce

  1. Have a Docker Compose service with a named volume
  2. Stop the service from the Dokploy UI
  3. Go to Volume Backups → Restore and select a backup
  4. Trigger the restore
  5. Restore aborts with "Volume is in use" even though the container is stopped (exited)

Current vs. Expected behavior

Current: Dokploy stops the container but does not remove it. The exited container still holds a reference to the volume, causing the restore to abort with:

⚠️ WARNING: Cannot restore volume as it is currently in use!
Status: exited
❌ Volume restore aborted - volume is in use

The only workaround is to SSH into the server and manually run docker rm <container_id> and docker volume rm <volume_name> before triggering the restore again.
Expected: The restore process should automatically remove stopped/exited containers referencing the volume before proceeding, making the UI restore fully self-service without requiring SSH access.

Provide environment information

Dokploy Version: v0.28.6 (cloud)
OS: Ubuntu (Hetzner VPS, ARM aarch64)
Docker Version: run docker --version to get yours
Deployment type: Docker Compose with named volume

Which area(s) are affected? (Select all that apply)

Docker Compose, Docker, Cloud Version

Are you deploying the applications where Dokploy is installed or on a remote server?

Remote server

Additional context

No response

Will you send a PR to fix it?

No

Activity

  1. dosubot commented on Mar 14, 2026

    @dosubot

    This is a known behavior - the volume restore script uses docker ps -a to check for containers referencing the volume, which includes stopped containers. Since Dokploy's stop action leaves containers in Exited state rather than removing them, the restore is blocked.

    Workaround via UI (no SSH required):

    1. Go to Dokploy → Web Server Settings → Space → Docker Cleanup
    2. Enable 'Clean Stopped Containers' and run cleanup
    3. Go to Dokploy → Volumes, find the volume and delete it
    4. Run the volume restore again

    ⚠️ Avoid using 'Clean unused volumes' in Docker Cleanup as it can delete volumes from other paused/stopped services and cause data loss.

    This has been discussed previously and your feature request to have the restore automatically handle stopped containers would be a useful enhancement.

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about dokploy Share Dosu with your team

  2. Siumauricio commented on Aug 4, 2026

    @Siumauricio
    Contributor

    Reproduced and confirmed on v0.29.13 via the UI.

    Test: Compose service with a named volume, a volume backup taken to an S3 destination, service stopped from the Dokploy UI, then Volume Backups → Restore Volume Backup.

    Restore log output:

    === VOLUME RESTORE FOR COMPOSE ===
    Volume exists:           1
    Volume exists, checking for containers using it (including stopped ones)...
    ⚠️  WARNING: Cannot restore volume as it is currently in use!
    📋 The following containers are using volume '<...>_vol-data':
    🐳 Container: <...>-web-1 (e09e782d9406)
       Status: exited
       Type: Docker Compose (<...>)
    🔧 To restore this volume, please:
    1. Stop all containers/services using this volume
    2. Remove the existing volume: docker volume rm <...>_vol-data
    3. Run the restore operation again
    ❌ Volume restore aborted — volume is in use
    ❌ Volume restore failed!
    

    The log itself reports Status: exited and then still aborts — exactly as reported. Stopping via the UI leaves the container in exited state, and an exited container still holds a reference to the volume, so the in-use check can never pass through the UI alone. SSH is required to docker rm the container, which defeats the purpose of the UI restore.

    Confirmed; keeping open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions