Setting up your Laravel site on Digital Ocean is not as easy as it may seem. Recently I setup a new LEMP server and had to install a bunch of libraries and configs... It was to say the least, kind of a headache.
Now, thanks to Larasail, this will be a thing of the past. You can check out the repo here: https://github.com/thedevdojo/larasail
Larasail is a CLI tool to help you Sail the Servers of Digital Ocean. Getting started is super easy. Simply boot up a new Ubuntu server in your Digital Ocean account:
Then SSH into that server and add the command:
curl -sL https://github.com/thedevdojo/larasail/archive/master.tar.gz | tar xz && source larasail-master/install
And you'll see a screen that looks similar to the following:
Next, we can setup our new Laravel server using the
setup command like so:
And this step will probably take at least a couple minutes to install Nginx, PHP, MySQL, and all the necessary files.
After you've setup your new server you will have a bunch of tools available for you to use:
If you want to setup a new laravel site you can use the
laravel new command inside of your
/var/www directory, or you can clone your existing laravel app into that directory.
To setup a new site and host you can run the following command:
larasail host mywebsite.com /var/www/mywebsite
This command will create a new nginx host that will listen for a connection coming from mywebsite.com and map it to the /var/www/mywebsite/public folder.
Now, with LaraSail you can easily spawn up new Laravel apps with the drop of a hat. Make sure to check out the repo for more options: https://github.com/thedevdojo/larasail