How to Install Nginx on Ubuntu 14.04 LTS
nginx is a free, open source, high-performance web server. Need HTTP and HTTPS but don’t want to run Apache? Then nginx may be your next go-to, at least for Linux.
Pre-Flight Check
- These instructions are intended specifically for installing nginx on Ubuntu 14.04 LTS.
- I’ll be working from a Liquid Web Self Managed Ubuntu 14.04 server, and I’ll be logged in as root.
Step #1: Install nginx
First, you’ll follow a simple best practice: ensuring the list of available packages is up to date before installing anything new.
apt-get -y update
Then it’s a matter of just running one command for installation via apt-get:
apt-get -y install nginx
Step #2: Find Your IP Address; Visit Your Site
Once the installation is complete the nginx service should automatically start and begin listening on port 80.
Find your server’s IP address run the following command:
ip addr show eth0 | grep inet
In this case we are assuming that eth0 is configured with the primary public IP of your server. Your result may look similar to:
inet xxx.xxx.xxx.xxx/22 brd yyy.yyy.yyy.yyy scope global eth0
Where xxx.xxx.xxx.xxx is the IP address of your server.
Verify that nginx is running by visiting http://xxx.xxx.xxx.xxx. For example: http://1.2.3.4.
You should receive a page similar to:

Step #3: Manage the nginx Service
Start the nginx Service:
service nginx start
Stop the nginx Service:
service nginx stop
Restart the nginx Service:
service nginx restart
Check the Status of the nginx Service:
service nginx status
Assure that nginx starts at boot:
update-rc.d nginx defaults
When running the last command you may receive:
System start/stop links for /etc/init.d/nginx already exist.
The above error simply means that nginx is already configured to start when the server boots.
Related Articles:

About the Author: J. Mays
As a previous contributor, JMays shares his insight with our Knowledge Base center. In our Knowledge Base, you'll be able to find how-to articles on Ubuntu, CentOS, Fedora and much more!
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.
Latest Articles
How to Install Adminer MySQL Database Management Tool on AlmaLinux
Read ArticleWhat is CGI-Bin and What Does it Do?
Read ArticleTop 10 Password Security Standards
Read ArticleTop 10 Password Security Standards
Read ArticleHow to Use the WP Toolkit to Secure and Update WordPress
Read Article