DEV Community

loading...
Cover image for Setup Laravel Project on Server (Ubuntu 18.04)

Setup Laravel Project on Server (Ubuntu 18.04)

Chandresh Singh
Creator of ReportBugz.com
・1 min read

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!

Discussion (6)

Collapse
redcaptom profile image
Red Cap Tom

PHP for the win, EC2 for fun and profit!

Just use code instead of blockquote and you have my 100% appreciation. :)

To do that - wrap the code in triple tilde (~) to make it look like this:

console.log("Code for the masses, but first free bus passes!")
Collapse
chandreshhere profile image
Chandresh Singh Author

Thanks!
Will use that from now on...

Collapse
andreapollastri profile image
Andrea Pollastri

Hi! Why don't you use Cipi (cipi.sh)? It's simple, it's an Open Source and it's a perfect tool for Laravel (and any other PHP application or website) easy deployment on AWS, Digital Ocean, Vultr, etc...

Collapse
chandreshhere profile image
Chandresh Singh Author

looks useful, will try it. Thanks for sharing.

Collapse
andreapollastri profile image
Andrea Pollastri

You are welcome! Let me know what do you think about Cipi! I'm willing for support via mail / Github issues

Collapse
martinbean profile image
Martin Bean

“Hey, random person on the Internet. Why don’t you use the project I created that I’m now blatantly and shamelessly plugging in a comment on your post?”