How to install Nginx on Ubuntu Operating System

Let’s jump right into it | how to install Nginx on ubuntu! 

Specification:

OS Version: Ubuntu Os 18.04.3 (LTS) x64
Nginx version: nginx/1.14.0

Update OS:

bluegrid-edu:~# apt-get update

Install nginx:

bluegrid-edu:~# apt-get install nginx

Make sure it’s properly installed:

bluegrid-edu:~# systemctl status nginx
how to install nginx on ubuntu | check status
systemctl status nginx

Let’s just make sure it start automatically when the server is rebooted:

bluegrid-edu:~# systemctl enable nginx
how to install nginx on ubuntu | enable nginx
systemctl enable nginx

Voila!

Now we have the Nginx installed and running. We can confirm that it serves the HTTP properly with the following command:

bluegrid-edu:~# curl -I localhost
how to install nginx on ubuntu | test via curl
Testing Nginx response via curl command

Ivan Dabić

A man with a beard and glasses, wearing an orange hoodie and a black cap with a Hard Rock Cafe logo, stands with his arms crossed against a plain white background.

Ivan Dabić

Co-founder and CEO of BlueGrid.io, with a background in cloud infrastructure, distributed systems, monitoring, and security operations. He works closely with engineering teams to build and operate reliable systems while documenting both technical and organizational aspects of modern engineering work.

Ivan is a metalhead, and big fan of cyberpunk move genre. If you are his secret Santa go with Star Wars Lego box!

Share this post

Share this link via

Or copy link