Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kikloo's avatar

Where do you deploy your laravel app securely ?

Hi,

I’m having issues with Laravel. I.e I change one thing and the other stops working, fix the other and when uploading the project to live it doesn’t works there.

My question is where do you host your laravel app i.e. right now I’m uploading to git. And deploy to shared hosting.

Where do you host / deploy so you don’t have to deal with public folder to change to public_html etc. ? I.e what works on your local will also work on live ?

Can I have some suggestions regarding the hosting ? I have to do a project and I’m loosing too much time on such little things.

Any feedback is appreciated.

Thanks.

0 likes
2 replies
martinbean's avatar

@kikloo I don’t think hosting is your biggest issue. If you’re making changes to one thing and another thing breaks, or you’re not finding stuff’s broken at all until deploying, then it sounds like you have no tests, or not anywhere enough coverage to be confident in your code.

As for the actual deployment process, you can change the name of the public directory in Laravel.

First, you need to rename the public directory to public_html in your repository:

git mv public public_html

Then tell Laravel your public directory is now named “public_html”. In your bootstrap/app.php file, after this section:

$app = new Illuminate\Foundation\Application(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);

Put:

$app->usePublicPath($app->basePath('public_html'));

Please or to participate in this conversation.