Security

How to Update Drupal Core with Composer, Step by Step

Tiberiu Trandaburu 11 min read
 Update Drupal core with Composer: run composer update, test, then deploy

To update Drupal core with Composer, back up the site, run composer update "drupal/core-*" --with-all-dependencies, then run drush updatedb and drush cache:rebuild, test, and deploy the new composer.lock to production with composer install --no-dev. This works for patch and minor updates, for example 11.4.13 to 11.4.14 or 11.3 to 11.4. A new major version, such as Drupal 10 to Drupal 11, is a different job with its own checks.

Key takeaways

  • One Composer command updates core for most sites: composer update "drupal/core-*" --with-all-dependencies. If your project uses drupal/core instead of drupal/core-recommended, the command is different.
  • The update is not finished when Composer finishes. Database updates, a cache rebuild and, on sites with configuration management, a config export are part of it.
  • Update on a copy of the site first. On production, run composer install --no-dev from the tested lock file, never composer update.
  • Core security releases usually come on the third Wednesday of the month, between 16:00 and 22:00 UTC. Highly critical fixes can arrive outside that window, as they did on 25 November 2026.
  • A core release does not always include fixes for its dependencies. Run composer audit after every update.

Patch, minor and major updates: which one are you doing?

Check the type of update first, because it decides how much testing you need. Drupal version numbers read major.minor.patch, so 11.4.14 is major 11, minor 4, patch 14.

Update typeExampleWhat changesWhat to expect
Patch11.4.13 to 11.4.14Bug fixes or security fixesShould not need module updates. Low risk, test the main user journeys.
Minor11.3.23 to 11.4.14New features, deprecations, sometimes new requirementsSome contributed modules and themes may need updating first. Read the release notes.
Major10.6 to 11.4Removed APIs, new platform requirementsA project, not a routine update. Audit modules and custom code before you start.

This guide covers patch and minor updates. For a major version, start with our guide to the Drupal Upgrade Status module, which finds the modules and custom code that block the upgrade. If you are still on Drupal 10, note that it reaches end of life on 9 December 2026.

Which Drupal versions get security fixes right now

Drupal supports two minor versions of each major at a time. The current minor gets bug and security fixes; the previous minor gets security fixes only. That gives you a short window to move from one minor to the next.

BranchLatest release on 26 November 2026Support
Drupal 11.4.x11.4.14 (25 November 2026)Bug and security fixes. Security support until 21 April 2027.
Drupal 11.3.x11.3.23 (25 November 2026)Security fixes only. Ends in the week of 7 December 2026, when 11.5.0 is released.
Drupal 10.6.x10.6.23 (25 November 2026)Security fixes only. Drupal 10 end of life on 9 December 2026.
Drupal 11.2.x and older, 10.5.x and olderNoneEnd of life, no security coverage.

If your site is on 11.3, plan the minor update to 11.4 now. Once 11.5.0 and Drupal 12 are out in the week of 7 December, 11.3 stops receiving security fixes.

Last checked against the Drupal core release schedule and the Drupal core releases page on drupal.org: 26 November 2026.

Before you update: three checks

Spend five minutes on these before running any update command. They catch the problems that otherwise appear halfway through.

  1. See what is available. Run composer outdated "drupal/*". If there is no line for drupal/core (or drupal/core-recommended), Composer does not see a core update.
  2. Check the Status report. Go to Reports, then Status report, and fix the errors and warnings that are already there. Otherwise you cannot tell which ones the update caused.
  3. Find out which core package you use. Run composer show drupal/core-recommended. If it returns package details, you use drupal/core-recommended, the standard for current projects. If it says the package was not found, your project requires drupal/core directly.

The difference matters. drupal/core-recommended holds most of core's dependencies to patch-level updates, the versions core was tested with. drupal/core lets those dependencies move to newer minor versions, so you take on more of the testing yourself.

How to update Drupal core with Composer, step by step

Run these steps on a local or staging copy of the site, never first on production. The commands assume Composer 2 and Drush; check your Composer version with composer --version.

1. Back up the database and files

Take a backup you know how to restore. With Drush, drush sql:dump exports the database and drush archive:dump saves code, files and database in one archive. Commit your current composer.json and composer.lock to Git before you change them, so the previous code state is one checkout away.

drush sql:dump --result-file=../backup-before-core-update.sql
git status

2. Read the release notes

Open the release notes for the version you are moving to on drupal.org. For a minor update, check whether your contributed modules and themes need a newer release. For a security release, read the linked security advisory: some advisories ask you to do more than update the code.

3. Run the update in dry-run mode

Add --dry-run to see which packages Composer would change without changing anything:

composer update "drupal/core-*" --with-all-dependencies --dry-run

Keep the quotes around "drupal/core-*". Some shells, such as zsh and fish, treat the asterisk differently and the command fails without them.

4. Update the core code

If the dry run looks right, run the same command without --dry-run:

# Projects that use drupal/core-recommended
composer update "drupal/core-*" --with-all-dependencies

# Projects that require drupal/core directly
composer update drupal/core --with-dependencies

--with-all-dependencies (short form -W) lets Composer update the dependencies of core too, including packages that are also listed in your own composer.json. Without it, Composer often reports that nothing can be updated.

5. Run database updates and rebuild caches

New code is not enough: core may include update hooks that change the database. Run them, then rebuild caches:

drush updatedb
drush cache:rebuild

Without Drush, visit /update.php on the site in a browser. drush updatedb puts the site in maintenance mode while it runs.

6. Export configuration if you use configuration management

Some core updates change the structure of configuration or add new values. If you deploy configuration from code, export it after the database updates and commit the changes with the lock file:

drush config:export --diff
git add composer.json composer.lock config/
git commit -m "Update Drupal core to 11.4.14"

Skip this step and the next configuration import on production can revert what the update changed.

7. Test the site

Check the Status report again; it should show the new version and no new errors. If the Database Logging module is on, use the site for a few minutes and read Reports, then Recent log messages. Then test the main journeys as an anonymous user as well as logged in: forms, search, login, checkout or whatever matters most on your site.

Finally, run composer audit. It checks every installed package against known security advisories and also reports abandoned packages. A clean core update can still leave a vulnerable dependency in place.

Deploy the update to production

On production, install exactly what you tested. Push the updated composer.json and composer.lock, then run:

composer install --no-dev
drush deploy

composer install reads the lock file, so production gets the same package versions as staging. --no-dev leaves out development packages. Running composer update on production instead can pull in versions that nobody tested.

drush deploy runs, in order, drush updatedb, drush config:import, drush cache:rebuild and drush deploy:hook, plus drush cache:warm on Drupal 11.2 and later. If you do not import configuration on deploy, run drush updatedb and drush cache:rebuild instead.

In our maintenance work, the production update problems we are asked to fix usually trace back to one of two shortcuts: running composer update directly on the server, or forgetting to commit the configuration export. A lock file and a deploy command remove both.

How to roll back a failed core update

Roll back when the site errors after the update and the cause is not obvious within minutes. Restore code and database together; restoring only one leaves them out of step.

  1. Put the site in maintenance mode: drush state:set system.maintenance_mode 1, then drush cache:rebuild.
  2. Return the code to the previous lock file: git checkout <previous-commit> -- composer.json composer.lock, then composer install --no-dev.
  3. Restore the database from the backup taken in step 1, for example drush sql:drop followed by drush sql:cli < ../backup-before-core-update.sql.
  4. Rebuild caches, take the site out of maintenance mode with drush state:set system.maintenance_mode 0, and test again.

Database updates generally cannot be reversed, which is why the database backup has to be taken before drush updatedb, not after.

When Composer will not update Drupal core

Most failed updates come down to a few known cases. The drupal.org documentation lists these fixes.

SymptomLikely causeWhat to do
Composer finishes but drupal/core stays on the old versionAnother package blocks the newer versionRun composer prohibits drupal/core 11.4.14 to see what blocks it, then update that package together with core.
Composer shows the new version, the Status report shows the old oneThe update failed silently in the core directoryRemove the core directory (for example rm -rf web/core/), run composer install, then rebuild caches.
A dependency has a security release that drupal/core-recommended does not allow yetcore-recommended pins dependencies to the versions core was tested withRequire the fixed version with an alias, for example composer require "twig/twig:3.26.0 as 3.22.2", and remove the line at the next core update.
Errors about Composer plugins or installersOld composer/* packagesInclude them in the update: composer update drupal/core "drupal/core-*" "composer/*" --with-all-dependencies.

The alias trick is a temporary measure, and composer validate will warn about it until you remove it. Recent Composer versions can also block packages through dependency policies, such as security advisories, abandoned packages or a cooldown period for new releases. If your project sets a cooldown period, composer outdated marks releases still inside it with (c), and Composer will not install them until it ends.

Drupal security updates: when they arrive and how fast to apply them

Treat a core security release as a same-week job, and a highly critical one as a same-day job. The Drupal Security Team publishes core security releases in a window on the third Wednesday of the month, between 16:00 and 22:00 UTC. Bug fix releases use a separate window around the first Wednesday.

The schedule has exceptions. In November 2026, core security releases came out on 18 November, the regular window, and again on 25 November for SA-CORE-2026-019, a highly critical access bypass that was already being exploited. That advisory also required update.php (or drush updatedb) to run so that an update hook could fix affected sites, and it recommended securing the Drupal installer on every site. Code alone was not enough.

Three habits make security updates routine:

  • Subscribe to the Drupal security advisories, and keep the Update Manager notices on, so you hear about releases on the day.
  • Keep the site on the latest patch release between security releases. A security update then moves one patch version, not five.
  • Read the release notes for third-party notes. The 11.4.14 release notes say that a Symfony security update published the same day is not included, and that sites manage third-party dependency updates themselves.

Last checked against the Drupal Security Team release timing page and SA-CORE-2026-019 on drupal.org: 26 November 2026.

Staying on the previous minor version on purpose

You can stay on the previous minor version for a while, for example when a contributed module is not yet compatible with the new one. Pin the minor with a tilde constraint:

composer require drupal/core-recommended:~11.3.23 drupal/core-composer-scaffold:~11.3.23

Include every drupal/core-* package listed in your composer.json. The constraint ~11.3.23 allows any 11.3 patch release from 11.3.23 up, but not 11.4. When you are ready to move on, run the same command with a caret, such as ^11.4.14, so the site follows the current minor again.

Use this as a short delay, not a strategy. The previous minor only gets security fixes, and only until the next minor is released.

FAQ

How often does Drupal update?

Drupal core has a bug fix release window every month, around the first Wednesday, and a security release window on the third Wednesday. Minor versions with new features come out roughly every six months, in June and December. Not every window produces a release.

How do I update from Drupal 10 to 11?

Not with the commands above alone. A major upgrade needs Drupal 10.3 or later, compatible contributed modules and themes, and custom code without deprecated APIs. Run the Upgrade Status module first, fix what it reports, then change the core version constraints in composer.json.

Can I update Drupal core without Drush?

Yes. Composer updates the code, and you can run the database updates by visiting /update.php in a browser while logged in as an administrator. Drush makes the process faster and easier to script.

Should I update contributed modules at the same time as core?

For a security release, update core alone so the change stays small and easy to test. For a minor update, update any modules that the new minor requires in the same round, using composer update drupal/module_name --with-all-dependencies.

Sources

Need a hand with Drupal updates?

If you would rather not run core and security updates yourself, our Drupal maintenance and support team applies them on staging, tests them and releases them to your live site. Get in touch and tell us which Drupal version you run.

Tiberiu Trandaburu, Founder & CEO, DevAtWork
Written by Founder & CEO, DevAtWork

Tiberiu is the founder and CEO of DevAtWork, a Drupal agency based in Bucharest, Romania. Since 2016 he has led Drupal projects for European institutions, international brands and digital agencies, from new builds and migrations to long-term support and security. He writes about Drupal upgrades, security and running websites that last.

More about the author
Start a project

Ship your next Drupal release with us.

Senior developers, clean code, and a reply within 24 hours.