Laravel utilizes Composer to manage its dependencies. Download and install Composer.Download Composer
Install Composer globally.Install Composer globally instructions
Install zip and unzip.
sudo apt-get install zip unzip
Download the Laravel installer.
composer global require laravel/installer
Add composer's system-wide vendor bin directory to your $PATH.
echo 'export PATH="~/.config/composer/vendor/bin:$PATH"' >> ~/.bashrc
I want to put my website files in /var/www/html which is currently owned by root, so I'm gonna change the owner to my user and then change it back. Go to the www directory.
sudo chown user html
Go into the html directory and create new Laravel project.
laravel new project_name
Go back to the www directory and change html dir owner back to root.
sudo chown root html
Go to your projects directory /var/www/html/your_project
Change the storage and /bootstrap/cache directories group to www-data.
sudo chgrp -R www-data storage bootstrap/cache
Change the storage and /bootstrap/cache directories permissions .
sudo chmod -R ug+rwx storage bootstrap/cache
Set Application Key.
php artisan key:generate
Create cache table.
php artisan cache:table
Migration created successfully!
php artisan migrate
Publish laravel error pages.
php artisan vendor:publish --tag=laravel-errors
For a more detailed explanation: Check out these tutorials.Laravel Docs Composer Deploy Laravel Application with Nginx on Ubuntu