Linode, Bash, Tutorials, Development

 

The following steps are needed for running Laravel on Linode.

Before you install Laravel, decide where you're going to install it. If you are setting up a site that already has a virtual host seup then simply remove the folder from /var/www

sudo rm -rf foldername

This allows you to create the folder as part of the installation.

 

Installing Laravel

composer create-project --prefer-dist laravel/laravel foldername

If you get the error:
proc_open(): fork failed - Cannot allocate memory_

A swap file is needed run this on the root:

sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

cd into the laravel folder and change permissions by running:

sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache