Change default storage location of docker containers on Ubuntu 18.04 and 18.10

This was tested on Docker version 18.09.4, build d14af54266, it includes ALL docker data.

Just edit/create a file inside /etc/docker named daemon.json and add the following:

{
"data-root": "/new_location"
}

then simply restart docker:

sudo service docker restart

Source:

https://docs.docker.com/engine/reference/commandline/dockerd/

Unknown's avatar

About Ahmed Tawfik

Cybersecurity Professional, Systems Engineer, OSS & Linux Geek
This entry was posted in docker and tagged , , , , . Bookmark the permalink.

Leave a comment