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

Seif5's avatar

deploy laravel hostgator VHM

Hello,

I am new with shared hosting , So I bought a VPS server from 'hostgator ' I started with connectig to the server with PUTTY ,so my problem here is how I can send any files to the server and make it point to laravel project . I have tried before with git , but now I didn't know how i can use that - any one help me please I am really confused .. !!!!

Thakns

0 likes
7 replies
ejdelmonico's avatar

Usually you would copy the files into the public_ html folder and tweek your htaccess file. But karavel is a different beast. I would just Google it. I know there are tutorials about using a VPS other than Linodoe, AWS or Digital Ocean.

Worktrait's avatar

Hi!

I find in the same situation do you resolve this?

lara25260's avatar

I use bitbucket to auto deploy updates to my Plesk control panel with gut installed.

kevuno's avatar

You need to have your laravel project in a different folder than the public_html (or sometimes just called "html") directory, but without including the public folder of the project. (I recommend placing the project inside a folder at the same level as the public_html) Whatever is on the public folder goes inside the public_html directory. You have to edit server.php (which is found in the root of the laravel project) and index.php, which is inside the public folder. You have you edit them so that this lines point towards the right direction:

Inside server.php: require_once DIR.'/public/index.php';

Inside index.php require DIR.'/../bootstrap/autoload.php';

$app = require_once DIR.'/../bootstrap/app.php';

So for example if you have your laravel project in a folder called project, which is at the same level as the public_html folder, and everything that was in your public folder you put it inside the public_html folder, then this line would look like this:

Inside server.php: require_once DIR.'/../public_html/index.php';

Inside index.php require DIR.'/../project/bootstrap/autoload.php'; $app = require_once DIR.'/../project/bootstrap/app.php';

Worktrait's avatar

Thanks for your reply, I have a VPS Hostgator plan, let me know if I am wrong but putting folder project outside of public_html applies in cases where you have a share plan right? So I will follow the advice to clone my repository using git and then I will grant the required permissions to my the folder.

Please or to participate in this conversation.