‹ Articles

How to Install Laravel

Laravel is a free and open-source PHP framework. This tutorial will show you how to create a new Laravel 5 app on your server.

Creating an App in ServerPilot

First, click Create App in ServerPilot; this can be done immediately after connecting a server or by going to the Apps page.

Give your app a name and select the runtime you would like to use.

You must select PHP 7.1 or 7.2 for the runtime. Laravel 5.6 does not support PHP 5.4, 5.5, 5.6, or 7.0.

Next, select your app's server and the system user to run this app.

Click Create App to submit the form. You'll be shown some details about the app.

Installing the Laravel Framework

Now, it's time to install the Laravel framework in your new app.

SSH in to your server as the system user the app belongs to and run the following commands (where APPNAME is the name of your app):

cd apps
rm APPNAME/public/index.php
rmdir APPNAME/public
composer7.2-sp create-project --prefer-dist laravel/laravel APPNAME

This final command will take several minutes to complete. You should see many packages download and install.

If you are asked "Do you want to remove the existing VCS (.git, .svn..) history?", press Y.

You now have a fresh Laravel 5 application ready for development.


Last updated: February 08, 2018

Still Have Questions?

Don't hesitate to contact us if you can't find the answers to your questions.