NGINX / Server Setup

How to install latest stable NGINX on CentOS/RHEL 8 properly

by , , revisited on


We have by far the largest RPM repository with NGINX module packages and VMODs for Varnish. If you want to install NGINX, Varnish, and lots of useful performance/security software with smooth yum upgrades for production use, this is the repository for you.
Active subscription is required.

Follow these instructions on how to install the latest stable NGINX web server in CentOS/RHEL 8 server.

Step 1. Prepare your system

First things first. You have to upgrade your RHEL / CentOS 8 to the latest release:

dnf -y upgrade

Step 2. Setup RPM repository

The latest stable NGINX can be found in GetPageSpeed (extras.getpagespeed.com) repository.

This repository is a CDN powered repository and builds on exact same binaries released by official nginx.org website.

More than that, the GetPageSpeed repository holds many dynamic NGINX modules. So you can install both the base nginx package as well as all the amazing modules for it.

To setup GetPageSpeed repository, run

sudo dnf -y install https://extras.getpagespeed.com/release-latest.rpm

Step 3. Install NGINX

Install NGINX in CentOS/RHEL 8:

sudo dnf -y install nginx

Step 4. Install optional NGINX modules

NGINX is very flexible because it has support for loading dynamic modules. You can choose from over a hundred available NGINX module packages.
For example, to install the Brotli module package, you’d run:

sudo dnf -y install nginx-module-nbr

Then all that’s left is to configure Brotli compression in NGINX.

Run NGINX

Now we are ready to run NGINX:

systemctl start nginx

And don’t forget to enable it at boot time:

systemctl enable nginx

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: