# How to Remove Old Docker Containers?

You may have found `docker rm` command to remove a docker container. However, this works only for a single container and it would be very painful to run this command for every non-running docker container. Luckily, since Docker 1.13 there is a more elegant solution.

## How to remove old Docker containers?

To remove all stopped containers, run the following command:

```bash
docker container prune
```

There is also system prune, which will clean up all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes, in one command.

```bash
docker system prune
```
