Is it possible to install a node.js in a Laravel app?

Posted March 3, 2021 3.8k views
Node.jsLaravelDigitalOcean App Platform

Our team is looking for a web server solution for this built application we have where it’s created with both Laravel and Node.js
But looking at the sample repositories - I only see one of each that can be deployed in App Platform.

I want to know if it’s possible to have both Laravel and Node.js in one App?

Or, if it’s not something possible with App Platform simply, what do I need or what can I do to setup and deploy this kind of app?

Thank you in advance! :)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

👋🏼 @angelicas

Yes, you can deploy an app that uses both Node.js and PHP. Make sure you commit your Composer lockfile as well as your Node.js lockfiles (NPM’s or Yarn’s).

You can see an example in our Sample Laravel app:

Thanks @kamaln7 !

I’m not a web dev or a server admin myself, but I want to understand and know what kind of components do I need to add to my app platform or setup if I need to test and deploy an app built with laravel and node.js?

Is there a tutorial for the components anatomy for what I need for my app?

  • Take a look at this video: Build, Deploy, and Scale Your First Web App Using DigitalOcean App Platform. Starting at 4:54, I demo deploying a Laravel app with a few components. I don’t have a written version of it unfortunately.

    Which components you need depends on your app but I hope the video will help clarify the requirements a bit. If you’re unsure feel free to post some details here and I’ll let you know.

    As for running tests, we don’t have a built-in testing pipeline at this time. Some options are:

    • Running tests as part of the build command
    • Disabling auto deploy on push, and using an external CI pipeline such as GitHub Actions to run tests and then use doctl app create-deployment to deploy the app on success. More info on doctl
    by Kamal Nasser
    An introductory talk designed for beginners — learn how to rapidly build, deploy, manage, and scale a web app on DigitalOcean.