How to install Nginx on CentOS Operating System

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

Specification:

OS Version: CentOs 8.2 x64
Nginx version: nginx/1.14.1

Update OS:

[root@bluegrid-edu ~]# yum update

Install nginx:

[root@bluegrid-edu ~]# yum install nginx

Start the service:

[root@bluegrid-edu ~]# systemctl start nginx

Make sure it’s running:

[root@bluegrid-edu ~]# systemctl status nginx
how to install nginx on centos | check status
systemctl status nginx

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

[root@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:

[root@bluegrid-edu ~]# curl -I https://bluegrid.io
HTTP/1.1 200 OK
Server: nginx/1.14.1
Date: Wed, 29 Jul 2020 20:02:26 GMT
Content-Type: text/html
Content-Length: 4057
Last-Modified: Mon, 07 Oct 2019 21:16:24 GMT
Connection: keep-alive
ETag: "5d9bab28-fd9"
Accept-Ranges: bytes

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