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

HKansakar's avatar

laravel deploying to server using FTP

I want to know all about laravel deployment to server not on localhost, and my laravel project is already made in localhost and i want to deploy it to the server.. is there anybody who can give me ans of my question..also mention the changes in files while deploying which needs to do..

0 likes
2 replies
Yamen's avatar

1 - Remove vendor and node_modules folders, later we'll install them on host.

2- Now let's imagine your host folders like this:

/home

/home/public_html.

3- In /home upload your project, now it's /home/my-project.

4- Now copy files in /my-project/public and paste it in /home/public_html or if you've another domains maybe to /home/public_html/my-project.com.

5- Login to your host with suitable ssh mean and cd to your project directory and run composer install.

6- The last important change on your code is in /home/public_html/index.php , you should change

require __DIR__.'/../bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';

to

require __DIR__.'/../../my-project/bootstrap/autoload.php';
$app = require_once __DIR__.'/../../my-project/bootstrap/app.php';

I think that's all you need.

Please or to participate in this conversation.