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

highdeveloper's avatar

How to deploy Laravel as backend and Nextjs as front end in VPS

0

I used Laravel as Backend for my project and it works properly in my VPS these are routes reserved for my Laravel

/admin/ //back office /api/ //for api I ran Nextjs locally very good with port 3000 but I want to run Nextjs as frontend application with many problems

When I ran this command it returned this error:

npm run build npm run start Error: listen EADDRINUSE: address already in use :::80 Also I mapped my httpd vhost to /var/www/html/laravel-app/ which this directory placed Laravel files and /var/www/html/next-app/ placed Next.js file

Finally I want these routing work properly:

example.com/admin laravel example.com/api Laravel example.com/products Next.Js

0 likes
4 replies

Please or to participate in this conversation.