How to install Nginx on Xubuntu 16.04

How to install Nginx on Xubuntu 16.04

Besides apache web server, you can also use nginx (engine x) as web server on your xubuntu, if you prefer nginx over apache. In this article i will show you how to install nginx on xubuntu 16.04.

Before we start installing nginx on xubuntu, if you currently have apache web server running on your system, you need to stop it first, or you can uninstall it if you really want to switch to nginx completely.

stopping apache web server service
sudo service apache2 stop

Why you need to stop or uninstall apache web server before installing nginx? because two service can't use the same port, both apache and nginx use port 80 as default port.

Step by step how to install Nginx on xubuntu 16.04
  • open command line (press CTRL + ALT + T)
  • run this command to install nginx
  • sudo apt-get install nginx
  • the default port of nginx is same as apache web server which is port 80 (you can change this in the configuration file)
  • the default root directory of nginx is same as apache web server (you can change this in the configuration file)
  • /var/www/html/
  • the configuration file for nginx is located at
  • /etc/nginx/sites-enabled/default



How to start, stop, restart and check status of Nginx
  • stop nginx service
  • sudo service nginx stop
  • start nginx service
  • sudo service nginx start
  • restart nginx service
  • sudo service nginx restart
  • check the status of nginx service
  • sudo service nginx status

Share this

Previous
Next Post »