# Delete containers after stopping

**URL:** <https://forums.suse.com/t/delete-containers-after-stopping/822>\
**Category:** Rancher 1.x\
**Created:** [October 30, 2015, 1:01am UTC](https://forums.suse.com/t/delete-containers-after-stopping/822 "2015-10-30T01:01:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![astanciu](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/astanciu/32/435_2.png) [@astanciu](https://forums.suse.com/u/astanciu)\
**Post date:** [October 30, 2015, 1:01am UTC](https://forums.suse.com/t/delete-containers-after-stopping/822/1 "2015-10-30T01:01:32Z")

</div>

Is there any way to have Rancher delete a container off of the host after the container is stopped? After a few hours of playing around scaling things up and down, my host is totally polluted with old containers.

---

<div class="post-metadata">

**Author:** ![sshipway](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/sshipway/32/397_2.png) [@sshipway](https://forums.suse.com/u/sshipway)\
**Post date:** [October 30, 2015, 3:12am UTC](https://forums.suse.com/t/delete-containers-after-stopping/822/2 "2015-10-30T03:12:47Z")

</div>

On our system at least (0.43.1), the deleted containers seem to automatically purge themselves after a little time. Not sure how much time it takes, but I deleted a couple an hour or so ago which went into deleted state, and they’re not there now.

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [October 30, 2015, 7:30am UTC](https://forums.suse.com/t/delete-containers-after-stopping/822/3 "2015-10-30T07:30:03Z")

</div>

A stopped container won’t get removed from the host. You need to remove them from Rancher server to have them purged from the host.

---

<div class="post-metadata">

**Author:** ![astanciu](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/astanciu/32/435_2.png) [@astanciu](https://forums.suse.com/u/astanciu)\
**Post date:** [October 30, 2015, 3:30pm UTC](https://forums.suse.com/t/delete-containers-after-stopping/822/4 "2015-10-30T15:30:18Z")

</div>

I guess it would be nice to have a button on the Host panel that did something like  
`docker rm $(docker ps -a -q)`

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [October 30, 2015, 5:03pm UTC](https://forums.suse.com/t/delete-containers-after-stopping/822/5 "2015-10-30T17:03:11Z")

</div>

I created this issue as an enhancement request.

> <https://github.com/rancher/rancher/issues/2485>
>
> Based on http://forums.suse.com/t/delete-containers-after-stopping/822/3
> It would be nice if the host had a button that would delete all stopped containers on the host.
> The...
