Nginx / Server Setup

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

by , , revisited on


We have by far the largest RPM repository with dynamic stable NGINX modules and VMODs for Varnish 4.1 and 6.0 LTS. If you want to install nginx, Varnish and lots of useful modules for them, this is your one stop repository to get all performance related software.
You have to maintain an active subscription in order to be able to use the repository!

Follow these instructions on how to install the latest stable NGINX web server in RHEL 8 / CentOS 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

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, 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-el8-latest.rpm

Step 3. Install NGINX

Install NGINX with:

sudo dnf -y --disablerepo=rhel-8-for-x86_64-appstream-rpms install nginx

Take note of the --disablerepo=rhel-8-for-x86_64-appstream-rpms. This is required for the following reasons:

  • RHEL 8 ships with stream repository with older NGINX version
  • dnf has a preference towards stream packages unless a repository holding them is disabled

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

Also published on Medium.

Leave a Reply

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