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

kp_sahani's avatar

laravel Vuejs How to Deploy on Server

I don't know how to deploy Laravel Vuejs mix project on hostinger serve or any serever, so please help me guys.

thanks

0 likes
13 replies
automica's avatar

deploying a Laravel + vuejs project is the same as deploying vanilla Laravel. You just need to ensure you have built your app.js before publishing.

Details from digital ocean https://www.digitalocean.com/community/tutorials/how-to-deploy-a-laravel-application-with-nginx-on-ubuntu-16-04

my steps

  • push to hosting
  • run composer to install vendor packages
  • set permissions for logs and storage directory
  • set up db + add settings .env
  • run artisan migrate to install db tables.
  • point webroot to /public/index.php
1 like
kp_sahani's avatar

hello sir,

can you help me for deployment laravel + vuejs on vps

i have done to config all requirement

anuzpandey's avatar

Follow these steps:

  • Run npm run prod on your project level terminal.
  • Create a zip folder of your project without the node_modules folders

Now everything is as same as deploying normal Laravel project to the server.

2 likes
automica's avatar

if you run 'npm run prod' you should get a more compact app.js. you should then commit this and deploy as normal. you shouldn't need to do anything with a zip file.

automica's avatar

@kp_sahani let me know how it goes.

BTW i'm using deployhq to do my deploys. it allows you to auto deploy from a repo and makes it super simple to do multiple deploys as you develop your project.

checkout https://www.deployhq.com/r/teypib for deets .

1 like
kp_sahani's avatar

@automica That's working fine because I'm deploy my project on heroku and tommorow i deploy same as your suggestion.

Yes, your suggestion is to much solving my problem.

Thanks

kp_sahani's avatar

@anuzpandey and @automica can you please help me, how can i run laravel + vuejs project in subfolder on server? Because i had try to your last suggestion but one issue i have faced

ChunkLoadError: Loading chunk 80 failed.

automica's avatar

@kp_sahani if you have a single domain and you are running Laravel projects in a subdirectory, you'll have to do something different with your Laravel.

This package came up in a thread the other week which may help. https://github.com/lucabecchetti/laravel_subdir

if its a single domain then you'll need to give a bit more info about where you are getting your error.

1 like
anuzpandey's avatar

@kp_sahani I didn't get about subfolder.

Is it subdomain you meant or subfolder as in ROOT/HOME / FOLDER_NAME / PROJECT_FOLDER?

If its subfolder, then change the index.php file within public_html file accordingly.

If its subdomain then please reply. Will look into it and get back to you.

kp_sahani's avatar

yes i had need to deploy on public_html/folder

ishahzeb's avatar

One thing you should know, deploying the Laravel application on shared hosting is complicated, To make this process easier, I'd recommend using a managed hosting to deploy the laravel application on the server.

Details for Gitlab Deployment: https://www.cloudways.com/blog/deploy-through-gitlab/

To install Laravel or Laravel + Vue.js is the same process on the server, you need to access the SSH terminal to run the composer command. You can either use the PuTTY terminal or SSH terminal.

Navigate to the application public_html folder and type the following Laravel Composer installation command:

composer create-project --prefer-dist laravel/laravel blog

That’s it, and you have deployed your Laravel application on the server.

Please or to participate in this conversation.