Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand All @@ -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.

Expand All @@ -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 >}}