How to Enable the Remi Repo on RHEL, Rocky, Alma and CentOS

Install and enable the Remi repository on RHEL, Rocky Linux, AlmaLinux and CentOS Stream 8, 9 and 10, then install PHP 8.4 or 8.5 from a Remi module stream.

Remi’s RPM repository is a free and stable RPM repository, maintained by Remi Collet, mainly for the PHP stack. It contains packages for the latest versions of PHP — far newer than the ones your distribution ships. It works on Fedora and on every current Enterprise Linux: RHEL, Alma Linux, Rocky Linux and CentOS Stream 8, 9 and 10, plus other clones.

Quick answer: on Alma Linux, Rocky Linux, CentOS Stream or RHEL 8, 9 or 10, enable EPEL and CRB, install Remi’s release package for your release, then pick a PHP stream:

sudo dnf install epel-release
sudo crb enable
sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-$(rpm -E %rhel).rpm
sudo dnf module reset php
sudo dnf module enable php:remi-8.4
sudo dnf install php php-cli

$(rpm -E %rhel) expands to your major release (8, 9 or 10). On RHEL itself epel-release is not in the default repositories; install it from the EPEL URL instead. The sections below explain each step, plus the Software Collection alternative for running two PHP versions side by side.

Still on CentOS Linux 6, 7 or 8? Those releases are end of life and Remi no longer updates their repositories. Read the migration path first.

You are on EOL CentOS: the migration path

CentOS Linux is end of life — CentOS 8 on 31 December 2021 and CentOS 7 on 30 June 2024 — and Remi has followed suit. In February 2026 the repositories for Enterprise Linux 7 and older were closed, and those for EL 6 and older were moved to the Remi archives. No new packages, no security updates.

If your server is CentOS 6, 7 or 8, no repository configuration will get you security updates again — the distro itself is dead, and a newer PHP only treats the symptom. Move to a supported Enterprise Linux first, then come back and enable Remi on it:

Once you are on a supported release, the EL 8/9/10 instructions below apply as written.

Prerequisites

To follow along this guide, ensure you have the following:

  • An Enterprise Linux server (RHEL, CentOS Stream, Alma Linux or Rocky Linux 8/9/10) with root access or a user who can execute sudo commands
  • Internet access
  • Many packages in the Remi repository depend on EPEL, so enable it first. See How to Enable EPEL on Rocky, AlmaLinux and RHEL 8, 9 and 10, or install it directly:
sudo dnf install epel-release
  • Some Remi packages also need the CodeReady Builder (CRB) repository, which provides build-time dependencies. The crb helper ships with epel-release:
sudo crb enable

Enabling the remi repo

To enable the remi repo, install the rpm provided by remi at this url https://rpms.remirepo.net/enterprise/remi-release-<version>.rpm, version being the Enterprise Linux release version.

Example:

For RHEL 8/Alma Linux 8/Rocky Linux 8:

sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

For RHEL 9/CentOS Stream 9/Alma Linux 9/Rocky Linux 9:

sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm

For RHEL 10/CentOS Stream 10/Alma Linux 10/Rocky Linux 10:

sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-10.rpm

Use dnf install <url> rather than rpm -ivh <url> — dnf resolves dependencies and imports the GPG key for you, which bare rpm does not.

Legacy releases (EL 5, 6 and 7)

These are kept for readers maintaining old systems. They are no longer supported and you should not build anything new on them — if this is your server, take the migration path above.

The EL 5 and EL 6 release packages have been removed from the main repository — the URLs below now return 404 — and only exist under rpms.remirepo.net/archives/:

# Both of these now 404 — kept only to show what the old guides told you to run
sudo rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-5.rpm
sudo rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-6.rpm

The EL 7 release package still downloads, but the repository behind it was closed in February 2026 and receives no further updates:

sudo yum install https://rpms.remirepo.net/enterprise/remi-release-7.rpm

Once the installation is done, confirm that the repo is enabled with this command:

$ sudo dnf repolist

repo id                       repo name
appstream                     Rocky Linux 9 - AppStream
baseos                        Rocky Linux 9 - BaseOS
cloud-kernel                  Rocky Linux 9 - Cloud Kernel
epel                          Extra Packages for Enterprise Linux 9 - x86_64
epel-cisco-openh264           Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
extras                        Rocky Linux 9 - Extras
google-cloud-sdk              Google Cloud SDK
google-compute-engine         Google Compute Engine
remi-modular                  Remi's Modular repository for Enterprise Linux 9 - x86_64
remi-safe                     Safe Remi's RPM repository for Enterprise Linux 9 - x86_64

If you see remi in the list then it means its been installed.

Installing packages from Remi repository

To use packages from the remi repository, you need to enable them. Lets list modules providing php using this command:

$ sudo dnf module list php

Rocky Linux 9 - AppStream
Name            Stream              Profiles                              Summary
php             8.1                 common [d], devel, minimal            PHP scripting language
php             8.2                 common [d], devel, minimal            PHP scripting language

Remi's Modular repository for Enterprise Linux 9 - x86_64
Name            Stream              Profiles                              Summary
php             remi-7.4            common [d], devel, minimal            PHP scripting language
php             remi-8.0            common [d], devel, minimal            PHP scripting language
php             remi-8.1            common [d], devel, minimal            PHP scripting language
php             remi-8.2            common [d], devel, minimal            PHP scripting language
php             remi-8.3            common [d], devel, minimal            PHP scripting language
php             remi-8.4            common [d], devel, minimal            PHP scripting language
php             remi-8.5            common [d], devel, minimal            PHP scripting language

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

The streams you actually want today are remi-8.4 (active support until December 2026) or remi-8.5 (active support until December 2027). Everything at 8.1 and below is end of life and gets no security fixes — do not stand up a new server on remi-7.4 or remi-8.0 just because an old tutorial says so.

If you want to install PHP 8.4 for instance, reset the module first so the distro’s default stream doesn’t conflict, then enable the Remi stream:

sudo dnf module reset php
sudo dnf module enable php:remi-8.4

On EL 8, 9 and 10, which all ship dnf 4, you can collapse both steps into one:

sudo dnf module switch-to php:remi-8.4/common

You can then install it with the dnf install command:

sudo dnf install php php-cli

To search all packages, use this command:

sudo dnf search php

On EL 10, dnf module prints a deprecation warning: Red Hat has deprecated modularity and ships no modular content of its own in RHEL 10. EL 10 still uses dnf 4 (dnf5 is the default only on Fedora 41 and later), and Remi still publishes a modular repository for EL 10. The module streams above still work there today, but for anything long-lived prefer the Software Collection below, and check the Remi configuration wizard for the current recommendation for your release.

Installing PHP as a Software Collection

Module streams replace the system PHP, so you only get one version at a time. If you need a specific PHP version alongside the one your distro ships — handy when you are migrating an app one version at a time — install it as a Software Collection instead. The packages are versioned (php84-*, php85-*) and live under /opt/remi:

sudo dnf install php85

Run it without touching the system php:

scl enable php85 'php -v'

Or call the binary directly, which is what you would point a web server or systemd unit at:

/opt/remi/php85/root/usr/bin/php -v
comments powered by Disqus
Citizix Ltd
Built with Hugo
Theme Stack designed by Jimmy