DEV Community

Deploying Laravel on shared Hosting

Ndifreke Friday on August 12, 2019

If you are here, you are probably exploring how laravel works on shared hosting, on some low-budget project or just have reasons you prefer shared ...
Collapse
 
glennmen profile image
Glenn Carremans

Thanks for your blog post, I have a couple of questions though 😉

How about the symbolic link to the storage directory? Most shared hosting providers don't allow the creation of symbolic links.
laravel.com/docs/5.8/structure#the...

And this seems to work perfectly for new installs, what would you suggest the flow would be for updates that require DB migration?

Collapse
 
ndiecodes profile image
Ndifreke Friday • Edited

You are right, not all shared hosting providers allow creation of symbolic links so I have mostly just uploaded my public files to public_html by changing root path in filesystem config.

For update on db migrations... You will probably need a sql script to alter your tables or alter it manually using phpmyadmin.

Collapse
 
ndiecodes profile image
Ndifreke Friday

A friend of mine recommended this package (github.com/kofoworola/route-commands); It let's you run artisan commands through web routes. Pretty neat 😇

Collapse
 
glennmen profile image
Glenn Carremans

Interesting! Thanks for sharing.

Collapse
 
msamgan profile image
Mohammed Samgan Khan

Nice article. This was one you. You can also do the following.

it's much easier and needs min. configurations.

Collapse
 
ndiecodes profile image
Ndifreke Friday

Added some knowledge, Thanks!

Collapse
 
_shahroznawaz profile image
Shahroz Nawaz

Hi, In my experience shared hosting is not recommended for Laravel. You can instead use cloud servers like Digitalocean, Vultr, Linode etc. Also if you are non-technical you can use managed solution like Cloudways.

cloudways.com/blog/install-laravel...

Collapse
 
ibtisam021 profile image
Ibtisam021

Simple and easy process, but at todays age most people do not prefer getting into technicalities and focusing more on the business side (talking about the start-ups). So would do you prefer to them deploying on a shared hosting, or take the road of managed hosting, where there are just a few clicks and you are ready to deploy your site. Also, your data can be at risk on a shared hosting site. What do you personally prefer and why?

Collapse
 
martin_52 profile image
Martingray

Shared hosting is a bad choice for laravel. Laravel is a framework , and like other framework such as wordpress, drupal etc, it require a powerful server. For example, it requires a good amount of RAM, disk space and a good processor speed. But shared hosting is bad in all the three.If you are not a technical person, you can also choose a managed service such as Devrims.

devrims.com/blog/why-laravel-share...

Collapse
 
akashdas profile image
Akash Das

Here is another resource full article about Laravel project deployment in Shared Hosting
nihardaily.com/21-deploy-guideline...

Collapse
 
kaperskyguru profile image
Solomon Eseme

Great article explaining this process.. Thanks for the great work.

Collapse
 
ndiecodes profile image
Ndifreke Friday

Thanks Solomon 👍

Collapse
 
ace113 profile image
ace113

Do i need to upload vendor and node_modules to the ftp server??

Collapse
 
ndiecodes profile image
Ndifreke Friday

Yes on vendor, not sure about node_modules - It depends I guess.

Collapse
 
junicodefire profile image
Okechukwu Obi

Kudos Boss

Collapse
 
ndiecodes profile image
Ndifreke Friday

Mr Juni 😎

Collapse
 
rennjay profile image
rennjay soterio

Great Content. Thank you.

Collapse
 
ndiecodes profile image
Ndifreke Friday

Thanks for reading up man 🙇‍♂️

Collapse
 
rdmngithub profile image
rdmngithub

Hoping to help the impatient like me, here is a php script that can help us save a lot of time for deployment on shared hosting: laravel-deployer.planethoster.world