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

tanmay_das's avatar

Laravel shared hosting deployment

I have a copy of my project in my office pc and I pushed the project to a bitbucket git repo. I have been instructed to deploy the project as soon as I go home. I came to home and:

  1. Cloned the repo to home pc. It didn't have the vendor directory as it is ignored by the gitignore file

  2. A quick google search suggested me to run composer install, but it didn't work because of unmet requirements

  3. So I ran composer update instead and it regenerated the vendor directory. Meanwhile, I already uploaded everything else except the vendor directory

  4. gitignore also ignores the .env file, so I duplicated .env.example and renamed it to .env and generated a key using php artisan key:generate and uploaded the file to the server

  5. I am currently at this stage, about to upload the vendor directory. It contains a lot of files and will consume a huge amount of time. If anyone could confirm that all the above steps were ok and I did not ruin anything I would upload the vendor directory

0 likes
3 replies
bobbybouwmann's avatar
Level 88

Yeah you need to upload the vendor directory because it contains all the code that makes the framework work. All other third party packages are also in the vendor directory. For example the symfony parts in Laravel can be found in the vendor directory.

Without that directory you get a lot of errors and the code will probably not run!

2 likes
cre3z's avatar

@bobbybouwmann is right. You need the vendor folder.

In some cases like this I remove the vendor folder from the gitignore file. So it pushes everything, and I don't have to run composer to get the app up and running. I know this is not the preferred way of doing it but since laravel was not designed for shared hosting we change things up a little.

bobbybouwmann's avatar

That's fine! As long as you keep committing the vendor directory when you run composer update

Please or to participate in this conversation.