← ServerPilot Docs

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 8.0, 8.1, 8.2, or 8.3 for the runtime. Laravel 9.x does not support PHP 7.

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
composer8.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: November 20, 2023

Launch your first site in 5 minutes