Install and update WP Cerber with Composer
If your WordPress project already manages plugins with Composer, you can install WP Cerber from its official repository and deploy the same version to staging and production. The package is wpcerber/wp-cerber. Releases are available through Composer starting with 10.0.0.
Configure your project
Add the WP Cerber repository to your project’s root composer.json before you require the package.
Merge these entries into your existing configuration. Put the WP Cerber repository first in repositories and keep your other repositories and plugin permissions. The composer/installers permission lets Composer 2.2 and later run the installer that places WP Cerber in the WordPress plugins directory.
{
"repositories": [
{
"type": "composer",
"url": "https://downloads.wpcerber.com/versions"
}
],
"config": {
"allow-plugins": {
"composer/installers": true
}
}
}
The installer resolves plugin paths relative to the directory that contains composer.json. Without a custom mapping, WP Cerber goes to wp-content/plugins/wp-cerber/ in that directory, which is correct only when composer.json sits in the WordPress root. If your composer.json is elsewhere, for example one level above the web root, map plugins to their actual location under extra.installer-paths.
{
"extra": {
"installer-paths": {
"public_html/wp-content/plugins/{$name}/": ["type:wordpress-plugin"]
}
}
}
Bedrock. The standard Bedrock configuration already maps packages of type wordpress-plugin to web/app/plugins/{$name}/, so WP Cerber installs in web/app/plugins/wp-cerber/. Keep that entry under extra.installer-paths.
Check the requirements
WP Cerber 10.0.0 requires WordPress 5.8 or later and PHP 7.4 or later. Later releases may raise these minimums.
Composer enforces the PHP requirement, but it compares it with the PHP version that runs Composer, not the one that serves your site. If you run Composer on a build server or in CI with a different PHP version, declare the production version in your project. Replace 8.2 with the PHP version of your production server.
composer config platform.php 8.2
Composer does not check the WordPress minimum at all. Each release declares it as Requires at least in the header of wp-cerber.php. After Composer installs a release on staging, compare that value with the WordPress version of your production site before you deploy.
Install and activate WP Cerber
Run this command from the directory containing composer.json to install the latest compatible 10.x release.
composer require "wpcerber/wp-cerber:10.*"
After the first installation, confirm that wp-cerber.php is in the plugins directory you expect. Composer places WP Cerber through the composer/installers plugin. When Composer runs as root in a non-interactive session, such as a container build, it disables plugins and installs WP Cerber in vendor/wpcerber/wp-cerber/ instead, with only a notice in the output. Run Composer as a regular user, or set the environment variable COMPOSER_ALLOW_SUPERUSER=1 if the build must run as root.
Commit composer.json and composer.lock together. On a fresh deployment, install the exact versions recorded in the lock file with this command.
composer install
On the site, open Plugins > Installed Plugins and activate WP Cerber Security. If you use WP-CLI, you can activate it with wp plugin activate wp-cerber.
Switch an existing installation to Composer
If WP Cerber is already installed on the site, Composer replaces the entire wp-cerber folder with the files of the release and removes any files that are not part of it. Composer does not touch the database, so your WP Cerber settings and logs stay in place. Because the folder and main file names stay the same, WordPress keeps the plugin active. Back up the database first and require a release that is not older than the one the site currently runs.
If your project repository tracks the plugins directory, remove wp-cerber from version control and add it to .gitignore. Otherwise, the committed copy and the Composer-managed copy compete for the same folder.
Update or roll back
Composer replaces only the plugin files. It does not back up or restore WP Cerber settings and data in the WordPress database, so back up the database before every update.
Use a package-specific update to install the latest WP Cerber release allowed by your project.
composer update wpcerber/wp-cerber
The 10.* constraint allows minor and patch releases within version 10. A new major version requires a new constraint. Test the update on staging, commit the changed composer.lock, and deploy it to production with composer install.
To pin WP Cerber to a release that the repository still lists, specify its exact version. For example, this command pins WP Cerber to 10.0.0 and rolls back the plugin files if a later version is installed.
composer require "wpcerber/wp-cerber:10.0.0"
A rollback restores only the plugin files. It does not revert changes that the later release may have made to WP Cerber settings or database tables, so check that the older release works with the current data. Test the rollback on staging first. Restore the database backup only if the older release does not work with the data the later release left behind. Restoring the entire database also discards posts, orders, comments, and every other change made on the site since the backup was taken.
Commit both Composer files after changing the constraint. While the exact pin is in place, composer update keeps WP Cerber at 10.0.0. To resume 10.x updates, rerun the original composer require "wpcerber/wp-cerber:10.*" command.
A release that the repository no longer lists cannot be selected with composer require. Releases are retired deliberately, for example after a security fix, so move to a listed release rather than back to a retired one. A deployment from an older composer.lock that records a retired release still installs it while its archive remains on the download server. Keep in mind that restoring an older lock file reverts every project dependency, not only WP Cerber.
Keep plugin updates under Composer’s control
WP Cerber has its own Automatically update WP Cerber setting under WP Cerber > Main Settings, in the Site-specific settings section. It is off by default, and it must stay off on Composer-managed sites. When enabled, it makes WordPress auto-update WP Cerber regardless of the plugin’s auto-update toggle in WordPress, so turning off WordPress auto-updates alone does not stop it. The setting is described in Automatic updates for WP Cerber.
Also turn off WordPress auto-updates for WP Cerber, for example with wp plugin auto-updates disable wp-cerber, and skip it when applying updates in the WordPress dashboard. Setting DISALLOW_FILE_MODS to true in wp-config.php blocks plugin updates and installations from the dashboard for all plugins. Bedrock sets this constant by default outside the development environment.
Cerber.Hub is a separate case. If you use Cerber.Hub, exclude Composer-managed sites from WP Cerber upgrades even when DISALLOW_FILE_MODS is set.
Check scheduled maintenance scripts for wp plugin update wp-cerber and wp plugin update --all. If the script also manages other plugins, add --exclude=wp-cerber to the bulk update. Avoid wp plugin install --force for WP Cerber. These operations can replace the plugin files without changing composer.lock. The site then runs a different version from the one you reviewed, and the next clean deployment restores the locked version.
A regular composer install on an existing deployment does not detect changed plugin files, because Composer considers the locked release already installed. To restore the locked release in place, reinstall the package.
composer reinstall wpcerber/wp-cerber
Related documentation
- Composer repositories explains how Composer reads a custom repository such as the WP Cerber one.
- Composer configuration covers the allow-plugins permission and the platform setting used in this guide.
- Composer command-line interface describes the reinstall command and the COMPOSER_ALLOW_SUPERUSER variable.
- Custom install paths in the composer/installers documentation shows how to map plugins to your plugins directory.
- WordPress Dependencies with Composer explains how Bedrock manages plugins.
- Disable Plugin and Theme Update and Installation in the WordPress Advanced Administration Handbook documents
DISALLOW_FILE_MODS. - The WP-CLI reference documents wp plugin update, including the
--excludeoption, and wp plugin auto-updates disable. - WP Cerber Software Repository explains where WP Cerber receives updates from in the WordPress dashboard.
Have any questions?
If you have a question regarding WordPress security or WP Cerber, ask it in the comments below or find answers on the community forum.
Spotted a bug or glitch?
We’d love to fix it! Share your bug discoveries with us here: Bug Report.




