windowsdockerdocker-desktop

How to install Docker Desktop on a different drive (location) on Windows


I've had Docker Desktop installed on my C:\ drive for a while now and it keeps hogging space on my SSD. Even if I delete all of my containers and images it still takes a lot of space, I'm guessing some cached files or something. The only way I could recover space on my SSD is to fully uninstall Docker Desktop.

I've been trying to install Docker Desktop onto a larger HDD but it's not an option on the installer. I've seen some guides about modifying the services and supplying the --data-root flag but it doesn't seem to work. I couldn't restart the dockerd service, etc.


Solution

  • Note: the WSL, image etc still will be in %HOME%\AppData\Local\Docker. As noted in comments, you can change that too by adding: --wsl-default-data-root=E:\path\to\data\folder
    (for Windows 11, you might also check the another answer in this thread)

    Documentation: https://docs.docker.com/desktop/install/windows-install/#install-from-the-command-line