I try to run the following script but dockerd is not recognized in my workstation.

My OS is windows 10. Just installed the latest version of docker that is 18.09.2

It is my first time with docker.

3 Answers 3


This answer is more an addition at Jean-François Beauchamp's answer :
You can find full documentation about this config file on Docker's documentation.

It is stated :

--data-root is the path where persisted data such as images, volumes, and cluster state are stored.


--exec-root is the path where the container state is stored. The default value is /var/run/docker. Specify the path for your running daemon here.

So if you want to move both your containers and images (and the other stuff), you have to set both of these parameter.

You can also create a simple link where Docker expects its folder to redirect to the desired place.
It is described here and lead to the same result. It looks "dirty" but in the end it looks more stable than the first solution.

Working with WSL 2 engine (for Windows Home and Family Editions)

"D:\\Docker\\data-root" value as suggested by Miguel will crash Docker because it has to be a WSL folder.
However, Docker create a specific WSL distro which contains your docker data, and you can move it. This does not require to modify dockerd parameters.

To move docker's WSL distro

 wsl --export docker-desktop-data docker-desktop-data.tar
 wsl --unregister docker-desktop-data
 wsl --import docker-desktop-data X:\wslStore\ docker-desktop-data.tar --version 2

The X:\wslStore param is the path where you want to "mount" your Distro, something like D:\Docker\data-root

  • I used the WSL 2 approach and my data in c:\Users\...\AppData\Local\Docker\wsl\data was indeed move to the new location. I still have data in ...\Docker\wsl\distro that I would also like to move. Can I do that using the same procedure? Sep 9, 2020 at 14:27
  • Do you mean that you want to move the distro "docker-desktop-data" aswell ? If yes than I think you can use the same procedure
    – Maskim
    Sep 9, 2020 at 14:38
  • I moved both of them now and it seems to work fine! :) Sep 10, 2020 at 15:45
  • The biggest part (mostly images) are stored in docker-desktop-data so I didn't mention moving docker-desktop but I'm glad it worked ! :)
    – Maskim
    Sep 11, 2020 at 6:39
  • 1
    thx a lot for describing WSL 2 May 6, 2021 at 16:27

On Docker v19.03.8 for Windows, I added the graph parameter to my config, and it worked for me, but apparently, this parameter is deprecated and we should now use data-root instead. The default value for data-root is c:\programdata\docker. Beware that in the JSON configuration file the backslashes need to be escaped.

enter image description here


Find other way to do it based on this post.

For Unix containers, the path for images can be changed by Docker Desktop interface, at settings form. But if you use the windows containers feature then a second service is installed, the "Docker Engine". To change the image folder for this service do the following steps:

1) Get the path to the config file. Go to Administrative tools->Services. Check docker demon command line for service "Dock Engine"

enter image description here

The command line is something like

"C:\Program Files\Docker\Docker\Resources\dockerd.exe" --run-service --service-name docker -G myPc" --config-file C:\ProgramData\DockerDesktop\tmp-d4w\daemon.json

2) Edit the config file daemon.json and add the data-root property.Property value should point to desired location. Should look something like this. Check this for information on json structure.

  "registry-mirrors": [],
  "insecure-registries": [],
  "debug": true,
  "experimental": false,
  "hosts": [


If necessary, give permissions for the running account to access the folder.

3) restart the service. If doesn't start, check eventlog for possible errors.

Previous configured data in c:\ProgramData\Docker will be lost when you change the install location. It’s like a new install to a new location. (images, containers, etc). All sub folders will be created again.

To keep the minimum on system drive do this on a fresh install.

I am not 100% sure about this solution, but so far, docker is working fine and system drive occupation is slim.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .