First timers setting up Laravel on Shared Hosting incl Bluehost

2 min read

Clipboard01
This is a guide for complete newbies who want to install Laravel on shared hosting. This explains how to use Putty to install Composer which then installs Laravel on your server.

It is assumed you know how to navigate between directories from the command line (using commands like cd). If not read more here.

Note: Be sure to change “myprojectname” to your own project name and “path” to whatever your path may be if you are not installing in the root folder.

  1. Ensure that your webhost allows connection by SSH – you may need to get permission from your webhost or turn something on in the control panel
  2. Once peremissions are enabled, you will need to create a private SSH key in order for you to communicate with your server with Putty. In your control panel, create a private key then download it and save where it can be loaded later.
  3. Download Putty here.
  4. Run Putty with these settings:
    • Port 22
    • Your Host Name
    • Under Connection > SSH > Auth – browse for the Private Key you just saved
    • Under Connection > Data – put your webhost username if you want this sent automatically

    The first time you do this you may get a warning message that the registry key is not cached. That is normal. Click OK to proceed.
     
    putty-default
     

  5. When you run with these settings you should reach a login screen. See here for more info about logging in with Putty if you have problems
  6. Once you are logged in to your server, navigate to the directory where you want to install Laravel. Perhaps it is the root (public_html) or a subdirectory (/path).
  7. Now you need to install Composer with this command:
    curl -sS https://getcomposer.org/installer | php
  8. Now run composer with this command:
    php-cli composer.phar
    (it may take a while)
  9. Finally install Laravel with this command:
    php-cli composer.phar create-project laravel/laravel myprojectname –prefer-dist

Laravel will now be installed at
http://www.your-domain.com/path/myprojectname/public/.