March 31, 2020
install-nginx-ubuntu-18.04

How to install Nginx on Ubuntu 18.04

Nginx – pronounced “Engine X” – is an open-source web server BSD license Software. It is widely used for load balancing, reverse proxy and caching features. It is based on the asynchronous architecture which made it the most popular and best-performing web servers.

Prerequisites

  1. A dedicated server or a VPS (Virtual Private Server ) with Ubuntu 18.04.
  2. You should have root access of the server.

Step 1: Installing Nginx

The best way to install the Nginx on Ubuntu is to use the version included in Ubuntu’s default repository.

 sudo apt update
 sudo apt install nginx

This command will first update your software packages and then install Nginx.

once you have installed it, the Nginx service should start automatically and will be enabled to start at boot time, you can check if it’s up and running.

 sudo systemctl status nginx

Step 2 – Adjusting the Firewall

If you have firewall running on your system, then you will will have to open the port 80 (HTTP) and 433 (HTTPS) to listen the client requests.

Commands to enable the ports are as follows:-

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw reload

Now, test your Nginx status is showing on your web browser, type your server ip address you will see the Nginx default web page.

Congrats you have sucessfully installed Nginx on your Ubuntu Server.

Vedant Singh

Linux System Administrator | Entrepreneur | Founder Techmion. I have started my career as a Linux system Administrator after that quit my job to start something new that excites me and started a Tech Company in order to provide the best technology to my clients. My Company website link: https://www.techmion.com/ For Bulk, SMS-Marketing follows the link : https://www.pingsms.in/

View all posts by Vedant Singh →

Leave a Reply

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