Setup Laravel Project on Server (Ubuntu 18.04)
To setup laravel project on a Server with Ubuntu 18.04 from scratch, you need to do following:
You can watch this example here as well:
Let’s Start!
- Install PHP
sudo apt-get update
sudo apt-get install php
sudo apt-get install php7.2-mbstring php7.2-mysql php7.2-xml php7.2-curl php7.2-json php7.2-zip
- Install apache
sudo apt-get install apache2
- Install git
sudo apt-get install git
- Install Composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer
- Clone laravel project from your repository
git clone https://github.com/csinghdev/laravel-starter.git
- Setup Laravel app
cd laravel-starter
composer install
cp .env.example .env
- Add/Edit Project Environment variables
nano .env
- Create virtual host in apache and map subdomain to your Laravel app. You can watch it here.
That’s it!
Originally published at https://dev.to on May 30, 2020.