How to install nginx on Ubuntu 14.x server ?

Now days nginx is most powerfull web server because it is more resource-friendly than Apache in most cases. It can be used as a web server or a reverse proxy.

Install Nginx

we can install nginx on ubuntu server very eaisly because nginx package is available in ubuntu default repositories. Before install any package on server, first of all we should update our local package index on sever. To update local index on server use following command.

sudo apt-get update

Above command will update local package index on server. Now we’ll install nginx using following command.

sudo apt-get install nginx

This command will download latest nginx package and will install it on your server. After installing the nginx you can check it by visiting following url on webbrowser.


you will see output like below on your screen.


To add/upload files to server, Your default document root will be /usr/share/nginx/html/. you can add/update/upload files to this server.

Start/Stop/Restart Nginx

As you have sucessfully installed nginx server, Now we should also have knowledge of some basic commands required to manage nginx server

To start Nginx Server

sudo /etc/init.d/nginx start


sudo service nginx start

To Stop Nginx Server

sudo /etc/init.d/nginx stop


sudo service nginx stop

To stop and then start Nginx Server

sudo /etc/init.d/nginx restart


sudo service nginx restart

Now you have sucessfully installed nginx on your server, I will show you how to install php-fpm and its supporting libraries on server in next post. Stay tuned…

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Skip to toolbar