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

RogerManich's avatar

How to deploy Laravel project manually?

Hi, I am in learning stage and I have not handled the deploying part. I guess my scenario will be a traditional hosting where I am only access to FTP + phpmyadmin with PHP 8.2 or PHP 8.3. No shell. Running on Apache and Linux. I assume they will enabled all the php extension required for Laravel. My question is: Can I upload a project to a hosting (the whole files and folders created by Larabel new ) and place them into root and then import the database manually? Do I need different approach? Is there any file that not required in production but is required in development environment? Maybe composer.json? Thank you

0 likes
4 replies
Snapey's avatar

This is a bad idea. get yourself a host that allows command line access.

You will battle a lot of problems with ftp

1 like
RogerManich's avatar

@Snapey I guess it. But the scenario is not something I can decide at this moment. So I need if there is a workarround to do that. If at the end it is not possible I will contemplate the possibility to explore other scenarios. Thank you

1 like
jlrdw's avatar

@Darvidor-Doe in shared I use putty.

But just FYI there have been many good past post on setting up in shared hosting.

1 like
vincent15000's avatar

I deploy my applications manually with few efforts and it works fine.

I suggest you to have a webhosting with an SSH access.

  • if you are using nodejs (for example for VueJS or TailwindCSS or ...), you have to build the manifest locally and push it to your git repository

  • connect to the web server via SSH from a console

  • clone your git repository

  • move into the project folder

  • install composer (you just have to copy / paste the 4 lines from this website : https://getcomposer.org/download/)

  • install the dependencies with composer

  • copy the .env.example file to .env and change the needed environment variables

  • don't forget to generate the application key with artisan

  • optimize with artisan (php artisan optimize)

  • bind the domain name to the public folder in your project (from inside the CPanel)

I sometimes have to customize the .htaccess file.

And I sometimes have to read the webhosting documentation to use PHP in command line (for example /usr/bin/php8.3-cli instead of just php).

I think that you have now all steps. ;)

If you have any question, don't hesitate to ask.

1 like

Please or to participate in this conversation.