How to install Nginx on CentOS Operating System

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


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


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
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
Share this post

Share this link via

Or copy link