Where Are Docker Images Stored? Find Them on Linux, Windows and Mac

To find where Docker stores images, run docker info and look at the Docker Root Dir line. On Linux the default is /var/lib/docker, but fresh Docker Engine 29.0 and later installs keep image contents in /var/lib/containerd. On Windows and Mac, Docker Desktop keeps images inside a single virtual disk file: by default under C:\Users\[USERNAME]\AppData\Local\Docker\wsl on Windows, and at ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw on a Mac. To see the images themselves, run docker images.

This guide covers how to list your images, how to find the storage location on each system, how to check how much space images use, how to move the storage to another drive, and how to clean up safely.

Quick answer by system

SystemWhere images are storedHow to change it
Linux, Docker Engine with overlay2 (most upgraded installs)/var/lib/dockerdata-root in /etc/docker/daemon.json
Linux, Docker Engine 29.0+ fresh install (containerd image store)Image contents in /var/lib/containerd; volumes and other data in /var/lib/dockerroot in /etc/containerd/config.toml
Windows, Docker Desktop (WSL 2)A virtual disk under C:\Users\[USERNAME]\AppData\Local\Docker\wslSettings > Resources > Advanced
Mac, Docker Desktop~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.rawSettings > Resources > Advanced > Disk image location
Windows Server, Docker Engine (Windows containers)C:\ProgramData\dockerdata-root in C:\ProgramData\docker\config\daemon.json

Step 1: List the images on your system

Before looking for files, check which images Docker has. Open a terminal (on Windows, PowerShell or Windows Terminal) and run:

docker images

Docker’s docker image ls reference confirms that docker images, docker image ls and docker image list are the same command. In Docker 29 and later, the output shows each image’s name and tag, ID, disk usage and content size; older versions show separate REPOSITORY, TAG, IMAGE ID, CREATED and SIZE columns. For output that scripts can read reliably, use docker images --format json. Useful options:

OptionWhat it doesExample
-a, --allShows all images, including the intermediate and dangling images hidden by defaultdocker images -a
-q, --quietShows image IDs onlydocker images -q
-f, --filterFilters the listdocker images --filter reference=nginx
--formatFormats the output as a table, JSON or a Go templatedocker images --format json
--no-truncShows full image IDs instead of shortened onesdocker images --no-trunc
--digestsAdds each image’s digestdocker images --digests

To show only one repository, add its name: docker images nginx. This works the same in every shell. If you prefer piping, docker images | grep nginx works on Linux and Mac, but Command Prompt has no grep. In PowerShell, use docker images | Select-String nginx instead.

Step 2: Find Docker’s storage folder with docker info

Run docker info and look for these two lines:

  • Docker Root Dir: the folder where the Docker daemon keeps its data.
  • Storage Driver: how image layers are stored, such as overlay2 (classic store) or overlayfs (containerd image store) on Linux, or windowsfilter for Windows containers.

To show just the root folder, run docker info | grep "Docker Root Dir" on Linux or Mac, or docker info | Select-String "Docker Root Dir" in PowerShell. The docker info reference shows /var/lib/docker as the Linux example and C:\ProgramData\docker as the Windows example. For the full output as JSON, use docker info --format '{{json .}}'.

docker info output showing Docker Root Dir and Storage Driver
Docker Root Dir identifies Docker’s data directory, and Storage Driver identifies its storage backend. This filtered docker info recreation illustrates a classic overlay2 Linux store; fresh Engine 29 installs can use the containerd image store instead. No Docker command was run.

On Docker Desktop, the Docker Root Dir is a path inside Docker’s Linux virtual machine, not a folder on your Windows or Mac drive. The sections below show where that virtual machine’s disk lives.

Linux: /var/lib/docker or /var/lib/containerd

Docker’s daemon configuration guide gives /var/lib/docker as the default data directory on Linux. Where your images actually sit depends on which image store your install uses.

Classic storage driver (overlay2)

If your Docker Engine was installed before version 29.0 and then upgraded, it most likely still uses overlay2, and all data is stored in /var/lib/docker. Image layers are under /var/lib/docker/overlay2. Docker’s guide to selecting a storage driver calls overlay2 the most widely compatible driver across currently supported Linux distributions. Older drivers such as Device Mapper and aufs have been removed from current Docker Engine releases, so they aren’t an option on a current install.

Containerd image store (fresh Engine 29.0+ installs)

Docker’s containerd image store page says this store is the default storage backend for Docker Engine 29.0 and later on fresh installations. With it, image contents and container snapshots are stored in /var/lib/containerd, while volumes and other Docker data stay in /var/lib/docker.

To check which store you’re using, run:

docker info -f '{{ .DriverStatus }}'

If the output includes io.containerd.snapshotter.v1, you’re on the containerd image store.

Rootless Docker

If you run Docker in rootless mode, the daemon uses its own settings file at ~/.config/docker/daemon.json, and its data folder is different from the system default. Run docker info as your user to see the exact path.

Windows: Docker Desktop with WSL 2

Docker Desktop on Windows runs Linux containers inside a WSL 2 virtual machine, so your images are inside a virtual disk file, not in a normal folder. Docker’s Docker Desktop WSL 2 page says that by default it stores the data for the WSL 2 engine at C:\Users\[USERNAME]\AppData\Local\Docker\wsl. Inside that folder you’ll find one or more .vhdx virtual disk files. The exact file and subfolder names vary by Docker Desktop version.

To see or change the location in the app:

  1. Open Docker Desktop and select Settings (the gear icon).
  2. Go to Resources > Advanced.
  3. Check the disk image location. To move it, choose a new folder, then apply the change. Docker Desktop may restart.
Docker Desktop settings showing the disk image location
Check Disk image location under Docker Desktop Settings > Resources > Advanced. This recreated setting detail shows an example WSL data directory with the user name hidden. The actual path and available controls depend on your backend and Docker Desktop version; no files, containers or settings were changed.

Docker’s Docker Desktop settings reference describes Disk image location as the location of the Linux volume where containers and images are stored, and Disk usage limit as the maximum disk space the engine can use. The labels may differ slightly between versions.

Some older guides point to C:\ProgramData\DockerDesktop. That location belongs to the legacy Hyper-V backend. Current Docker documentation uses the WSL 2 path above. C:\ProgramData\docker is the data folder for Docker Engine running Windows containers, such as on Windows Server, not Docker Desktop’s Linux images.

Mac: the Docker.raw disk image

Docker’s Docker Desktop for Mac FAQ explains that images and containers are stored in a single, large disk image file at:

~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

  1. Open Docker Desktop and go to Settings > Resources > Advanced.
  2. Look at Disk image location. This section also shows the maximum size and how much space is actually in use.
  3. To move the file, select Browse, pick a new folder, and apply the change.

Don’t move Docker.raw in Finder; use the setting so Docker Desktop knows where it went. Finder may report the file’s maximum size rather than its real size. To see the space it actually uses, open Terminal in that folder and run ls -klsh Docker.raw.

Should you use docker image inspect to find an image?

Some guides tell you to run docker image inspect and read the GraphDriver > Data section. On a Linux install that uses overlay2, those paths point to layer folders under /var/lib/docker/overlay2. They have limits, though:

  • On Docker Desktop, the paths are inside the Linux virtual machine. You won’t find them on your Windows or Mac drive.
  • With the containerd image store, image contents are kept under /var/lib/containerd, so GraphDriver output doesn’t match the overlay2 folder layout.

For most tasks you don’t need the raw files. To copy an image to another computer, export it with docker save and import it with docker load rather than copying folders.

Check how much space Docker images use

Run docker system df. Docker’s docker system df reference says it shows how much disk space the Docker daemon uses, split into images, containers, local volumes and build cache. Add -v (docker system df -v) for a per-image breakdown. An image’s size is its shared size (layers it shares with other images) plus its unique size, so adding up the sizes from docker images can overstate the real total.

Move Docker’s storage to another drive

Linux

  1. Stop Docker: sudo systemctl stop docker
  2. Edit /etc/docker/daemon.json (create it if it doesn’t exist) and add the new folder, for example: { "data-root": "/mnt/docker-data" }
  3. Start Docker: sudo systemctl start docker
  4. Run docker info and confirm the Docker Root Dir shows the new path.

Existing images aren’t moved for you. Either copy the old data into the new folder while Docker is stopped, or pull your images again. The daemon guide also notes that data-root doesn’t move /var/lib/containerd. If you use the containerd image store, set root = "/mnt/containerd-data" in /etc/containerd/config.toml as well. Don’t point two Docker daemons at the same folder, such as a shared network drive; Docker warns this causes errors that are difficult to troubleshoot.

Windows and Mac

Use Settings > Resources > Advanced in Docker Desktop, as shown above. Don’t move the virtual disk file by hand.

Clean up images safely

  • docker image prune removes dangling images (untagged layers left behind by rebuilds).
  • docker image prune -a removes all images that no container uses. Docker warns that this removes all images without at least one container associated to them.
  • docker image prune -a --filter "until=24h" removes only unused images older than 24 hours. Add -f to skip the confirmation prompt.
  • docker rmi IMAGE removes one image by name or ID.
  • docker system prune also removes stopped containers, unused networks and build cache.

The docker image prune reference lists all the filters. Removing an image you pulled from a registry isn’t permanent: you can pull it again. Images you built locally and never pushed are gone unless you rebuild them or saved them with docker save.

Never delete files inside /var/lib/docker, /var/lib/containerd or the Docker Desktop disk image by hand. Docker tracks those files in its own records, and removing them directly can break images and containers. Always use the commands above.

Troubleshooting

  • Images disappeared after a settings change. Switching storage drivers or image stores hides images stored with the other one. Docker’s OverlayFS storage driver page warns that changing the storage driver makes existing containers and images inaccessible on the local system. Switch back to see them again. On Docker Desktop, the switch is Settings > General > Use containerd for pulling and storing images, which Docker’s containerd image store for Docker Desktop page says is on by default.
  • The folder from GraphDriver doesn’t exist. You’re probably on Docker Desktop, where it’s inside the virtual machine, or on the containerd image store.
  • /var/lib/docker is nearly empty. Check /var/lib/containerd, or run docker info in case data-root was changed.
  • Permission denied when opening the folder. /var/lib/docker is owned by root. Use sudo to look, but make changes with Docker commands.
  • The Windows disk file is still large after cleanup. Pruning frees space inside the virtual disk, but the .vhdx file may not shrink right away.

Docker Desktop on Windows usually runs inside WSL 2, which appears as Vmmem in Task Manager. If it uses too much memory, see how to stop Vmmem and set memory limits.

If you build Java images, you may also need to set JAVA_HOME and the Java path in Windows 11 on the host.

Questions

Can I open a Docker image like a normal folder?

Not really. An image is a stack of layers plus metadata, stored in Docker’s own format. To look inside one, run a container from it, or export it with docker save and open the tar file.

Why is Docker using more disk space than my images?

Containers, volumes and build cache also take space. Run docker system df to see each category, then clean up with the prune commands.

Where are Docker volumes stored?

On Linux, volumes stay under /var/lib/docker even when you use the containerd image store. On Docker Desktop, they’re inside the same virtual disk as your images.

About the author

Matt Williams is the writer and editor behind TechInfoHome. He holds a degree in computer science and has more than 10 years of experience working in IT. More about TechInfoHome.