CentosControl PanelCWPLinux

Update Nginx to latest official Version in Centos 8/el8/CWP

Today we’re going to update nginx in centos 8 which by default installs an old version of nginx webserver and I’m on the way of finding an answer why devs did that. If you check the nginx version you’ll see nginx 1.14.1 or other old version is installed at the time of writing this topic :

[root@CentOS-82-64-minimal scripts]# yum list nginx
Last metadata expiration check: 0:01:18 ago on Tue 20 Oct 2020 06:26:38 PM CEST.
Installed Packages
nginx.x86_64                    1:1.14.1-9.module_el8.0.0+184+e34fea82                    @AppStream
[root@CentOS-82-64-minimal scripts]# nginx -v
nginx version: nginx/1.14.1

So we’ll going to update it today and disable this old version of nginx.

Step 1

Disable old version and uninstalling it :

dnf module disable nginx php
dnf remove nginx*

Step 2

Adding Nginx Stable official repo :

*you can add mainline repo too but not recommended in production environment

edit /etc/yum.repos.d/nginx.repo and remove any content there follow this commands one by one :

> /etc/yum.repos.d/nginx.repo
nano /etc/yum.repos.d/nginx.repo

then add this content and save it :

[nginx]name=nginx repo

Step 3

Install nginx :

yum install nginx

thats it you installed the latest version of nginx chekc via this command :

nginx -V

CWP Users :

Extra tips for CWP user after installing nginx rebuild webserver config and you’re done.

Sandeep B.

I'm a system admin and php developer and currently working as System Admin In CWP Control panel, expertise in Linux and Windows administration RHEL certified admin.

Related Articles


  1. I have installed nginx pagespeed as per your other artile.

    Buy I get the error

    nginx: [emerg] module “/etc/nginx/modules/ngx_pagespeed.so” version 1020000 instead of 1020001 in /etc/nginx/nginx.conf:1

Leave a Reply

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

Back to top button