The following line of command help you clear the all the docker containers including currently running and also which are in the exited status too docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q) OR docker rm --force $(docker ps -a -q)