Posts Learn Components Snippets Categories Tags About

Best way to run Composer Update in Production

Learn the best practice on how to run composer update in a production environment to prevent code break

Created on Aug 13, 2021


The best way to update the composer dependency in production is by running "composer update" first on your local development. By doing so the "composer.lock" file will be updated and when you have a check for any breaking changes, it's time to push to the server and then run "composer install".

Below are the steps to do so:
  1. "composer update" on the local development.
  2. check for any breaking changes.
  3. commit the "composer.lock" file and push to git/production.
  4. run "composer install" from the production server.

By ensuring that everything is running fine in the local development, it will now be safe to run the command in the production environment.

Snippets by

PostSrc poster


Full stack developer mainly focusing on the front end side of the web. The main author of PostSrc and loves writing tutorial and guides online.

Load comments for Best way to run Composer Update in Production


PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that's right for your project.

View Components

Other Code Snippets