Last Revised: October 2, 2021
If in your WordPress Site Health dashboard you see the message The optional module, libsodium, is not installed, or has been disabled, you have the possibility to correct it with some changes.
The optional module, libsodium, is not installed, or has been disabled.
The optional module, libsodium, is not installed, or has been disabled.
Shared Hosting
In case you have your website with WordPress on a shared hosting, you will need to contact your provider and ask them to activate the PHP sodium extension.
VPS / Dedicated
If you have access to your VPS or dedicated server, you will need to install the PHP sodium extension.
Ubuntu / Debian
apt -y install build-essential php-pear php-dev
cd
wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar xvf LATEST.tar.gz
rm -rf LATEST.tar.gz
cd libsodium-stable/
./configure
make
make check
make install
pecl install libsodium
echo "extension=sodium.so" >> /etc/php/8.0/mods-available/libsodium.ini
CentOS / RHEL
yum -y install php-pear php-devel
yum -y groupinstall "development tools"
cd
wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar xvf LATEST.tar.gz
rm -rf LATEST.tar.gz
cd libsodium-stable/
./configure
make
make check
make install
pecl install libsodium
echo "extension=sodium.so" >> /etc/php.d/50-libsodium.ini
cPanel Control Panel
To install PHP sodium in cPanel, which usually works on CentOS, we must first install the Sodium libraries by SSH.
yum -y groupinstall "development tools"
cd
wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
tar xvf LATEST.tar.gz
rm -rf LATEST.tar.gz
cd libsodium-stable/
./configure
make
make check
make install
Once we have the library installed, we can continue from the cPanel panel.
In the Software / Module Installer section, we have the PHP PECL section.

There we will go to the management and select the version of PHP that we want to configure. If we want to have it in all versions, we must do the steps for each of them.
In the “Install a PHP PECL” section, put “libsodium” and click on “Install”.

At the end we will have “libsodium in the list of extensions of that version of PHP.”

Panel de control Plesk
If you have Plesk control panel (Service Provider View), you can install PHP sodium from the PHP Tools and Settings / Settings section.
Once there, the corresponding PHP version is selected and inside the “sodium” option is activated.

About this document
This document is regulated by the EUPL v1.2 license, published in WP SysAdmin and created by Javier Casares. Please, if you use this content in your website, your presentation or any material you distribute, remember to mention this site or its author, and having to put the material you create under EUPL license.