diff --git a/content/manuals/desktop/settings-and-maintenance/backup-and-restore.md b/content/manuals/desktop/settings-and-maintenance/backup-and-restore.md index 4ada95b5fda3..8b7995d5ef47 100644 --- a/content/manuals/desktop/settings-and-maintenance/backup-and-restore.md +++ b/content/manuals/desktop/settings-and-maintenance/backup-and-restore.md @@ -8,13 +8,15 @@ aliases: - /desktop/backup-and-restore/ --- -Use this procedure to back up and restore your images and container data. This is useful if you want to reset your VM disk or to move your Docker environment to a new computer. +Use this procedure to back up and restore your images and container data. This is useful if you want to reset your VM disk or to move your Docker environment to a new computer, or recover from a failed Docker Desktop update or installation. > [!IMPORTANT] > > If you use volumes or bind-mounts to store your container data, backing up your containers may not be needed, but make sure to remember the options that were used when creating the container or use a [Docker Compose file](/reference/compose-file/_index.md) if you want to re-create your containers with the same configuration after re-installation. -## Save your data +## If Docker Desktop is functioning normally + +### Save your data 1. Commit your containers to an image with [`docker container commit`](/reference/cli/docker/container/commit.md). @@ -39,7 +41,7 @@ Use this procedure to back up and restore your images and container data. This i After backing up your data, you can uninstall the current version of Docker Desktop and [install a different version](/manuals/desktop/release-notes.md) or reset Docker Desktop to factory defaults. -## Restore your data +### Restore your data 1. Load your images. @@ -59,3 +61,65 @@ and [install a different version](/manuals/desktop/release-notes.md) or reset Do or [Docker Compose](/manuals/compose/_index.md). To restore volume data, refer to [backup, restore, or migrate data volumes](/manuals/engine/storage/volumes.md#back-up-restore-or-migrate-data-volumes). + +## If Docker Desktop fails to start + +If Docker Desktop cannot launch and must be reinstalled, you can back up its VM disk and image data directly from disk. Docker Desktop must be fully stopped before backing up these files. + +{{< tabs >}} +{{< tab name="Windows" >}} + +1. Back up Docker containers/images. + + Backup the following file: + + ```console + %LOCALAPPDATA%\Docker\wsl\data\docker_data.vhdx + ``` + + Copy it to a safe location. + +1. Back up WSL distributions. + + If you're running any WSL Linux distributions (Ubuntu, Alpine, etc.), back them up using [Microsoft's guide](https://learn.microsoft.com/en-us/windows/wsl/faq#how-can-i-back-up-my-wsl-distributions-). + +1. Restore. + + After reinstalling Docker Desktop, restore the `docker_data.vhdx` to the same location and re-import your WSL distributions if needed. + +{{< /tab >}} +{{< tab name="Mac" >}} + +1. Back up Docker containers/images. + + Backup the following file: + + ```console + ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw + ``` + + Copy it to a safe location. + +1. Restore. + + After reinstalling Docker Desktop, restore the `Docker.raw` to the same location. + +{{< /tab >}} +{{< tab name="Linux" >}} + +1. Back up Docker containers/images: + + Backup the following file: + + ```console + ~/.docker/desktop/vms/0/data/Docker.raw + ``` + + Copy it to a safe location. + +1. Restore. + + After reinstalling Docker Desktop, restore the `Docker.raw` to the same location. + +{{< /tab >}} +{{< /tabs >}} \ No newline at end of file