Deploying a Laravel application to DreamHost shared hosting

Published 5 months ago by alesh

I just deployed my first Laravel application to my DreamHost shared hosting account. There are some guides online to help with this, but none of them quite worked for me, so I wrote a blog post with the steps I followed, which may be useful. Would appreciate any feedback, if there's something I missed or did wrong!

Deploying a Laravel application to DreamHost shared hosting, 2018 edition

guilhermemuller

Thank you, information like this is always useful.

jlrdw
jlrdw
3 months ago (238,490 XP)

A suggestion, perhaps redo parts and let folks know the importance of main laravel being placed above webroot (htdocs, public_html). Here is an excellent guide that works:

http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/

Can be used also to setup development correctly in wamp, etc.

Folder structure example on a typical host: https://imgur.com/Oo6k4Fp

Honest, thanks for the guide, but I highly suggest a tweak or two for a proper install.

Snapey
Snapey
3 months ago (960,175 XP)

You are getting ahead of yourself with one link;

Deploy Laravel 6 application on shared hosting

:-)

alesh

Thanks, Snapey; fixed!

jlrdw, I will try this and update my post if I can get it to work.

Meanwhile, is there a page that gives a good overview of the risks of doing it my way, note that when I try to access my .env file at http://mudsling.alesh.com/.env ... it doesn't actually work?

iosononando

Hey @alesh , thanks for the guide! Perhaps you may want to add an extra bit of info to step 3, i.e. that also the node_modules directory should not be uploaded?

alesh

@iosononando Hmmm, where's the node_modules directory?

What else do I not need?

iosononando

@alesh , the node_modules dir is created when you run npm install which is for all the good front-end stuff. If you don't install any npm dependencies, then you don't have the folder.

On the other hand, I'll try a slightly different approach to what you suggest, namely, download the repository and then manually copy the vendor folder. That way, one can still benefit from version control while having to track only one folder manually.... or did you try that approach with little success?

alesh

Ahh, I see. Ok, I added

Also don’t upload your node_modules folder, if you have one.

sfkrystal

Thanks, @alesh. Today I installed a fresh version of Laravel 5.6.24 using PHP 7.2 FastCGI on a Dreamhost domain. I haven't set up a database yet, but for a static website, it works.

A couple notes for others who may come here:

  • You can use git if you've enabled shell access. Just remove the vendor folder from your git ignore file.

  • PHP 7.2 is available on Dreamhost now.

  • I did not run any artisan commands - I just edited the .env file directly by renaming the .env.example file to .env and copying the APP_KEY from my local install.

  • For anyone else who may have missed the part about the /public folder, @alesh did mention it, but perhaps not in the big bold letters it deserves:

Under Web directory, add /public to the end of the domain name.

anemos

Laravel supports Bootstrap through npm. So can't we use Bootstrap on DH Shared hosting?

Please sign in or create an account to participate in this conversation.