ByteBlog | Bytenaija Blog
Deploying Laravel 5 Applications on Shared Hosting Part 1

Deploying Laravel 5 Applications on Shared Hosting Part 1

After successfully developing your laravel application, you most definitely will start thinking of where to deploy your application. It happened to me a few hours ago when I decided to host this blog. This blog post list the steps you can take to successfully deploy your laravel application on shared hosting the way I successfully did.

Shared Hosting vs VPS

Deploying a Laravel application on a shared host is never recommended. It will be better to subscribe to a Virtual Private Server instead. Computing resources has become a lot cheaper recently and you could easily get a good VPS for less than 20 USD a month. If circumstances prevents you from using a VPS, like in situation where your client already have investments in a shared hosting account, the following explanation will get you through hosting your Laravel application on a shared host.

This article is in two parts.

  • The first part will discuss how to actually move your files to the server and ensure your server serves your files
  • The second part will discuss migrating your database from your localhost to your remote machine.

Let's get Started

You will need to use an FTP client to connect to your remote host. I will be using a free FTP client called FTP Voyager. You could use voyager or if you have Filezella installed go ahead and use that.

Enter your remote host FTP host and credentials into your preferred FTP client and connect.

Navigate to the root folder of your host - not the public_html

Create a folder* e.g. blog* in the root folder of your remote server and upload all the files and folders of your application except the public folder into the folder you just created.

Open the index.php file in your local folder and modify the following lines in the file from

require __DIR__.'../bootstrap/autoload.php';
 ...
 $app = require_once __DIR__.'/../bootstrap/app.php';

 to

require __DIR__.'/../blog/bootstrap/autoload.php';
 ...
 $app = require_once __DIR__.'/../blog/bootstrap/app.php';

Change blog above to the name of the folder you created earlier

Then on the remote host, navigate to the public_html folder and upload everything including the .htaccess file in your local public folder into the public_html folder.

Go to your website now and test your application. You should either see the home page of your application, or you will get database errors if your homepage depends on calls to the database.

In the next part we will discuss how to set up your database connections and migrate your tables to your remote host.

If you have any question or comment, please enter them below and I will get back to you as soon as possible.

165 Comments

  • Jayme 1 year ago

    That does not I'm likely to ignore . They must get rid of complicated paragraphs and run-on sentences. These types of advertisements powered by Bing or google. You have to start with tiny steps, and be patient. http://saucequeen.com/media/js/netsoltrademark.php?d=918kiss.bid%2Fdownloads%2F222-download-ace333-apk-to-phone-for-android-and-ios

  • Jayme 1 year ago

    That does not I'm likely to ignore . They must get rid of complicated paragraphs and run-on sentences. These types of advertisements powered by Bing or google.

    You have to start with tiny steps, and be patient. http://saucequeen.com/media/js/netsoltrademark.php?d=918kiss.bid%2Fdownloads%2F222-download-ace333-apk-to-phone-for-android-and-ios

  • Caleb 1 year ago

    If you suspect that the market will always act with certainty, might be in for a rude awakening. Hospital based nurses seem to get especially apt to this kind of thought.