March 28, 2024
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 Kumar

Currently I'm working as an Implementation Engineer, Started my career as an System Administrator - Linux. Additionally loves to explore new technologies and research about new open-source software that ease the development cycle.

View all posts by Vedant Kumar →

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.

close

Ad Blocker Detected!

VEDANT EXPLAINS
We've noticed that you are using an ad blocker. Advertising helps fund our server cost and keep it truly independent. It helps to build our content creator team. So please disable your ad blocker, and help us to keep providing you with free- great content - for free. Thank you for your support.

Refresh