Installing the Remi repository on AlmaLinux

Linux 6 min read

The Remi repository (Remi’s RPM repository) is maintained by Remi Collet, a developer who also maintains the PHP packages for Red Hat. It provides newer or older versions of PHP for AlmaLinux, Rocky Linux and Red Hat Enterprise Linux than those included in the system, as well as Redist, Valkey, Composer and many PHP extensions. You’ll need it if an application requires a different version of PHP to the one provided by AlmaLinux, or if you want to run multiple versions of PHP on a server.

We tested these steps on AlmaLinux 10.2 and 9.8; please run the commands as the root user or using sudo.

1. Enabling EPEL

Remi’s packages are based on the EPEL repository, so you must first enable it (for details, see: Installing the EPEL repository on AlmaLinux):

sudo dnf install epel-release
sudo crb enable

2. Installing the Remi repository

The configuration package is installed from the Remi website, via the URL corresponding to the main version of the system.

AlmaLinux 10:

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

AlmaLinux 9:

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

During the test, the remi-release-10.2-1 package was installed for AlmaLinux 10, and the remi-release-9.8-1 package for AlmaLinux 9. When installing the first Remi package, dnf prompts you to import Remi’s signing key (Userid : "Remi's RPM repository (https://rpms.remirepo.net/) <remi@remirepo.net>"), which you can confirm by pressing y.

3. What features does the package include?

dnf repolist

Remi creates several storage areas, two of which are active:

Storage By default What is it for?
remi-modular be Alternative versions of PHP, Redis, Valkey and other programs are available as modules (see below)
remi-safe be Only packages that do not replace anything in the system, such as php84 and php85, which can be installed in parallel
remi ki Updates that override the system’s own packages
remi-test ki Packages currently undergoing testing

Do not enable the remi and remi-test repositories on a live server. remi-modular and remi-safe do not replace anything on their own: until you select a module or install a phpXY package, the system’s packages will remain unchanged.

4. Available versions

Remi offers program versions as modules. The list of available PHP versions is as follows:

dnf module list php

PHP output of the dnf module list command on an AlmaLinux 10 system using the Remi repository: from remi-7.4 to remi-8.6, with remi-8.5 marked with [e], followed by the output of php -v

The [e] (enabled) next to remi-8.5 in the image means that this version is selected. At the time of testing (October 2026), the following were available:

Program Modules (streams)
php remi-7.4, remi-8.0 … remi-8.5, remi-8.6 (8.6 is still in pre-release, RC)
redis remi-7.2, remi-8.0, remi-8.2 … remi-8.10
valkey remi-8.1, remi-9.0, remi-9.1, remi-9.2
composer 2
memcached remi

On AlmaLinux 9, the dnf module list php command displays the system’s own modules (8.1, 8.2, 8.3) alongside the Remi modules beginning with remi-. AlmaLinux 10 no longer uses modules for its own packages; only the Remi modules appear there, and dnf issues a warning: “modularity is deprecated, and functionality will be removed in a future release of DNF5”. Nevertheless, the Remi modules worked flawlessly on AlmaLinux 10 at the time of testing.

5. Selecting a version

Example for PHP 8.4:

sudo dnf module reset php
sudo dnf module enable php:remi-8.4
sudo dnf install php php-cli php-fpm

reset clears the previous selection, whilst enable sets the new one. From this point onwards, php, php-fpm and all php-… extension packages will come from version 8.4 of Remi, and updates will also remain within this version. You can switch to a different version using the switch-to command, which will also replace the installed packages:

sudo dnf module switch-to php:remi-8.5

If you try to switch to another stream without reseting, dnf will refuse:

Error: It is not possible to switch enabled streams of a module unless explicitly enabled via configuration option module_stream_switch.

In this case, use the switch-to command, or the reset command first. To see which stream is currently selected, run dnf module list php --enabled.

For Remi’s PHP, common PECL extensions are also provided via the module, tailored to the PHP version, such as php-pecl-redis6 (Redis) and php-pecl-memcached (Memcached).

The full process of installing PHP, including extensions and web server configuration, is described in the article ‘Installing PHP on AlmaLinux 9 and 10’, whilst Redis is covered in ‘Installing Redis and Valkey on AlmaLinux’.

6. Multiple PHP versions at the same time (remi-safe)

In the remi-safe-repository, every PHP version is available with its own prefix (php81, php82 … php86). These are installed alongside the system’s PHP in a separate directory, meaning that multiple versions can run on a single server:

sudo dnf install php85-php-cli php85-php-fpm php85-php-mysqlnd
php85 -v
sudo systemctl enable --now php85-php-fpm
  System: PHP Parallel (example: 8.5)
Command php php85
Service php-fpm php85-php-fpm
Settings /etc/php.ini, /etc/php-fpm.d/ /etc/opt/remi/php85/
FPM socket /run/php-fpm/www.sock /var/opt/remi/php85/run/php-fpm/www.sock

On the web server, the PHP handler for a given page must be directed to the appropriate socket; this means, for example, that an older application can run on PHP 8.1 whilst a new page can run on PHP 8.5 on the same server.

Updates and security

Remi packages are updated using the dnf upgrade command within the selected module. PHP developers actively support each version for two years, followed by a further two years of support limited to security fixes (source: php.net, Supported Versions):

Version Active support Security fixes
PHP 8.2 expired Until 31 December 2026
PHP 8.3 expired Until 31 December 2027
PHP 8.4 Until 31 December 2026 Until 31 December 2028
PHP 8.5 Until 31 December 2027 Until 31 December 2029

For a new installation, select 8.4 or 8.5. Remi still offers older versions that are no longer supported by the PHP developers (at the time of testing, these were 7.4, 8.0 and 8.1), but these will no longer receive security updates from the PHP developers. You should only use them temporarily, for the migration of legacy applications. Our blog post on the end of support for PHP 8.2 also discusses the support lifecycle for PHP versions.

If you do not wish to manage PHP versions manually, on cPanel hosting plans you can select the PHP version and extensions with a single click, whilst on VPS plans, the managed service takes care of this for you.

Removing Remi

First, replace the packages installed via the module with the system’s own versions, and remove any duplicate versions:

sudo dnf module reset php
sudo dnf distro-sync
sudo dnf remove 'php85-*'

In the test, distro-sync replaced the Remi PHP 8.5 packages with AlmaLinux 10’s own PHP 8.3.36 packages (Downgrading), including the extensions; however, it did not affect the php85-* packages, which must be removed separately. If you were also using a Redis or Valkey module, reset it in the same way (dnf module reset redis). Finally:

sudo dnf remove remi-release
Back: Linux articles (62)