How to completely remove NGINX server from Ubuntu

After removing nginx server, sometimes you might wonder that it still runs on /var/www/html folder when you run http://localhost in your browser.

In this article, we will discuss how to completely remove Nginx server from Ubuntu.

In your Terminal, first run the below command to install nginx config files and remove from Ubuntu.

sudo apt-get purge nginx nginx-common

After running the above command, use below command in order to remove all dependencies used by nginx which are no longer required.

sudo apt-get autoremove

Further, you can also remove nginx config files which are not required.

rm -rf /etc/nginx

This way, you can completely remove nginx web server from Ubuntu system.