Skip to content

How to remove all Docker images at once

Sometimes it is necessary to remove all Docker images or containers on your machine. Here is how it goes. It's pretty easy.



You use Docker. You have created a bunch of containers and images over time that you want to get rid of all at once.


Attention: This will delete all your images or containers. It is not possible to restore them.

# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)