If you’ve ever tried to install Docker Desktop somewhere other than your C: drive, you’ve probably noticed something annoying: the installer’s GUI doesn’t give you a folder picker. There’s no “Browse” button, no dropdown, nothing. It just installs to C:\Program Files\Docker and calls it a day.
For a lot of us, that’s a problem. C: drives on laptops are often smaller SSDs reserved for the OS, while a bigger D: drive sits there with plenty of room to spare. Docker images and containers can chew through disk space fast, so keeping Docker off your system drive isn’t just a preference — it’s practical.
I went looking for a clean, current guide on doing this and came up mostly empty, so here’s the process that actually worked for me, including a frustrating error I ran into along the way and how I fixed it.
Why You Can’t Just Drag the Docker Folder
Some people try installing normally and then moving the Docker folder afterward. Don’t do this. Docker Desktop hardcodes registry paths and shortcuts during installation, so moving the folder manually breaks it. You need to tell the installer where to go before it runs.
Step 1: Install Docker Desktop to a Custom Directory
Docker Desktop’s installer accepts command-line flags even though the GUI doesn’t expose them. Here’s the process:
- Download
Docker Desktop Installer.exefrom docker.com. - Open PowerShell as Administrator.
- Navigate to the folder where the installer downloaded, then run:
& ".\Docker Desktop Installer.exe" install --installation-dir="D:\Program Files\Docker"A couple of PowerShell quirks worth knowing here:
- You need the call operator (
&) when running an executable from a quoted string path. Without it, PowerShell tries to parse the whole line as an expression and throws anUnexpected tokenerror. - Quoting the path with spaces (like
"D:\Program Files\Docker") is required, or Windows will treatProgramandFiles\Dockeras separate arguments.
This installs the actual Docker Desktop application binaries to your chosen drive.
Step 2: Move Docker’s Data (Images & Containers) to D: Too
Here’s the part a lot of guides skip: installing the app to a custom directory does not move where your images and containers live. On Windows, Docker Desktop stores all of that inside a WSL2 virtual disk file (ext4.vhdx) — and by default, that’s still on C:.
If your goal is to free up space on your system drive, this step matters more than Step 1.
Easiest method — through Docker Desktop’s UI:
- Open Docker Desktop.
- Go to Settings → Resources → Advanced.
- Under Disk image location, click Browse and choose a folder on D:.
- Click Apply & Restart.
If you already have containers and want to migrate existing data:
powershell
wsl --shutdown
wsl --export docker-desktop-data "D:\Docker\docker-desktop-data.tar"
wsl --unregister docker-desktop-data
wsl --import docker-desktop-data "D:\Docker\data" "D:\Docker\docker-desktop-data.tar" --version 2Restart Docker Desktop afterward and your existing images/containers should still be there, just relocated.
Troubleshooting: “The Specified Executable Is Not a Valid Application for This OS Platform”
This is the error that stopped me in my tracks, so it’s worth covering in detail since it can show up for several completely different reasons.
If you run the installer and get:
Program 'Docker Desktop Installer.exe' failed to run: The specified executable
is not a valid application for this OS platform.Work through these checks in order:
1. Confirm your CPU architecture matches the installer.
echo $env:PROCESSOR_ARCHITECTUREIf this returns ARM64, you need Docker’s ARM64-specific build, not the standard x64 installer — running the wrong one produces exactly this error.
2. Check the file size.
Get-Item "Docker Desktop Installer.exe" | Select-Object Name, LengthThe legitimate installer is roughly 500–600MB. A file that’s only a few KB means you downloaded a broken link or an error page saved with an .exe extension.
3. Check if Windows flagged the file as untrusted.
Get-Item "Docker Desktop Installer.exe" -Stream Zone.Identifier -ErrorAction SilentlyContinue
Unblock-File -Path "Docker Desktop Installer.exe"Downloaded files sometimes get a “mark of the web” flag that can interfere with execution.
4. If none of that explains it, the download itself is likely corrupted — even if the file size looks correct. This can happen silently, especially if antivirus or endpoint protection software intercepts and modifies the file after download. The fix is a clean re-download, ideally straight from Docker’s CDN rather than through a browser:
Remove-Item "Docker Desktop Installer.exe"
Invoke-WebRequest -Uri "https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe" -OutFile "Docker Desktop Installer.exe"In my case, this was exactly the problem — the file was the right size and the right architecture, but something along the way had quietly corrupted it. A fresh download from the direct CDN link fixed it immediately.
5. If it still fails on a work or managed machine, check for AppLocker or Windows Defender Application Control (WDAC) policies, which can block unsigned or unrecognized executables with this same generic error:
Get-AppLockerPolicy -Effective | Format-ListQuick Recap
- Use
--installation-dirwith the installer to control where the Docker Desktop app itself lives. - Separately move the WSL2 disk image via Docker Desktop’s Settings to actually save disk space.
- If you hit “not a valid application for this OS platform,” check architecture first, then file integrity — a clean re-download solves this more often than you’d expect.
Hopefully this saves someone else the half hour I spent staring at a cryptic PowerShell error.

Leave a Reply