How to install Nginx on Ubuntu VM

Nitesh Kumar Singh
3 min readAug 17, 2019

Today i gonna so you how to install Nginx in ubuntu.

It’s just take some time to install and ready with nginx installation.

Why i have chosen system with linux because it’s great OS that gives you flexibility to run all the opensource application that’s been heavily used in industry. If you are windows user then its good run VM.

So fist boot up Ubuntu or any linux machine.

$ sudo apt-get update -y

then install nginx

$sudo apt-get install nginx

If you are setup with nginx then we will setup the firewall as well.

Managing Firewall

To check the firewall status we will run ufw command to check the Firewall status.

$ sudo ufw app list

Output will be given as below

Output

then check the firewall status by running below command.

$sudo ufw status

Output will be given as below

Output

Enable ufw by running below command.

$sudo ufw enable

Output will be given below

Output

Now enable the nginx traffic

We will start with HTTP.

$sudo ufw allow ‘Nginx HTTP’

Output will be given as below

Output

HTTPS (Secure production recommended )

$sudo ufw allow ‘Nginx HTTPS’

Now Status time

$sudo ufw status

Output will be given as below

Output

Let’s find our Nginx Web Server

Let’s checkout nginx services is running or not by below command

$systemctl status nginx

Output will be given as below

Output

Now we can access page and find out if service is running or not by vising to http://localhost or http://default_ip

Output will be given as below

Output

🤣🤣🎈🎈Nginx in linux box set up complete.🎈🎈😁😁

Next article i will show you how to run wordpress with nginx server.

--

--