Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

BLH's avatar
Level 11

HELP: Forge, Quick Deploy & Composer.lock

So, I am including some new packages that need to be installed via composer in my forge production environment, I had issues with this before and I'm wondering what the best practice is to handle it. If composer.lock is changed (which it does after installing new packages in development) forge won't apply the commit, and that's good for obvious reasons. What do I do? Do I install the dependencies via ssh with composer, and then deploy? Can I just delete the composer.lock file on the production server and have the new one applied if the deployment is successful. I had a similar issue upgrading to 5.2, and just spun up a new server instead of dealing with it, but any help would certainly be appriciated. Thanks

0 likes
3 replies
ejdelmonico's avatar

Do you have composer install unchecked by any chance? That would do it.

bobbybouwmann's avatar
Level 88

The recommended way is to push your local composer.lock file to your version control (git). So when you want to deploy your site, Forge will just pull your code from git including the composer.lock file. During your deployment you should run composer install so it will install the dependencies based on the composer.lock file.

Can you show your current deployment script?

BLH's avatar
Level 11

Cool, thanks guys it worked this time!

Please or to participate in this conversation.