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

garrys07's avatar

Why vendor folder is removed while deploying to Elastic Beanstalk

Hi

I am following this link to Deploy Laravel application to Elastic Beanstalk.

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-laravel-tutorial.html

Create a source bundle containing the files created by Composer. It excludes files in the vendor folder, which take up a lot of space and are not necessary for deploying your application to Elastic Beanstalk.

It says while creating a zip file to remove the vendor folder

zip ../laravel-default.zip -r * .[^.]* -x "vendor/*"

--> excludes files in the vendor folder

As vendor folder contains all of the dependencies that are installed from composer.json ,so why is amazon docs specifying to remove the vendor folder before uploading the laravel package to Elastic Beanstalk?

Any suggestions/ insights ?

Thanks

0 likes
4 replies
Tray2's avatar

Because after deploy you should run composer install to install all the dependencies,

garrys07's avatar

@tray2 , at what step do we need to run this command ?

I am not able to find this step in documentation ?

Please suggest

Tray2's avatar

When the deploy to the server is finished.

Please or to participate in this conversation.