Support the ongoing development of Laravel.io →
Installation Configuration
Last updated 1 year ago.
0

The "recommended method" is to push your laravel application using the provided .gitignore file (edit this file to allow tracking of the composer.lock file though). This essentially pushes anything potentially custom to your git repo, but not the entire working application code (i.e. it basically leaves out the vendor folder)

Then on your production server you would pull the code down, and run "composer install" to download the dependencies (i.e. vendor folder). Then you are good to go. The whole idea being that you let composer manage the dependency files (3rd party libraries, such as the laravel framework itself).

So in essence, yes you need composer on your production server (and composer will download laravel + other dependencies in the vendor folder).

However, composer is just a helper utility. You don't NEED it at all. If you wish to continue without composer, you can git push EVERYTHING including the vendor folder to git, and deploy that to production without requiring composer on the production server. Although this isn't the recommended method, more of a "last resort" method.

Last updated 1 year ago.
0

@leesherwood

Thanks a lot for your answer. Quick, concise and useful :)

Regards, Mariano

Last updated 1 year ago.
0

IMO it's really bad advice to use composer in production to pull down repos. Your application should be packaged in a develop environment (installed, tests run using production software) and tar balled.

You then send this tarball to production however you feel and unzip it to a version folder. If no database changes or downtime is required then simply change a symlink etc.

EDIT

What you want to mitigate against is situations where things outside of your control are down. If you schedule a downtime and github/packagist are down (or the link between your host and them is down) then your update cannot occur. You don't want to find this out at the deployment stage.

Last updated 1 year ago.
0

I use composer install on my server, but don't schedule downtime. I use rocketeer to deploy, which pulls down the git repo, runs composer install, and updates the symlink when successful. I'll take the chance that github is down ;)

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

malesandro malesandro Joined 13 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.