# How to uninstall/remove docker and discourse

**URL:** https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777
**Category:** Self-hosting
**Created:** [2015 年3 月 25 日 17:53 UTC](https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777 "2015-03-25T17:53:54Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![rnovino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rnovino/32/115865_2.png) [@rnovino](https://meta.discourse.org/u/rnovino)
#### Post date: [2015 年3 月 25 日 17:53 UTC](https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777/1 "2015-03-25T17:53:54Z")

</div>

I need to reinstall all the package and files of the docker and discourse since I am having an issue with nginx how do I fully removed the file ?

---

<div class="post-metadata">

### Author: ![pl3bs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pl3bs/32/37266_2.png) [@pl3bs](https://meta.discourse.org/u/pl3bs)
#### Post date: [2015 年3 月 25 日 18:38 UTC](https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777/2 "2015-03-25T18:38:36Z")

</div>

Are you sure the issue is with nginx? Did you ever go into a docker container directly and muck with nginx? If you only messed with things outside the container, it would perhaps be best to figure out what happened and correct it. If you really want to delete it all, make a backup first if you have a live forum with content. You can simply ssh into your instance and perform these commands to wipe it all out:

```
sudo apt-get remove docker* 
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/www/discourse -R

```

That will remove the data, and docker application.

---

<div class="post-metadata">

### Author: ![rnovino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rnovino/32/115865_2.png) [@rnovino](https://meta.discourse.org/u/rnovino)
#### Post date: [2015 年3 月 25 日 18:52 UTC](https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777/3 "2015-03-25T18:52:36Z")

</div>

its oks coz its my first installation. so I havent started the forum yet

---

<div class="post-metadata">

### Author: ![rnovino](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rnovino/32/115865_2.png) [@rnovino](https://meta.discourse.org/u/rnovino)
#### Post date: [2015 年3 月 25 日 19:41 UTC](https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777/4 "2015-03-25T19:41:19Z")

</div>

weird still can’t make it work ☹ [http://tips.pinoyscreencast.net/](http://tips.pinoyscreencast.net/)

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [2015 年3 月 25 日 23:31 UTC](https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777/5 "2015-03-25T23:31:14Z")

</div>

Always quote anything containing asterisks or the shell might replace it with a matching filename.

Also, the data is stored in `/var/discourse` and it might not delete any images or containers docker has created or downloaded; those should live in `/var/lib/docker`, but that’s a blind guess. (They’d not hinder or affect a new installation anyway, just fill up some disk space.)

And does `apt-get` know that it needs to stop containers and the docker daemon itself before uninstalling the package?

---

<div class="post-metadata">

### Author: ![pl3bs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pl3bs/32/37266_2.png) [@pl3bs](https://meta.discourse.org/u/pl3bs)
#### Post date: [2015 年3 月 25 日 23:39 UTC](https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777/6 "2015-03-25T23:39:57Z")

</div>

> [@elberet](#):
>
> Always quote anything containing asterisks or the shell might replace it with a matching filename.[/quote]
> 
> Good practice. Thanks.
> 
> > [@](#):
> >
> > Also, the data is stored in `/var/discourse` and it might not delete any images or containers docker has created or downloaded; those should live in `/var/lib/docker`, but that’s a blind guess. (They’d not hinder or affect a new installation anyway, just fill up some disk space.)
> 
> Very good as well.
> 
> [quote]And does `apt-get` know that it needs to stop containers and the docker daemon itself before uninstalling the package?

I’m not sure that matters if it’s being uninstalled.

---

<div class="post-metadata">

### Author: ![elberet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elberet/32/122404_2.png) [@elberet](https://meta.discourse.org/u/elberet)
#### Post date: [2015 年3 月 26 日 00:01 UTC](https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777/7 "2015-03-26T00:01:55Z")

</div>

As I said, I have no idea what `apt-get` does in this case. Sure, it can certainly delete all the files, but quite a few processes might keep running until you manually kill them or reboot… and if the docker daemon is still listening on port 80, you’d run into errors if you tried to install a different webserver or reinstall docker and Discourse.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2015 年3 月 26 日 06:50 UTC](https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777/8 "2015-03-26T06:50:45Z")

</div>

> [@elberet](#):
>
> And does apt-get know that it needs to stop containers and the docker daemon itself before uninstalling the package?

Yeah, there are hooks in the .deb files to do that. They figured all that stuff out a while ago.

Though `apt-get purge` is what to use if you also want to remove configuration files and data.

---

<div class="post-metadata">

### Author: ![Harri\_Luuppala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/harri_luuppala/32/122111_2.png) [@Harri\_Luuppala](https://meta.discourse.org/u/Harri_Luuppala)
#### Post date: [2015 年11 月 25 日 12:59 UTC](https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777/9 "2015-11-25T12:59:31Z")

</div>

See commands from:

> **[Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)**
>
> Jumpstart your client-side server applications with Docker Engine on Ubuntu. This guide details prerequisites and multiple methods to install Docker Engine on Ubuntu.

---

<div class="post-metadata">

### Author: ![jack2](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jack2](https://meta.discourse.org/u/jack2)
#### Post date: [2017 年2 月 24 日 17:29 UTC](https://meta.discourse.org/t/how-to-uninstall-remove-docker-and-discourse/26777/10 "2017-02-24T17:29:14Z")

</div>

Putting all together, this is what I did (and it seemed to work):

```plaintext
sudo apt-get purge docker-engine
sudo rm -rf /var/lib/docker
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/discourse -R

```
