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

AlokDev's avatar

How to deploy Laravel vite project

I have created a Larvel Vite project. It is working fine in development mode. When I made a production build then vite successfully generated the build folder inside the public directory.

Now, I don't know how to deploy it on the server. Should I have put all Laravel and public folders on my server's root folder and it works?

And how can I check the build package in the local environment without using the php artisan serve command? Just like php -S localhost:8000

0 likes
5 replies
Sinnbeck's avatar

Why not use php artisan serve locally ? Its just a wrapper for php -S localhost:8000. But it all depends on the host. Is it shared hosting or your own server ?

Sinnbeck's avatar

@AlokDev Ok. Then you put it somewhere on the server that makes sense to you (personally I use /var/www/projectname but you can also do /home/username/projectname

Then you point the webserver to that directory with /public at the end. Like /home/username/projectname/public

Regarding vite. You can either build locally and upload/pull the files when deploying, or build the files as part of the deployment

1 like
AlokDev's avatar

@Sinnbeck Thanks for the valuable guidance. I will try this and let you know.

1 like
nizzam's avatar

Do you find any method on deployment vite project ?

Please or to participate in this conversation.