How to uninstall Nginx completely in Linux Ubuntu?

Problem definition

Sometimes, we need to uninstall nginx server and also need to remove all the config files. But, it may not remove the config files automatically at first go. So, here I am going to explain all the steps from uninstalling to removing everything.

Solution to uninstall Nginx

First, use the following command:

sudo apt-get remove nginx nginx-common

The above command uninstalls the Nginx but keeps all the config files.

To remove all the configuration files we have another command:

Remove all the config files

sudo apt-get purge nginx nginx-common

The above command should remove everything.

If you want to remove all the dependency that was used by the Nginx which may not be required. Then you can use the following command. (Optional)

sudo apt-get autoremove


Hence, we are able to uninstall Nginx server and its config files.


5 thoughts on “How to uninstall Nginx completely in Linux Ubuntu?”

  1. Hello! I just want to give a huge thumbs up for the good information you’ve got here on this post. I might be coming back to your blog for extra soon.

  2. When I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a remark is added I get 4 emails with the same comment. Is there any means you can remove me from that service? Thanks!

    • Thanks for letting me know. I am checking it and will let you know. I can see two different emails. Which email should I use to reach out? Sorry for the inconvenience. Thanks

  3. Good post. I be taught something more challenging on completely different blogs everyday. It is going to always be stimulating to read content material from other writers and apply somewhat one thing from their store. I抎 prefer to make use of some with the content on my blog whether or not you don抰 mind. Natually I抣l offer you a hyperlink on your web blog. Thanks for sharing.


Leave a Comment