Docker installation directory

I am trying to install docker on win10 and it defaults to C:\Program Files\Docker. Is there anyway I can change the destination directory to be c:\users\xxx\Docker? I tried various options such as installing through CLI and using the msiexec INSTALL_DIR / TARGETDIR options and none of them seem to work. The default installer is not asking me for a target directory when I try to install.

4 Likes

Hi,

Did you find a solution for this?
Not sure if i want to try but, maybe this could work:
-deleting the windows service
-move the folder
-create the service

Thanks.

I have the same problem, but I need to change the install location to a different drive such as E:\

1 Like

+1, also need this installation option

+1

Some corporate developer machines only allow installs to specific directories. Corporate software is blocking the pre-decided installation location.

Same here. Same here. Will I be able to choose the installation directory somewhen soon? Thanks.

+1
Is there any ongoing development regarding this?

Since the current version of Docker Desktop for Windows does not provide that option for installing to a custom path, you need to create a junction link before the installing, using the mklink command in cmd console.

C:>mklink /J “path\to\junction\link” “path\to\target\directory”

For your case, you can follow the following steps.

  1. Lets consider the current default installation path for docker is at C:\Program Files\Docker, and your target directory is at c:\Users\xxx\Docker , assuming the User Name is xxx. Note this target path could be on any drive such as E:\Docker, and you have to create the directory before creating the junction.

  2. Open cmd as an adminstrator and run
    mklink /J "C:\Program Files\Docker" "c:\Users\xxx\Docker"

  3. Go ahead and install Docker. The installer will think it’s installing to C:\Program Files\Docker but the files would actually be populated into c:\Users\xxx\Docker.

Cheers and be blessed.

3 Likes

Good idea but it only work on the same drive.
I want to install docker on another disk :frowning:

I’ve just finished installing the current version to my D: drive using mklink as above. I needed to link several folders to keep it off my near-full C: drive:

mklink /j "C:\ProgramData\Docker" "D:\ProgramData\Docker"
mklink /j "C:\ProgramData\DockerDesktop" "D:\ProgramData\DockerDesktop"
mklink /j "C:\Program Files\Docker" "D:\Program Files\Docker"
mklink /j "C:\Users\xxx\AppData\Local\Docker" "D:\Users\xxx\AppData\Local\Docker"

The link sources on C: will be created by mklink, so make sure they’re not already there. Conversely, it does not create the target folders, so you need to make sure they exist.

I don’t know if this is the best way to do it, but it’s what worked for me.

4 Likes

it works!!, thanks theeponymousbob

Thanks. It works.
I did the same for Users / [user] / AppData \ Roaming \ Docker Desktop and Users / [user] / AppData \ Roaming \ Docker

It works but this is a band aid solution.
We are in 2021, the installer should deal with this.

Please support Feature request: Let the user chose the installation folder · Issue #11876 · docker/for-win · GitHub

1 Like

Here is the official feature request.
Vote for it https://github.com/docker/roadmap/issues/94

1 Like

Here is a clear way on how to install in the default location and Move it to the target location.

i can no longer use this way
After creating a junction, the installer told this
Untitled2

Try this:
start /w “” “Docker Desktop Installer.exe” install --installation-dir=G:\Docker

7 Likes

Thank you very much. You just save me. It’s worked for me

It gives the “c:\programdata\dockerdesktop” cannot be a sylink error, but good method anyway.

It is incompetent and inconsiderate in any installer to not allow users to select a destination directory.

Many machines come pre-partitioned with the C: drive having barely enough space for Windows. I constantly need to go through my own C: drive to find things I can move or remove, and the moving often doesn’t work.

If a company wants to lock some installations to a specific location they can enforce that at policy level.

I spent hours trying to install DD on my D (development) drive, and none of the above worked.