Yes, it is possible to install Docker in another path than C:\ProgramData\Docker, To do this you need to specify the install directory when you are running the Docker setup. You can also move the existing Docker folder to the E:\ProgramData\Docker folder if needed.
download the exe file and run below command
& ‘.\Docker Desktop Installer.exe’ install --installation-dir=F:\prgms\docker
That’s just the tip of the iceberg, the bottom is located in %LOCALAPPDATA%\Docker\wsl\data → its the vhdx file of the docker-desktop-data distribution.
Moving just the application to another drive is not going to free up much space… If you want to be created on a different drive, you need to follow the suggestion posted in How could I install Docker for Windows on drive E: (my SSD C: is full)? - #3 by bryoncline
For anyone asking. Here is how i did it with PowerShell:
Start-Process -Wait -FilePath “Path to your docker downloaded installer” -ArgumentList “install”, “–installation-dir=Path to your custom install dir”
This worked for me under win10:
Open Command prompt with admin privileges, then move to dir with installer exe, then:
“Docker Desktop Installer.exe” install --installation-dir=“H:\Program Files\Docker”
Saved 2.5GB on C: drive.
Then in settings>Ressources>Advanced you can also change disk image folder location (you may need to run Docker as admin or you’ll get an error)
use the following command: start ‘.\Docker Desktop Installer.exe’ -Wait -ArgumentList ‘install’, ‘–installation-dir=“D:\Program Files\Docker\Docker”’
Another alternativ is to change the default installation path for all programs temporarily. That could be done by opening regedit go to:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion
Change data of ProgramFilesDir from C:\Program Files to X:\Program Files where X is the drive you would like to install to. Then run the installer as usual and the program will install to the drive selected. Remember to change the regedit value back to C.
While technically true, why would anyone want to do that?
My post from 2023 didn’t age well, as everything can be done by passing arguments to the installer exe to make Docker Desktop use paths of your choice for the installation dir, and the data root dir:
--installation-dir=<path>Changes the default installation location (C:\Program Files\Docker\Docker)--wsl-default-data-root=<path>Changes the default wsl data location (only applies to WSL2 backend)--hyper-v-default-data-root=<path>Changes the default hyper-v VM disk location (only applies to Hyper-V backend)--windows-containers-default-data-root=<path>Changes the default windows containers data root (only applies for Windows container)
my go-to method when programs doesn’t let you choose install directory. Get why it could seem troublesome for some ; ![]()
Thanks for the update on how to select installation folder with command line, very helpful.