Deploying a Drupal update

Last updated on
27 October 2025

This is how to deploy a Drupal update to a server. Deployment is the process of taking changes from the local development environment to a live web site, either an update of Drupal, or a new feature.

First update Drupal core via Composer on a local copy and test that everything works, then repeat the changes on the server, to update the live web site. These are the steps to deploy these changes from the local environment and to your server.

  1. Locally: Update Drupal core via Composer in your local development environment.
  2. When everything works well, either repeat all the steps on your server, or simply move the new composer.lock file to your server. For more see Basic Composer usage and Composer: It’s All About the Lock File.
  3. On the server: Update Drupal's code and contrib modules as defined in the updated composer.lock file by running this command. Add --dry-run to first do a test run:
    composer install
  4. Run Drupal updates.

Your web site should now be updated, according to the version requirements in the composer.lock file.

Deployment of a new feature with configuration management and Git

These are the basic steps, for creating a new feature locally, and moving it to your server.

Local environment

  1. Update Drupal configuration in your local development environment
  2. Export the updated configuration with Drush
  3. Commit the updated configuration and composer.lock file with Git

Deploy to server

  1. Build the codebase from composer.lock by running composer install
  2. Run Drupal updates
  3. Import configuration with Drush. Note this is the opposite of development steps.

The last two steps can be replaced by the drush deploy command that wraps them up into a consistent command and adds useful features.

Deleting a module

Deleting a module is not straight forward in a Git-based deployment process. Before doing anything else, you have to uninstall it on the server, with Drush or in the administrative GUI at /admin/modules/uninstall.

You must do this. Since in the deployment process, deleting or downloading modules with Composer is the first step, Drupal will be confused if an installed module is gone from the file system, but configuration is being requested for removal.

Uninstalling the module makes Drupal forget about the module, and cleans up the database.

Otherwise, if you use Git, and you deleted the module on the server already with a manual composer remove, you may get a Your local changes to the following files would be overwritten by merge: composer.json composer.lock ... Please commit your changes or stash them before you merge error, because the repository is now out of sync.

From Uninstall modules that were installed with composer, see also Managing your site's configuration.

Help improve this page

Page status: No known problems

You can: