Background: I am developing a Web application for Employee Management. I use Laravel for building a RESTful API, and (maybe) ReactJS for the frontend.

My problem: I am confused on how to deploy my application. My current plan is to use the command Laravel artisan serve for the RESTful API, and use Nginx for serving HTML files. But is Laravel artisan serve possible for production? How to serve RESTful API?

Some other thoughts: As far as I know about Node.js applications. We can use ExpressJS for building a RESTful API, then pm2 start app.js for production. But Node.js is good at serving dynamic contents. If I build the RESTful API with Laravel or Spring Boot, or Ruby on Rails (Sinatra), I don't think a command like pm2 start app.php (app.java or app.rb) will work (here pm2 is only for convenience, I know it is only for a Node.js app) because PHP, Java or Ruby is quite different from Node.js. I am afraid I am missing something fundamental here.

  • 2
    Maybe worth mentioning the infra where you're deploying. Most likely deploying on a PaaS solution is different than deploying on a IaaS one, for example. Nov 30, 2017 at 3:27
  • Thanks for your comment @DanCornilescu, I am deploying on an internal server of our company.
    – shintaroid
    Nov 30, 2017 at 7:35
  • 1
    You should really take a step back and read some tutorials about serving a php application be it built with alravel, symfony or from scratch on production grade configuration. Searching google for "laravel deploy to prod" brings the documentation about it in firsts results: laravel.com/docs/5.5/deployment , for java that's another story , and for RoR also (sinatra is not RoR at all and more an alternative). There's a full world of practices around each of them and the methodology will be different.
    – Tensibai
    Nov 30, 2017 at 10:38
  • Thanks, @Tensibai. I do need to learn more about the Laravel ecosystem.
    – shintaroid
    Dec 1, 2017 at 1:23

1 Answer 1


The confusion might come from the concepts behind the tools you are using. So let's start with a little definition.

Laravel and Artisan


Framework for building a full MVC Web application in PHP. It is the equivalent of Spring-boot with Java or Rails with Ruby.


Laravel's console driven interface for development. It provides tools such as the web server coming with PHP 5.4+. When using the "serve" command a simple web server will start. This is perfect for development, but I would suggest you use a server that gives you proper configuration flexibility in production such as Apache or nginx.

Your other thoughts


Are programming languages. Node.js is like an ecosystem that allows you to run client/server/middleware/tools Javascript based applications. Someone did a great job of comparing it with a Java ecosystem. Right here.

But is Laravel artisan serve possible for production?

In theory, yes. It would require your development setup to be in production as well. Hence from this assertion, the answer becomes self evident for security, operability, configuration and performance to name a few. You will need a different configuration for production.

How to serve RESTful API?

No matter which language you use, choose a library or a framework that will give you the tools to implement your APIs. Since Laravel is your framework, you can take a look at this tutorial to get started.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.