How to install Docker Desktop on a different drive (location) on Windows
Mar 13
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.
1 answer
Accepted answer · original discussion
May 5
- Don't install using double click on "Docker Desktop Installer.exe".
- Open Command Prompt as Administrator (right click on the Terminal icon and click on "Run as Administrator"). If you are using Windows Terminal, make sure you're using Command Prompt and not Powershell, as the commands are formatted differently (see the Documentation).
- Go to the folder where "Docker Desktop Installer.exe" downloaded. Run
start /w "" "Docker Desktop Installer.exe" install -accept-license --installation-dir=E:\path\to\folderNote: the installer does not create the "Docker" dir this way if you don't specify a directory after the driver letter. Make sure to writeE:\Dockerat minimum
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
0 question comments
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.