How to Install Composer and Laravel 5 in cPanel

How to Install Composer and Laravel 5 in cPanel

Do you need to know how to install Laravel 5 in a cPanel account?

In this tutorial, I walk you through installing Composer and Laravel 5 in a cPanel account. This can be done on any cPanel account, including shared hosting. Start your next PHP Project using one of the best frameworks out there.

Two things to note is that this should be followed on an empty account, or make sure you back up your public_html folder before proceeding because you will lose everything in this folder. You will also need SSH access. If you are on a shared hosting account and you do not have SSH access, please contact your host prior to following this tutorial. Once you have access, download PuTTY and login to your account.

Ignore every time I say public.html or public/html, I mean public_html or just basically “public html.”

Have any questions? Feel free to ask.

Remember to visit for the rest of my tutorials (including a version of this tutorial). If you find this tutorial helpful, please like and share.

Thanks for watching, remember to subscribe!

#Laravel #Composer #cPanel

Visit my website:
Subscribe on YouTube:
Support me on Patreon:
Follow me on Twitter:
Like me on Facebook:
Check out my Github:

38 thoughts on “How to Install Composer and Laravel 5 in cPanel

  1. Still works 5 years later 🙂
    I am curious though how I would need to go about keeping the front-end of the website as the wordpress site we've already made and the laravel project as the web app part of it.
    At this point I just copied the original folder that was public_html and called it something arbitrary like backups so any information on incorporating the wordpress stuff back in would be helpful! I've never dealt with WP so I am not even sure if its as simple as telling WP "Hey point to this folder instead" or if the WP stuff needs to also go into our public folder inside the laravel folder.

  2. You can also use htaccess to change which folder is the root folder, or just change which folder the domain points to in the domain settings of cPanel.

  3. How come I couldn't run PHP into my remote shell every time I type php installer –check ?

    Here is the message :
    Can't locate in @INC (you may need to install the ea_php_cli module) (@INC contains: /var/cpanel/ea4 /home/myUsername/perl5/lib/perl5 /usr/local/cpanel /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib /usr/local/cpanel/3rdparty/perl/528/lib/perl5/5.28.0/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/528/lib/perl5/5.28.0 /opt/cpanel/perl5/528/site_lib/x86_64-linux-64int /opt/cpanel/perl5/528/site_lib) at /usr/local/bin/php line 17.

    BEGIN failed–compilation aborted at /usr/local/bin/php line 17.

  4. sir what happen if i'm going to add two laravel project and two different domain, do i need to make Slink? what will happen to public html.

  5. Thank you so much for this. May be a couple of years old but still works like a charm for Laravel 5.8. After weeks of struggling with instructions from, I found this and in 15mins I had my site installed on 1&1 CPanel

  6. This video was really helpful
    can you please make a video on how to install node/npm in cpanel
    so we can install the dependencies and packages related to laravel

  7. Thanks for this video. It should be helpful to me. My only concern is why you indicated the need to do this in a unused hosting account. Why not just put in a subdirectory. So, your soft link to "public_html" could be to "public_html/subdir". You'd have no need to do the scary command "rm -rf". Someone could test things out in a subdirectory, and if all works well, move to the main.

  8. Hi, I want to host my laravel website inside public_html/test_project, I want to keep the whole laravel project under "test_project", If It is possible, Please help me for this. Thanks

  9. I followed your steps exactly everything went fine but in the end i see internal server error page .. this is my domain

  10. hello sir i follow the whole steps corectly every thing is done fine on putty but at the end while i refresh browser i got http error 500 please tell me what i m missing

  11. I have a problem when creating a symlink public_html points to laravel/public – HTTP ERROR 500. But when I just symlink public_html to laravel/ and use it works. Please help me! I use SSH in AWS VPS and install Vestacp. Thank you very much!

  12. I wouldn't recommend a cPanel based shared server for hosting a Laravel website, because shared servers are not good for the security and performance of your Laravel app. If you want a secure and fast server, a better option is to host Laravel on cloud using Cloudways platform. This platform lets you launch a laravel server on cloud in just few minutes and quickly deploy your app from git or sftp.

  13. Can you please give any solution for update the composer on live server. Basically I want to update composer on live site for the pdf composer on current working site. And i new in laravel so please help me for the same

    Thank you for that video

  14. Ok figured out how to make it work. This is one if no the best video i seen explaining how to do this through ssh. Thanks

  15. I have a question if im running this on a shared hosting should i install composer on public_html or on a specific folder where im going to run laravel? Since i have a shred hosting i have multiple websites don't want to mess up what's there already. I'm a noob at this but really liking your tutorial very clear.

Leave a Reply

Your email address will not be published. Required fields are marked *