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

ospira's avatar

Proper way to deploy a Laravel application from a repo on Github

Hi, I am working for a client and I need a developer and a production server. So far all Laravel development has been done on a development server, and I have been pushing code changes to github in anticipation of a migration to a production environment.

My problem is that this task is proving to be exceedingly difficult. I booted up a new server, DigitalOcean LAMP which was no problem, until I tried to get my Laravel application code from github on my fresh Laravel installation on this new server.

I did git clone https://github.com/me/myLaravelApp.git and then did a composer update in the directory created on my unix server for the git clone.

I have all the files, my app files from github and my /vendor files from composer, but it breaks php artisan and gives me a bunch of weird errors, in short, I'm doing something wrong.

So what is the correct workflow to get a Laravel application using the standard .gitignore from Github to a new server environment?

0 likes
4 replies
thc1967's avatar

If I were using a hosted server like Digital Ocean, I'd probably take a look at Envoyer (http://envoyer.io).

Without seeing the specific error messages you're getting, it's tough to help you with specifics.

Are you sure everything you expected to see in your vendor folder is there? If you just run php artisan, does it dump commands or error out?

ospira's avatar

It errors out, and yes everything I would expect in my vendor folder is there.

I get this output from Artisan: $ php artisan PHP Fatal error: Uncaught InvalidArgumentException: The "" directory does not exist. in /var/www/laravel/vendor/symfony/finder/Finder.php:546 Stack trace: #0 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(76): Symfony\Component\Finder\Finder->in(false) #1 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(59): Illuminate\Foundation\Bootstrap\LoadConfiguration->getConfigurationFiles(Object(Illuminate\Foundation\Application)) #2 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(38): Illuminate\Foundation\Bootstrap\LoadConfiguration->loadConfigurationFiles(Object(Illuminate\Foundation\Application), Object(Illuminate\Config\Repository)) #3 /var/www/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(203): Illuminate\Foundation\Bootstrap\LoadConfiguration->bootstrap(Object(Illuminate\Foundation\Application)) #4 /var/www/laravel/vendor/laravel/framework/src/Il in /var/www/laravel/vendor/symfony/finder/Finder.php on line 546

ospira's avatar

I fixed it:

What I learned:

The method of clone and then composer update for some reason left me without:

the boostrap folder

and the storage folder

and an .env file.

Added those from my dev server to production server and it seems to work now! :)

Please or to participate in this conversation.