Feralheart
Feralheart

Reputation: 1940

Deploy with Laravel?

First Laravel Project.

I want to deploy my Laravel project to a Hoster. I have FTP access to it, but I don't want to tinker with filezilla everytime I change something. Plus my Development and 'Finished' projects has some differences (for example Debugbar and different DataBase authentication. What's the best method to deploy a Laravel Project?

Upvotes: 1

Views: 109

Answers (1)

aimme
aimme

Reputation: 6818

It can be done in many ways. So I am going to give a headstart.

Warning: This might not be everything you need to know. I recommend you to learn more about, deployment,ssh, version controlling, apache vhosts, etc , this is just a headstart

Here is how I do it on my Ubuntu server with apache, php and mysql.

I use Git for version controlling and bitbucket and github for managing repositories.

1 - make my project a git repository.

2 - push the repo to bitbucket.

3 - connect to the remote server through ssh and setup the apache vhosts, databases etc.

  • create a vhost /etc/apache/sites-available/somesite.com.conf file
  • add the entry to /etc/hosts file

4 - pull the repo from bitbucket to remote server, create and bring the required changes to the production .env file

5 - do a composer install

6 - run php artisan key:generate and php artisan migrate

7 - turn on the site

  • run sudo a2ensite somesite.com.conf
  • run sudo service apache2 reload

now the site its up and ready to go.

Upvotes: 1

Related Questions