Skip to content

Back

How to install Laravel

Applies to: Professional Hosting, Reseller Hosting

Difficulty: Intermediate

Time Needed: 15 minutes

This is a guide for how to set up the Laravel framework on Professional or Reseller Hosting. This is considered an intermediate level task, so if you require assistance setting Laravel up, our support team will be happy to help.

STEP 1
SSH to your hosting

Firstly, you’ll need to use SSH to access your site’s files. The following command will allow you to login:

ssh USERNAME@IP

Replacing ‘USERNAME’ with your SFTP username and ‘IP’ with the IP address of your server.


STEP 2
Change directory to ‘private’

Change in to your private directory using:

cd private/


STEP 3
Create a ‘cache’ directory.

Create a directory for the cache by typing the following command:

mkdir cache


STEP 4
Install Laravel

Install Laravel using the following command:

COMPOSER_CACHE_DIR=/private/cache composer create-project laravel/laravel example-app


STEP 5
Create a symlink

Create a symlink using the following command:

ln -s /private/example-app/public/ /httpdocs/example-app

This will now allow your application to load at yourdomain.com/example-app


STEP 6
Install Laravel application to root directory

To install the application to your root directory you will need to create a .htaccess file within the httpdocs of your website containing the following text:

RewriteEngine On
RewriteRule ^/example-app/index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /example-app/index.php [L]
RewriteRule ^$ /example-app/index.php [L]

After this the application should load on the root of yourdomain.com

Was this article helpful?
YesNo