To completely uninstall NGINX from your system, follow the appropriate instructions based on your operating system:

For Ubuntu/Debian-based systems:

  1. Stop the NGINX service:

    sudo systemctl stop nginx
    
  2. Disable the NGINX service (so it doesn’t start on boot):

    sudo systemctl disable nginx
    
  3. Remove NGINX and its dependencies: Run the following command to remove the NGINX package:

    sudo apt-get purge nginx nginx-common nginx-full nginx-core
    
  4. Remove any unused dependencies: After removing NGINX, you can clean up any unused packages: