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

Sampa's avatar
Level 1

How to prepare laravel 8 project for deployment

Hi all, I am a newbie to Laravel. I prepared my Laravel project properly in the local environment But when I go to upload it shared hosting my file size is too big I have checked so many tutorials, but the tutor's folder does not include even node module files So I need to know how to prepare the Laravel project for deployment without unnecessary files, please help me I am stuck with this whole day Thank you!

0 likes
5 replies
frankielee's avatar

Are you using git? Can you access the server terminal? Probably just clone your project using git command

Edit: Just want to elaborate a bit

  1. git ignore node_modules, vendor directory
  2. execute npm build production command, commit and push the files.
  3. clone the project at server
  4. run composer install command, composer install --no-dev (excluding the development packages)
  5. migrate the database.

or before step 4

run composer installs command, run all the test units and make sure they are running successfully.

2 likes
Snapey's avatar

you don't need to copy node_modules folder to your server if you have run the build script

2 likes

Please or to participate in this conversation.