Updating Craft 3.7.39 to a Newer Version

Normally there are several ways you can update Craft CMS, but version 3.7.39 must be updated from your terminal using composer update.

1. Make sure Composer is installed wherever you’ll be running the update. #

Run the which composer command, and if you don’t have it follow the instructions here to download and install it.

2. Open your Craft project’s composer.json and check your craftcms/cms requirement. #

It should be set to one of these:

  • Something that begins with ^ (e.g. ^3.7.0, meaning “any version equal to or after 3.7.0, and less than 4.0.0”)
  • Something that begins with ~ (e.g. ~3.7.0, meaning “any version equal to or after 3.7.0, and less than 3.8.0”)
  • A specific version number (e.g. 3.7.39).

If it’s a specific version number, update it to 3.7.40.1.

3. Run composer update. #

Once the composer update command finishes, you can commit your composer.json and composer.lock files like you normally would, running future updates using whatever method you prefer.

If Craft is installed within a VM or Docker container, you may need to add
--ignore-platform-reqs so Composer doesn’t error out over an environmental conflict, like a required PHP version mismatch.

Applies to Craft CMS 3.